Commit f2dadc47 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

Merge remote-tracking branch 'origin/master' into 15246_reduce_recursive_includes_in_Algorithm.h

Fixed conflicts with last few days changes in master, especially with InstrumentWidget files that
have been moved and revamped, re #15246.
parents ad814ae0 7888407a
......@@ -41,7 +41,7 @@ public:
input->getSpectrum(0)->setSpectrumNo(0);
input->getSpectrum(1)->setSpectrumNo(1);
input->getSpectrum(2)->setSpectrumNo(2);
boost::shared_ptr<Instrument> instr(new Instrument);
boost::shared_ptr<Instrument> instr = boost::make_shared<Instrument>();
input->setInstrument(instr);
Mantid::Geometry::Detector *mon =
new Mantid::Geometry::Detector("monitor", 0, NULL);
......@@ -357,7 +357,7 @@ public:
// create ws without monitors.
MatrixWorkspace_sptr input =
WorkspaceCreationHelper::Create2DWorkspace123(3, 10, 1);
boost::shared_ptr<Instrument> instr(new Instrument);
boost::shared_ptr<Instrument> instr = boost::make_shared<Instrument>();
input->setInstrument(instr);
AnalysisDataService::Instance().add("someWS", input);
......
......@@ -19,7 +19,7 @@ public:
// released automatically when it goes out of scope
boost::shared_ptr<RadiusSum> algInstance() {
boost::shared_ptr<RadiusSum> alg(new RadiusSum());
boost::shared_ptr<RadiusSum> alg = boost::make_shared<RadiusSum>();
TS_ASSERT_THROWS_NOTHING(alg->initialize());
TS_ASSERT(alg->isInitialized());
return alg;
......
......@@ -489,7 +489,8 @@ private:
}
Workspace2D_sptr Create2DWorkspace(int xlen, int ylen) {
boost::shared_ptr<Mantid::MantidVec> x1(new Mantid::MantidVec(xlen, 0.0));
boost::shared_ptr<Mantid::MantidVec> x1 =
boost::make_shared<Mantid::MantidVec>(xlen, 0.0);
boost::shared_ptr<Mantid::MantidVec> y1(
new Mantid::MantidVec(xlen - 1, 3.0));
boost::shared_ptr<Mantid::MantidVec> e1(
......
......@@ -176,7 +176,8 @@ private:
}
Workspace2D_sptr Create2DWorkspaceHist(int xlen, int ylen) {
boost::shared_ptr<Mantid::MantidVec> x1(new Mantid::MantidVec(xlen, 0.0));
boost::shared_ptr<Mantid::MantidVec> x1 =
boost::make_shared<Mantid::MantidVec>(xlen, 0.0);
boost::shared_ptr<Mantid::MantidVec> y1(
new Mantid::MantidVec(xlen - 1, 0.0));
boost::shared_ptr<Mantid::MantidVec> e1(
......@@ -208,10 +209,14 @@ private:
}
Workspace2D_sptr Create2DWorkspacePnt(int xlen, int ylen) {
boost::shared_ptr<Mantid::MantidVec> x1(new Mantid::MantidVec(xlen, 0.0));
boost::shared_ptr<Mantid::MantidVec> y1(new Mantid::MantidVec(xlen, 0.0));
boost::shared_ptr<Mantid::MantidVec> e1(new Mantid::MantidVec(xlen, 0.0));
boost::shared_ptr<Mantid::MantidVec> e2(new Mantid::MantidVec(xlen, 0.0));
boost::shared_ptr<Mantid::MantidVec> x1 =
boost::make_shared<Mantid::MantidVec>(xlen, 0.0);
boost::shared_ptr<Mantid::MantidVec> y1 =
boost::make_shared<Mantid::MantidVec>(xlen, 0.0);
boost::shared_ptr<Mantid::MantidVec> e1 =
boost::make_shared<Mantid::MantidVec>(xlen, 0.0);
boost::shared_ptr<Mantid::MantidVec> e2 =
boost::make_shared<Mantid::MantidVec>(xlen, 0.0);
Workspace2D_sptr retVal(new Workspace2D);
retVal->initialize(ylen, xlen, xlen);
......
......@@ -84,7 +84,8 @@ private:
}
Workspace2D_sptr Create2DWorkspace(int xlen, int ylen) {
boost::shared_ptr<Mantid::MantidVec> x1(new Mantid::MantidVec(xlen, 0.0));
boost::shared_ptr<Mantid::MantidVec> x1 =
boost::make_shared<Mantid::MantidVec>(xlen, 0.0);
boost::shared_ptr<Mantid::MantidVec> y1(
new Mantid::MantidVec(xlen - 1, 3.0));
boost::shared_ptr<Mantid::MantidVec> e1(
......
......@@ -219,8 +219,10 @@ public:
testWorkspace->setTitle("input2D");
testWorkspace->initialize(2, 5, 4);
boost::shared_ptr<Mantid::MantidVec> X(new Mantid::MantidVec);
boost::shared_ptr<Mantid::MantidVec> Y(new Mantid::MantidVec);
boost::shared_ptr<Mantid::MantidVec> X =
boost::make_shared<Mantid::MantidVec>();
boost::shared_ptr<Mantid::MantidVec> Y =
boost::make_shared<Mantid::MantidVec>();
for (int i = 0; i < 4; ++i) {
X->push_back(10 * i);
......
......@@ -57,7 +57,8 @@ private:
void createWorkspace(std::string wsName) {
// create a fake workspace for testing
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester());
boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace(wsName, input);
Mantid::API::AlgorithmFactory::Instance().subscribe<SimpleSum>();
......
......@@ -30,12 +30,15 @@ public:
Workspace_sptr space =
WorkspaceFactory::Instance().create("Workspace2D", Nhist, 11, 10);
Workspace2D_sptr space2D = boost::dynamic_pointer_cast<Workspace2D>(space);
boost::shared_ptr<Mantid::MantidVec> x(new Mantid::MantidVec(11));
boost::shared_ptr<Mantid::MantidVec> x =
boost::make_shared<Mantid::MantidVec>(11);
for (int i = 0; i < 11; ++i) {
(*x)[i] = i * 1000;
}
boost::shared_ptr<Mantid::MantidVec> a(new Mantid::MantidVec(10));
boost::shared_ptr<Mantid::MantidVec> e(new Mantid::MantidVec(10));
boost::shared_ptr<Mantid::MantidVec> a =
boost::make_shared<Mantid::MantidVec>(10);
boost::shared_ptr<Mantid::MantidVec> e =
boost::make_shared<Mantid::MantidVec>(10);
for (int i = 0; i < 10; ++i) {
(*a)[i] = i;
(*e)[i] = sqrt(double(i));
......
......@@ -183,7 +183,8 @@ public:
work_in2->setInstrument(instr);
// set some dead detectors
boost::shared_ptr<Mantid::MantidVec> yDead(new Mantid::MantidVec(nHist, 0));
boost::shared_ptr<Mantid::MantidVec> yDead =
boost::make_shared<Mantid::MantidVec>(nHist, 0);
for (int i = 0; i < nBins; i++) {
if (i % 2 == 0) {
work_in1->setData(i, yDead, yDead);
......
......@@ -259,8 +259,7 @@ void IntegratePeakTimeSlices::exec() {
// For quickly looking up workspace index from det id
m_wi_to_detid_map = inpWkSpace->getDetectorIDToWorkspaceIndexMap();
TableWorkspace_sptr TabWS =
boost::shared_ptr<TableWorkspace>(new TableWorkspace(0));
TableWorkspace_sptr TabWS = boost::make_shared<TableWorkspace>(0);
//----------------------------- get Peak extents
//------------------------------
......@@ -334,10 +333,10 @@ void IntegratePeakTimeSlices::exec() {
m_yvec * (Centy - m_ROW) * m_cellHeight +
m_xvec * (Centx - m_COL) * m_cellWidth;
boost::shared_ptr<DataModeHandler> XXX(new DataModeHandler(
auto XXX = boost::make_shared<DataModeHandler>(
R, R, Centy, Centx, m_cellWidth, m_cellHeight,
getProperty("CalculateVariances"), NBadEdgeCells,
m_NCOLS - NBadEdgeCells, NBadEdgeCells, m_NROWS - NBadEdgeCells));
m_NCOLS - NBadEdgeCells, NBadEdgeCells, m_NROWS - NBadEdgeCells);
m_AttributeValues = XXX;
XXX->setCurrentRadius(R);
......@@ -390,8 +389,8 @@ void IntegratePeakTimeSlices::exec() {
// Set from attributes replace by m_R0
m_R0 = -1;
int LastTableRow = -1;
boost::shared_ptr<DataModeHandler> origAttributeList(new DataModeHandler());
boost::shared_ptr<DataModeHandler> lastAttributeList(new DataModeHandler());
auto origAttributeList = boost::make_shared<DataModeHandler>();
auto lastAttributeList = boost::make_shared<DataModeHandler>();
for (int dir = 1; dir >= -1; dir -= 2) {
bool done = false;
......@@ -496,8 +495,8 @@ void IntegratePeakTimeSlices::exec() {
chanMax = xchan + 1;
if (dir < 0)
chanMax++;
boost::shared_ptr<DataModeHandler> XXX(
new DataModeHandler(*m_AttributeValues));
auto XXX =
boost::make_shared<DataModeHandler>(*m_AttributeValues);
m_AttributeValues = XXX;
if (X.size() > 0)
m_AttributeValues->setTime((X[chanMax] + X[chanMin]) / 2.0);
......@@ -510,8 +509,8 @@ void IntegratePeakTimeSlices::exec() {
if (lastAttributeList->case4)
chanMax++;
boost::shared_ptr<DataModeHandler> XXX(
new DataModeHandler(*lastAttributeList));
auto XXX =
boost::make_shared<DataModeHandler>(*lastAttributeList);
m_AttributeValues = XXX;
m_AttributeValues->setTime((time + m_AttributeValues->time) /
......@@ -581,7 +580,7 @@ void IntegratePeakTimeSlices::exec() {
LastTableRow = -1;
} else {
boost::shared_ptr<DataModeHandler> XXX(new DataModeHandler());
auto XXX = boost::make_shared<DataModeHandler>();
lastAttributeList = XXX;
}
done = true;
......@@ -1482,10 +1481,10 @@ void IntegratePeakTimeSlices::SetUpData(
int NBadEdgeCells = getProperty("NBadEdgePixels");
boost::shared_ptr<DataModeHandler> X(new DataModeHandler(
auto X = boost::make_shared<DataModeHandler>(
Radius, Radius, CentY, CentX, m_cellWidth, m_cellHeight,
getProperty("CalculateVariances"), NBadEdgeCells, m_NCOLS - NBadEdgeCells,
NBadEdgeCells, m_NROWS - NBadEdgeCells));
NBadEdgeCells, m_NROWS - NBadEdgeCells);
m_AttributeValues = X;
m_AttributeValues->setCurrentRadius(Radius);
......@@ -1529,10 +1528,10 @@ void IntegratePeakTimeSlices::SetUpData(
neighborRadius -= DD;
// if( changed) CentNghbr = CentPos.
boost::shared_ptr<DataModeHandler> X1(new DataModeHandler(
auto X1 = boost::make_shared<DataModeHandler>(
Radius, NewRadius, CentY, CentX, m_cellWidth, m_cellHeight,
getProperty("CalculateVariances"), NBadEdgeCells, m_NCOLS - NBadEdgeCells,
NBadEdgeCells, m_NROWS - NBadEdgeCells));
NBadEdgeCells, m_NROWS - NBadEdgeCells);
m_AttributeValues = X1;
m_AttributeValues->setCurrentRadius(NewRadius);
......
......@@ -305,9 +305,9 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
// bug
tempWS->populateInstrumentParameters();
Geometry::Instrument_const_sptr instr_old = tempWS->getInstrument();
boost::shared_ptr<ParameterMap> map(new ParameterMap());
Geometry::Instrument_const_sptr instr(
new Geometry::Instrument(instr_old->baseInstrument(), map));
auto map = boost::make_shared<ParameterMap>();
auto instr = boost::make_shared<const Geometry::Instrument>(
instr_old->baseInstrument(), map);
std::string s = ApplyCalibInfo(in, "", instr_old, instr, T0);
outWS->setInstrument(instr);
......
......@@ -436,7 +436,7 @@ void OptimizeCrystalPlacement::exec() {
boost::shared_ptr<const Instrument> OldInstrument = peak.getInstrument();
boost::shared_ptr<const ParameterMap> pmap_old =
OldInstrument->getParameterMap();
boost::shared_ptr<ParameterMap> pmap_new(new ParameterMap());
auto pmap_new = boost::make_shared<ParameterMap>();
PeakHKLErrors::cLone(pmap_new, OldInstrument, pmap_old);
......@@ -450,8 +450,7 @@ void OptimizeCrystalPlacement::exec() {
if (OldInstrument->isParametrized())
Inst = OldInstrument->baseInstrument();
boost::shared_ptr<const Instrument> NewInstrument(
new Geometry::Instrument(Inst, pmap_new));
auto NewInstrument = boost::make_shared<Geometry::Instrument>(Inst, pmap_new);
SCDCalibratePanels::FixUpSourceParameterMap(NewInstrument, L0, newSampPos,
pmap_old);
......
......@@ -181,7 +181,7 @@ void PeakHKLErrors::cLone(
boost::shared_ptr<Geometry::Instrument>
PeakHKLErrors::getNewInstrument(PeaksWorkspace_sptr Peaks) const {
Geometry::Instrument_const_sptr instSave = Peaks->getPeak(0).getInstrument();
boost::shared_ptr<Geometry::ParameterMap> pmap(new Geometry::ParameterMap());
auto pmap = boost::make_shared<Geometry::ParameterMap>();
boost::shared_ptr<const Geometry::ParameterMap> pmapSv =
instSave->getParameterMap();
......@@ -189,20 +189,18 @@ PeakHKLErrors::getNewInstrument(PeaksWorkspace_sptr Peaks) const {
g_log.error(" Peaks workspace does not have an instrument");
throw std::invalid_argument(" Not all peaks have an instrument");
}
boost::shared_ptr<Geometry::Instrument> instChange(
new Geometry::Instrument());
auto instChange = boost::shared_ptr<Geometry::Instrument>();
if (!instSave->isParametrized()) {
boost::shared_ptr<Geometry::Instrument> instClone(instSave->clone());
boost::shared_ptr<Geometry::Instrument> Pinsta(
new Geometry::Instrument(instSave, pmap));
auto Pinsta = boost::make_shared<Geometry::Instrument>(instSave, pmap);
instChange = Pinsta;
} else // catch(... )
{
boost::shared_ptr<Geometry::Instrument> P1(
new Geometry::Instrument(instSave->baseInstrument(), pmap));
auto P1 = boost::make_shared<Geometry::Instrument>(
instSave->baseInstrument(), pmap);
instChange = P1;
}
......
......@@ -156,8 +156,7 @@ SCDCalibratePanels::calcWorkspace(DataObjects::PeaksWorkspace_sptr &pwks,
yvalB.assign(xRef.size(), 0.0);
if (N < 4) // If not well indexed
return boost::shared_ptr<DataObjects::Workspace2D>(
new DataObjects::Workspace2D);
return boost::make_shared<DataObjects::Workspace2D>();
MatrixWorkspace_sptr mwkspc =
API::WorkspaceFactory::Instance().create("Workspace2D", 1, 3 * N, 3 * N);
......@@ -309,7 +308,7 @@ boost::shared_ptr<const Instrument> SCDCalibratePanels::GetNewCalibInstrument(
bool xml = (preprocessCommand == "C)Apply a LoadParameter.xml type file");
boost::shared_ptr<const ParameterMap> pmap0 = instrument->getParameterMap();
boost::shared_ptr<ParameterMap> pmap1(new ParameterMap());
auto pmap1 = boost::make_shared<ParameterMap>();
for (auto bankName : AllBankNames) {
updateBankParams(instrument->getComponentByName(bankName), pmap1, pmap0);
......@@ -901,11 +900,11 @@ void SCDCalibratePanels::exec() {
//---------------- Create new instrument with ------------------------
//--------------new parameters to SAVE to files---------------------
boost::shared_ptr<ParameterMap> pmap(new ParameterMap());
auto pmap = boost::make_shared<ParameterMap>();
boost::shared_ptr<const ParameterMap> pmapOld =
instrument->getParameterMap();
boost::shared_ptr<const Instrument> NewInstrument(
new Instrument(instrument->baseInstrument(), pmap));
boost::shared_ptr<const Instrument> NewInstrument =
boost::make_shared<Instrument>(instrument->baseInstrument(), pmap);
boost::shared_ptr<const RectangularDetector> bank_rect;
double rotx, roty, rotz;
......
......@@ -287,7 +287,7 @@ Instrument_sptr
SCDPanelErrors::getNewInstrument(const Geometry::IPeak &peak) const {
Geometry::Instrument_const_sptr instSave = peak.getInstrument();
boost::shared_ptr<Geometry::ParameterMap> pmap(new ParameterMap());
auto pmap = boost::make_shared<ParameterMap>();
boost::shared_ptr<const Geometry::ParameterMap> pmapSv =
instSave->getParameterMap();
......@@ -295,13 +295,11 @@ SCDPanelErrors::getNewInstrument(const Geometry::IPeak &peak) const {
g_log.error(" Not all peaks have an instrument");
throw std::invalid_argument(" Not all peaks have an instrument");
}
boost::shared_ptr<Geometry::Instrument> instChange(
new Geometry::Instrument());
auto instChange = boost::make_shared<Geometry::Instrument>();
if (!instSave->isParametrized()) {
boost::shared_ptr<Geometry::Instrument> instClone(instSave->clone());
boost::shared_ptr<Geometry::Instrument> Pinsta(
new Geometry::Instrument(instSave, pmap));
auto Pinsta = boost::make_shared<Geometry::Instrument>(instSave, pmap);
instChange = Pinsta;
} else // catch(...)
......@@ -311,8 +309,8 @@ SCDPanelErrors::getNewInstrument(const Geometry::IPeak &peak) const {
boost::dynamic_pointer_cast<const IComponent>(instSave);
// updateParams(pmapSv, pmap, inst3);
boost::shared_ptr<Geometry::Instrument> P1(
new Geometry::Instrument(instSave->baseInstrument(), pmap));
auto P1 = boost::make_shared<Geometry::Instrument>(
instSave->baseInstrument(), pmap);
instChange = P1;
}
......@@ -1354,8 +1352,8 @@ void SCDPanelErrors::setAttribute(const std::string &attName,
if (recalcB) {
if (a_set && b_set && c_set && alpha_set && beta_set && gamma_set) {
m_unitCell = boost::shared_ptr<Geometry::UnitCell>(
new Geometry::UnitCell(a, b, c, alpha, beta, gamma));
m_unitCell =
boost::make_shared<Geometry::UnitCell>(a, b, c, alpha, beta, gamma);
}
}
}
......
......@@ -44,8 +44,6 @@ void SaveIsawPeaks::init() {
declareProperty("AppendFile", false, "Append to file if true.\n"
"If false, new file (default).");
std::vector<std::string> exts{".peaks", ".integrate"};
declareProperty(new FileProperty("Filename", "", FileProperty::Save,
{".peaks", ".integrate"}),
"Path to an ISAW-style peaks or integrate file to save.");
......
......@@ -120,7 +120,7 @@ public:
//--------------------------------
int nn = 3; // sample offsets used
boost::shared_ptr<Jacob> Jac(new Jacob(10 + nn, N));
boost::shared_ptr<Jacob> Jac = boost::make_shared<Jacob>(10 + nn, N);
calib.functionDeriv1D(Jac.get(), xVals.data(), (size_t)N);
calib.functionDeriv1D(Jac.get(), xVals.data(), (size_t)N);
......
......@@ -1238,7 +1238,7 @@ DataObjects::TableWorkspace_sptr
RefinePowderInstrumentParameters::genMCResultTable() {
// 1. Create table workspace
DataObjects::TableWorkspace_sptr tablews =
boost::shared_ptr<TableWorkspace>(new TableWorkspace());
boost::make_shared<TableWorkspace>();
tablews->addColumn("double", "Chi2");
tablews->addColumn("double", "GSLChi2");
......
......@@ -130,8 +130,7 @@ void FitMW::declareDatasetProperties(const std::string &suffix, bool addProp) {
m_normalisePropertyName = "Normalise" + suffix;
if (addProp && !m_manager->existsProperty(m_workspaceIndexPropertyName)) {
auto mustBePositive =
boost::shared_ptr<BoundedValidator<int>>(new BoundedValidator<int>());
auto mustBePositive = boost::make_shared<BoundedValidator<int>>();
mustBePositive->setLower(0);
declareProperty(new PropertyWithValue<int>(m_workspaceIndexPropertyName, 0,
mustBePositive),
......
......@@ -178,6 +178,7 @@ void Convolution::function(const FunctionDomain &domain,
CompositeFunction_sptr cf =
boost::dynamic_pointer_cast<CompositeFunction>(getFunction(1));
if (cf) {
dltFuns.reserve(cf->nFunctions());
for (size_t i = 0; i < cf->nFunctions(); ++i) {
auto df = boost::dynamic_pointer_cast<DeltaFunction>(cf->getFunction(i));
if (df) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment