diff --git a/Framework/API/src/Algorithm.cpp b/Framework/API/src/Algorithm.cpp index 9320fc423a43cbbf679a3d5bd3a9b24b54ca42aa..a43577518846f4662d37b5fe8db4fa0e5840b300 100644 --- a/Framework/API/src/Algorithm.cpp +++ b/Framework/API/src/Algorithm.cpp @@ -1230,7 +1230,7 @@ bool Algorithm::processGroups() { for (auto &pureOutputWorkspaceProp : m_pureOutputWorkspaceProps) { Property *prop = dynamic_cast<Property *>(pureOutputWorkspaceProp); if (prop) { - WorkspaceGroup_sptr outWSGrp = WorkspaceGroup_sptr(new WorkspaceGroup()); + auto outWSGrp = boost::make_shared<WorkspaceGroup>(); outGroups.push_back(outWSGrp); // Put the GROUP in the ADS AnalysisDataService::Instance().addOrReplace(prop->value(), outWSGrp); diff --git a/Framework/API/src/MultipleExperimentInfos.cpp b/Framework/API/src/MultipleExperimentInfos.cpp index 01c60a60f20ff2bf1de8a2e0be3c04b55e187fca..011d0365ead34e6a59ec7b9d81e79104e00e0624 100644 --- a/Framework/API/src/MultipleExperimentInfos.cpp +++ b/Framework/API/src/MultipleExperimentInfos.cpp @@ -100,7 +100,7 @@ void MultipleExperimentInfos::copyExperimentInfos( m_expInfos.reserve(other.m_expInfos.size()); // Do a deep copy of ExperimentInfo's for (const auto &expInfo : other.m_expInfos) { - ExperimentInfo_sptr copy(new ExperimentInfo(*expInfo)); + auto copy(boost::make_shared<ExperimentInfo>(*expInfo)); m_expInfos.push_back(copy); } } diff --git a/Framework/DataHandling/src/Load.cpp b/Framework/DataHandling/src/Load.cpp index 2ebe08683fb39b8d19b22d17156204045b1a3716..3d4c2371c812d8cf1223523241cc3f657ca15a1f 100644 --- a/Framework/DataHandling/src/Load.cpp +++ b/Framework/DataHandling/src/Load.cpp @@ -726,7 +726,7 @@ API::Workspace_sptr Load::plusWs(Workspace_sptr ws1, Workspace_sptr ws2) { */ API::WorkspaceGroup_sptr Load::groupWsList(const std::vector<API::Workspace_sptr> &wsList) { - WorkspaceGroup_sptr group = WorkspaceGroup_sptr(new WorkspaceGroup); + auto group = boost::make_shared<WorkspaceGroup>(); for (const auto &ws : wsList) { WorkspaceGroup_sptr isGroup = diff --git a/Framework/DataHandling/src/LoadCalFile.cpp b/Framework/DataHandling/src/LoadCalFile.cpp index 38793cb2faec4e8a4cecb3a021367054e7a379e7..ef43a2b6429ef3724033e0614d654b3ccf662b3c 100644 --- a/Framework/DataHandling/src/LoadCalFile.cpp +++ b/Framework/DataHandling/src/LoadCalFile.cpp @@ -108,7 +108,7 @@ LoadCalFile::getInstrument3Ways(Algorithm *alg) { } else { Algorithm_sptr childAlg = alg->createChildAlgorithm("LoadInstrument", 0.0, 0.2); - MatrixWorkspace_sptr tempWS(new Workspace2D()); + MatrixWorkspace_sptr tempWS = boost::make_shared<Workspace2D>(); childAlg->setProperty<MatrixWorkspace_sptr>("Workspace", tempWS); childAlg->setPropertyValue("Filename", InstrumentFilename); childAlg->setPropertyValue("InstrumentName", InstrumentName); diff --git a/Framework/DataHandling/src/LoadCanSAS1D.cpp b/Framework/DataHandling/src/LoadCanSAS1D.cpp index 43b1bc6cc337bb03db6f37a1178b0f5de1b3099d..096c1e96f7589007e781bdde2075ca2a442da332 100644 --- a/Framework/DataHandling/src/LoadCanSAS1D.cpp +++ b/Framework/DataHandling/src/LoadCanSAS1D.cpp @@ -129,7 +129,7 @@ void LoadCanSAS1D::exec() { outputWork = WS; break; default: - WorkspaceGroup_sptr group(new WorkspaceGroup); + auto group = boost::make_shared<WorkspaceGroup>(); for (unsigned int i = 0; i < numEntries; ++i) { std::string runName; MatrixWorkspace_sptr newWork = loadEntry(entryList->item(i), runName); diff --git a/Framework/DataHandling/src/LoadNexusProcessed.cpp b/Framework/DataHandling/src/LoadNexusProcessed.cpp index 036d545ce74dac04635ba97da12ee2b2db8d30db..becdba1f735958c876802f855ef098593b519014 100644 --- a/Framework/DataHandling/src/LoadNexusProcessed.cpp +++ b/Framework/DataHandling/src/LoadNexusProcessed.cpp @@ -436,7 +436,7 @@ void LoadNexusProcessed::exec() { m_list = !specListProp->isDefault(); // Load all first level entries - WorkspaceGroup_sptr wksp_group(new WorkspaceGroup); + auto wksp_group = boost::make_shared<WorkspaceGroup>(); // This forms the name of the group std::string base_name = getPropertyValue("OutputWorkspace"); // First member of group should be the group itself, for some reason! diff --git a/Framework/DataHandling/src/LoadVulcanCalFile.cpp b/Framework/DataHandling/src/LoadVulcanCalFile.cpp index 4e0b22c9fdda8121e41eb7a9e35cb5962722b2ac..c75e092a8df23089b040ad219d3adf37d67fd73d 100644 --- a/Framework/DataHandling/src/LoadVulcanCalFile.cpp +++ b/Framework/DataHandling/src/LoadVulcanCalFile.cpp @@ -614,7 +614,7 @@ Geometry::Instrument_const_sptr LoadVulcanCalFile::getInstrument() { Instrument_const_sptr inst; Algorithm_sptr childAlg = createChildAlgorithm("LoadInstrument", 0.0, 0.2); - MatrixWorkspace_sptr tempWS(new Workspace2D()); + MatrixWorkspace_sptr tempWS = boost::make_shared<Workspace2D>(); childAlg->setProperty<MatrixWorkspace_sptr>("Workspace", tempWS); childAlg->setPropertyValue("InstrumentName", InstrumentName); childAlg->setProperty("RewriteSpectraMap", diff --git a/Framework/SINQ/src/InvertMDDim.cpp b/Framework/SINQ/src/InvertMDDim.cpp index cfb4e6cd467bd29c22b88bb1bce153f1c62ab5c8..92809998d50c3207aa285ec1c77a2e302c4a5381 100644 --- a/Framework/SINQ/src/InvertMDDim.cpp +++ b/Framework/SINQ/src/InvertMDDim.cpp @@ -39,7 +39,7 @@ void InvertMDDim::exec() { dimensions.push_back(boost::const_pointer_cast<IMDDimension>(dimi)); } - MDHistoWorkspace_sptr outWS(new MDHistoWorkspace(dimensions)); + auto outWS = boost::make_shared<MDHistoWorkspace>(dimensions); outWS->setTo(.0, .0, .0); int rank = static_cast<int>(inWS->getNumDims()); diff --git a/Framework/SINQ/src/LoadFlexiNexus.cpp b/Framework/SINQ/src/LoadFlexiNexus.cpp index d4b2070b948373f6f918ecc5ee44bd0169be9a85..3ebf97dfeaa3ea3ff568f61e88120c632a5724b4 100644 --- a/Framework/SINQ/src/LoadFlexiNexus.cpp +++ b/Framework/SINQ/src/LoadFlexiNexus.cpp @@ -207,7 +207,7 @@ void LoadFlexiNexus::loadMD(NeXus::File *fin) { dimensions.push_back(makeDimension(fin, k, static_cast<int>(inf.dims[k]))); } - MDHistoWorkspace_sptr ws(new MDHistoWorkspace(dimensions)); + auto ws = boost::make_shared<MDHistoWorkspace>(dimensions); signal_t *dd = ws->getSignalArray(); signal_t *ddE = ws->getErrorSquaredArray(); diff --git a/Framework/SINQ/src/PoldiFitPeaks1D.cpp b/Framework/SINQ/src/PoldiFitPeaks1D.cpp index 4099d7db2620e9cddb2082a122726c754e5ab4e9..0035175c9cd072f8fa456a5e2744095aff3e8edb 100644 --- a/Framework/SINQ/src/PoldiFitPeaks1D.cpp +++ b/Framework/SINQ/src/PoldiFitPeaks1D.cpp @@ -84,7 +84,7 @@ void PoldiFitPeaks1D::setPeakFunction(const std::string &peakFunction) { PoldiPeakCollection_sptr PoldiFitPeaks1D::getInitializedPeakCollection( const DataObjects::TableWorkspace_sptr &peakTable) const { - PoldiPeakCollection_sptr peakCollection(new PoldiPeakCollection(peakTable)); + auto peakCollection = boost::make_shared<PoldiPeakCollection>(peakTable); peakCollection->setProfileFunctionName(m_profileTemplate); return peakCollection; @@ -100,7 +100,7 @@ PoldiFitPeaks1D::getPeakProfile(const PoldiPeak_sptr &poldiPeak) const { IFunction_sptr clonedBackground = m_backgroundTemplate->clone(); - CompositeFunction_sptr totalProfile(new CompositeFunction); + auto totalProfile = boost::make_shared<CompositeFunction>(); totalProfile->initialize(); totalProfile->addFunction(clonedProfile); totalProfile->addFunction(clonedBackground); @@ -153,7 +153,7 @@ void PoldiFitPeaks1D::exec() { Workspace2D_sptr dataWorkspace = getProperty("InputWorkspace"); - WorkspaceGroup_sptr fitPlotGroup(new WorkspaceGroup); + auto fitPlotGroup = boost::make_shared<WorkspaceGroup>(); for (size_t i = 0; i < m_peaks->peakCount(); ++i) { PoldiPeak_sptr currentPeak = m_peaks->peak(i); diff --git a/Framework/SINQ/src/PoldiFitPeaks1D2.cpp b/Framework/SINQ/src/PoldiFitPeaks1D2.cpp index 421338f044b7b79449b08a563e8641e7e6f05e5a..ea733d6e460632837d94e92802248f90bfc3ed8b 100644 --- a/Framework/SINQ/src/PoldiFitPeaks1D2.cpp +++ b/Framework/SINQ/src/PoldiFitPeaks1D2.cpp @@ -182,7 +182,7 @@ void PoldiFitPeaks1D2::setPeakFunction(const std::string &peakFunction) { PoldiPeakCollection_sptr PoldiFitPeaks1D2::getInitializedPeakCollection( const DataObjects::TableWorkspace_sptr &peakTable) const { - PoldiPeakCollection_sptr peakCollection(new PoldiPeakCollection(peakTable)); + auto peakCollection = boost::make_shared<PoldiPeakCollection>(peakTable); peakCollection->setProfileFunctionName(m_profileTemplate); return peakCollection; @@ -227,7 +227,7 @@ std::vector<RefinedRange_sptr> PoldiFitPeaks1D2::getReducedRanges( API::IFunction_sptr PoldiFitPeaks1D2::getRangeProfile(const RefinedRange_sptr &range, int n) const { - CompositeFunction_sptr totalProfile(new CompositeFunction); + auto totalProfile = boost::make_shared<CompositeFunction>(); totalProfile->initialize(); std::vector<PoldiPeak_sptr> peaks = range->getPeaks(); diff --git a/Framework/SINQ/src/PoldiFitPeaks2D.cpp b/Framework/SINQ/src/PoldiFitPeaks2D.cpp index 3e3e77a1c7b98b3dae325012c87ba255b36e35ae..b663b4ab1cbc228d3cd307abf5ce90587e190e05 100644 --- a/Framework/SINQ/src/PoldiFitPeaks2D.cpp +++ b/Framework/SINQ/src/PoldiFitPeaks2D.cpp @@ -469,7 +469,7 @@ Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionFromPeakCollection( Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionIndividualPeaks( std::string profileFunctionName, const PoldiPeakCollection_sptr &peakCollection) const { - Poldi2DFunction_sptr mdFunction(new Poldi2DFunction); + auto mdFunction = boost::make_shared<Poldi2DFunction>(); for (size_t i = 0; i < peakCollection->peakCount(); ++i) { PoldiPeak_sptr peak = peakCollection->peak(i); @@ -522,7 +522,7 @@ Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionIndividualPeaks( Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionPawley( std::string profileFunctionName, const PoldiPeakCollection_sptr &peakCollection) { - Poldi2DFunction_sptr mdFunction(new Poldi2DFunction); + auto mdFunction = boost::make_shared<Poldi2DFunction>(); boost::shared_ptr<PoldiSpectrumPawleyFunction> poldiPawleyFunction = boost::dynamic_pointer_cast<PoldiSpectrumPawleyFunction>( @@ -979,7 +979,7 @@ IAlgorithm_sptr PoldiFitPeaks2D::calculateSpectrum( getNormalizedPeakCollections(peakCollections); // Create a Poldi2DFunction that collects all sub-functions - Poldi2DFunction_sptr mdFunction(new Poldi2DFunction); + auto mdFunction = boost::make_shared<Poldi2DFunction>(); // Add one Poldi2DFunction for each peak collection for (auto &normalizedPeakCollection : normalizedPeakCollections) { diff --git a/Framework/SINQ/src/ProjectMD.cpp b/Framework/SINQ/src/ProjectMD.cpp index a79c1cf0514c5123ca53be85c2833b6cc38e3491..f537b965e69973aab6a70cb4b4263c997f4d9a9b 100644 --- a/Framework/SINQ/src/ProjectMD.cpp +++ b/Framework/SINQ/src/ProjectMD.cpp @@ -70,7 +70,7 @@ void ProjectMD::exec() { } } - MDHistoWorkspace_sptr outWS(new MDHistoWorkspace(dimensions)); + auto outWS = boost::make_shared<MDHistoWorkspace>(dimensions); outWS->setTo(.0, .0, .0); memset(targetDim, 0, MAXDIM * sizeof(int)); diff --git a/Framework/SINQ/src/SINQHMListener.cpp b/Framework/SINQ/src/SINQHMListener.cpp index 9235c1354d06da72f54bab0d1ec05c7e84908f26..69c2fe886fbd100bccde2b0f213c6a380d9f4801 100644 --- a/Framework/SINQ/src/SINQHMListener.cpp +++ b/Framework/SINQ/src/SINQHMListener.cpp @@ -106,7 +106,7 @@ boost::shared_ptr<Workspace> SINQHMListener::extractData() { dimensions.push_back(MDHistoDimension_sptr(new MDHistoDimension( dimNames[i], dimNames[i], frame, .0, coord_t(dim[i]), dim[i]))); } - MDHistoWorkspace_sptr ws(new MDHistoWorkspace(dimensions)); + auto ws = boost::make_shared<MDHistoWorkspace>(dimensions); ws->setTo(.0, .0, .0); readHMData(ws); diff --git a/Framework/SINQ/src/SINQTranspose3D.cpp b/Framework/SINQ/src/SINQTranspose3D.cpp index dff9c09e1123e43fd519a34b4d6207ba1f726761..e48ec358a27981b3f69ee036d51a790517f12327 100644 --- a/Framework/SINQ/src/SINQTranspose3D.cpp +++ b/Framework/SINQ/src/SINQTranspose3D.cpp @@ -65,7 +65,7 @@ void SINQTranspose3D::doYXZ(IMDHistoWorkspace_sptr inWS) { dimensions.push_back(boost::const_pointer_cast<IMDDimension>(x)); dimensions.push_back(boost::const_pointer_cast<IMDDimension>(z)); - MDHistoWorkspace_sptr outWS(new MDHistoWorkspace(dimensions)); + auto outWS = boost::make_shared<MDHistoWorkspace>(dimensions); inVal = inWS->getSignalArray(); inErr = inWS->getErrorSquaredArray(); @@ -102,7 +102,7 @@ void SINQTranspose3D::doXZY(IMDHistoWorkspace_sptr inWS) { dimensions.push_back(boost::const_pointer_cast<IMDDimension>(z)); dimensions.push_back(boost::const_pointer_cast<IMDDimension>(y)); - MDHistoWorkspace_sptr outWS(new MDHistoWorkspace(dimensions)); + auto outWS = boost::make_shared<MDHistoWorkspace>(dimensions); inVal = inWS->getSignalArray(); inErr = inWS->getErrorSquaredArray(); @@ -141,7 +141,7 @@ void SINQTranspose3D::doTRICS(IMDHistoWorkspace_sptr inWS) { dimensions.push_back(boost::const_pointer_cast<IMDDimension>(z)); dimensions.push_back(boost::const_pointer_cast<IMDDimension>(y)); - MDHistoWorkspace_sptr outWS(new MDHistoWorkspace(dimensions)); + auto outWS = boost::make_shared<MDHistoWorkspace>(dimensions); outWS->setTo(.0, .0, .0); inVal = inWS->getSignalArray(); @@ -180,7 +180,7 @@ void SINQTranspose3D::doAMOR(IMDHistoWorkspace_sptr inWS) { dimensions.push_back(boost::const_pointer_cast<IMDDimension>(x)); dimensions.push_back(boost::const_pointer_cast<IMDDimension>(z)); - MDHistoWorkspace_sptr outWS(new MDHistoWorkspace(dimensions)); + auto outWS = boost::make_shared<MDHistoWorkspace>(dimensions); outWS->setTo(.0, .0, .0); xdim = static_cast<unsigned int>(x->getNBins()); diff --git a/Framework/SINQ/src/SliceMDHisto.cpp b/Framework/SINQ/src/SliceMDHisto.cpp index 67b7387525683765895a7899f0584b5d93b20cc0..61413131791fab58564e93146ec2fd5f5ede591e 100644 --- a/Framework/SINQ/src/SliceMDHisto.cpp +++ b/Framework/SINQ/src/SliceMDHisto.cpp @@ -78,7 +78,7 @@ void SliceMDHisto::exec() { arDim->getName(), arDim->getName(), arDim->getMDFrame(), arDim->getX(start[k]), arDim->getX(end[k]), end[k] - start[k]))); } - MDHistoWorkspace_sptr outWS(new MDHistoWorkspace(dimensions)); + auto outWS = boost::make_shared<MDHistoWorkspace>(dimensions); coord_t *sourceDim = reinterpret_cast<coord_t *>(malloc(m_rank * sizeof(coord_t)));