diff --git a/Framework/CurveFitting/src/Algorithms/CalculateChiSquared.cpp b/Framework/CurveFitting/src/Algorithms/CalculateChiSquared.cpp index 39b08f20066600bf5a48f14d68d41a405f4a3f5d..b7c150ec2b37c547ac9cb265bd0dbe64e6fc918b 100644 --- a/Framework/CurveFitting/src/Algorithms/CalculateChiSquared.cpp +++ b/Framework/CurveFitting/src/Algorithms/CalculateChiSquared.cpp @@ -322,7 +322,7 @@ void CalculateChiSquared::estimateErrors() { if (baseName.empty()) { baseName = "CalculateChiSquared"; } - declareProperty(new API::WorkspaceProperty<API::ITableWorkspace>( + declareProperty(make_unique<API::WorkspaceProperty<API::ITableWorkspace>>( "PDFs", "", Kernel::Direction::Output), "The name of the TableWorkspace in which to store the " "pdfs of fit parameters"); @@ -339,7 +339,7 @@ void CalculateChiSquared::estimateErrors() { auto quadraticErrColumn = errorsTable->addColumn("double", "Quadratic Error"); auto chiMinColumn = errorsTable->addColumn("double", "Chi2 Min"); errorsTable->setRowCount(nParams); - declareProperty(new API::WorkspaceProperty<API::ITableWorkspace>( + declareProperty(make_unique<API::WorkspaceProperty<API::ITableWorkspace>>( "Errors", "", Kernel::Direction::Output), "The name of the TableWorkspace in which to store the " "values and errors of fit parameters"); diff --git a/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp b/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp index 3ada01400c7b933ddbb3a739130417cbd34913a1..320990237c4f413d4e9c68bd1b5400be7906fd42 100644 --- a/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp +++ b/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp @@ -83,25 +83,26 @@ void CalculateGammaBackground::init() { auto wsValidator = boost::make_shared<CompositeValidator>(); wsValidator->add<WorkspaceUnitValidator>("TOF"); wsValidator->add<HistogramValidator>(false); // point data - declareProperty(new WorkspaceProperty<>("InputWorkspace", "", - Direction::Input, wsValidator), + declareProperty(make_unique<WorkspaceProperty<>>( + "InputWorkspace", "", Direction::Input, wsValidator), "An input workspace containing TOF data"); declareProperty( - new API::FunctionProperty("ComptonFunction"), + make_unique<API::FunctionProperty>("ComptonFunction"), "Function that is able to compute the mass spectrum for the input data" "This will usually be the output from the Fitting"); - declareProperty(new ArrayProperty<int>("WorkspaceIndexList"), + declareProperty(make_unique<ArrayProperty<int>>("WorkspaceIndexList"), "Indices of the spectra to include in the correction. If " "provided, the output only include these spectra\n" "(Default: all spectra from input)"); + declareProperty(make_unique<WorkspaceProperty<>>("BackgroundWorkspace", "", + Direction::Output), + "A new workspace containing the calculated background."); declareProperty( - new WorkspaceProperty<>("BackgroundWorkspace", "", Direction::Output), - "A new workspace containing the calculated background."); - declareProperty( - new WorkspaceProperty<>("CorrectedWorkspace", "", Direction::Output), + make_unique<WorkspaceProperty<>>("CorrectedWorkspace", "", + Direction::Output), "A new workspace containing the calculated background subtracted from " "the input."); } diff --git a/Framework/CurveFitting/src/Algorithms/CalculateMSVesuvio.cpp b/Framework/CurveFitting/src/Algorithms/CalculateMSVesuvio.cpp index 8e73b39faa0954e28937b2549f4417958c3648a0..9ecdeda7b3cb17366684b0d578b82f23ac765d60 100644 --- a/Framework/CurveFitting/src/Algorithms/CalculateMSVesuvio.cpp +++ b/Framework/CurveFitting/src/Algorithms/CalculateMSVesuvio.cpp @@ -77,8 +77,8 @@ void CalculateMSVesuvio::init() { auto inputWSValidator = boost::make_shared<CompositeValidator>(); inputWSValidator->add<WorkspaceUnitValidator>("TOF"); inputWSValidator->add<SampleShapeValidator>(); - declareProperty(new WorkspaceProperty<>("InputWorkspace", "", - Direction::Input, inputWSValidator), + declareProperty(make_unique<WorkspaceProperty<>>( + "InputWorkspace", "", Direction::Input, inputWSValidator), "Input workspace to be corrected, in units of TOF."); // -- Sample -- @@ -95,10 +95,11 @@ void CalculateMSVesuvio::init() { auto nonEmptyArray = boost::make_shared<ArrayLengthValidator<double>>(); nonEmptyArray->setLengthMin(3); - declareProperty(new ArrayProperty<double>("AtomicProperties", nonEmptyArray), - "Atomic properties of masses within the sample. " - "The expected format is 3 consecutive values per mass: " - "mass(amu), cross-section (barns) & s.d of Compton profile."); + declareProperty( + make_unique<ArrayProperty<double>>("AtomicProperties", nonEmptyArray), + "Atomic properties of masses within the sample. " + "The expected format is 3 consecutive values per mass: " + "mass(amu), cross-section (barns) & s.d of Compton profile."); setPropertyGroup("NoOfMasses", "Sample"); setPropertyGroup("SampleDensity", "Sample"); setPropertyGroup("AtomicProperties", "Sample"); @@ -122,11 +123,12 @@ void CalculateMSVesuvio::init() { setPropertyGroup("NumEventsPerRun", "Algorithm"); // Outputs + declareProperty(make_unique<WorkspaceProperty<>>("TotalScatteringWS", "", + Direction::Output), + "Workspace to store the calculated total scattering counts"); declareProperty( - new WorkspaceProperty<>("TotalScatteringWS", "", Direction::Output), - "Workspace to store the calculated total scattering counts"); - declareProperty( - new WorkspaceProperty<>("MultipleScatteringWS", "", Direction::Output), + make_unique<WorkspaceProperty<>>("MultipleScatteringWS", "", + Direction::Output), "Workspace to store the calculated multiple scattering counts summed for " "all orders"); } diff --git a/Framework/CurveFitting/src/Algorithms/ConvertToYSpace.cpp b/Framework/CurveFitting/src/Algorithms/ConvertToYSpace.cpp index 0c3c357a224b5469a1fbfc96559c0fcf7952c285..494a8d7870fa0423013f0471248809549966f3cd 100644 --- a/Framework/CurveFitting/src/Algorithms/ConvertToYSpace.cpp +++ b/Framework/CurveFitting/src/Algorithms/ConvertToYSpace.cpp @@ -168,8 +168,8 @@ void ConvertToYSpace::init() { wsValidator->add<HistogramValidator>(false); // point data wsValidator->add<InstrumentValidator>(); wsValidator->add<WorkspaceUnitValidator>("TOF"); - declareProperty(new WorkspaceProperty<>("InputWorkspace", "", - Direction::Input, wsValidator), + declareProperty(make_unique<WorkspaceProperty<>>( + "InputWorkspace", "", Direction::Input, wsValidator), "The input workspace in Time of Flight"); auto mustBePositive = boost::make_shared<BoundedValidator<double>>(); @@ -178,12 +178,13 @@ void ConvertToYSpace::init() { declareProperty("Mass", -1.0, mustBePositive, "The mass defining the recoil peak in AMU"); - declareProperty( - new WorkspaceProperty<>("OutputWorkspace", "", Direction::Output), - "The output workspace in y-Space"); + declareProperty(make_unique<WorkspaceProperty<>>("OutputWorkspace", "", + Direction::Output), + "The output workspace in y-Space"); - declareProperty(new WorkspaceProperty<>("QWorkspace", "", Direction::Output, - PropertyMode::Optional), + declareProperty(make_unique<WorkspaceProperty<>>("QWorkspace", "", + Direction::Output, + PropertyMode::Optional), "The output workspace in q-Space"); } diff --git a/Framework/CurveFitting/src/Algorithms/ConvolveWorkspaces.cpp b/Framework/CurveFitting/src/Algorithms/ConvolveWorkspaces.cpp index 86d25922ab6139b60af6e4517e700f09fc0df5ce..adf8a57d14e57a3d42baa511217ed8e53b68dc37 100644 --- a/Framework/CurveFitting/src/Algorithms/ConvolveWorkspaces.cpp +++ b/Framework/CurveFitting/src/Algorithms/ConvolveWorkspaces.cpp @@ -32,15 +32,15 @@ using namespace Geometry; using namespace Functions; void ConvolveWorkspaces::init() { - declareProperty( - new WorkspaceProperty<Workspace2D>("Workspace1", "", Direction::Input), - "The name of the first input workspace."); - declareProperty( - new WorkspaceProperty<Workspace2D>("Workspace2", "", Direction::Input), - "The name of the second input workspace."); - - declareProperty(new WorkspaceProperty<Workspace2D>("OutputWorkspace", "", - Direction::Output), + declareProperty(make_unique<WorkspaceProperty<Workspace2D>>("Workspace1", "", + Direction::Input), + "The name of the first input workspace."); + declareProperty(make_unique<WorkspaceProperty<Workspace2D>>("Workspace2", "", + Direction::Input), + "The name of the second input workspace."); + + declareProperty(make_unique<WorkspaceProperty<Workspace2D>>( + "OutputWorkspace", "", Direction::Output), "The name of the output workspace."); } diff --git a/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp b/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp index 539c44098eafcacc2c757540fae81e10340ae99a..e381ab6012443eef170edf934ed96b282f513dd4 100644 --- a/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp +++ b/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp @@ -110,12 +110,12 @@ void calculatePeakValues(IPeakFunction &peak, ITableWorkspace &results, /// Initialize void EstimatePeakErrors::init() { - declareProperty(new FunctionProperty("Function"), + declareProperty(make_unique<FunctionProperty>("Function"), "Fitting function containing peaks. Must have a covariance " "matrix attached."); declareProperty( - new API::WorkspaceProperty<API::ITableWorkspace>( + make_unique<API::WorkspaceProperty<API::ITableWorkspace>>( "OutputWorkspace", "", Kernel::Direction::Output), "The name of the TableWorkspace with the output values and errors."); } diff --git a/Framework/CurveFitting/src/Algorithms/EvaluateFunction.cpp b/Framework/CurveFitting/src/Algorithms/EvaluateFunction.cpp index 9e072bd88875299e3e259ac3f7b024717c91d27e..92dda1a5f9b5500b68fe025749d36d0b0b5b9b7d 100644 --- a/Framework/CurveFitting/src/Algorithms/EvaluateFunction.cpp +++ b/Framework/CurveFitting/src/Algorithms/EvaluateFunction.cpp @@ -26,8 +26,8 @@ const std::string EvaluateFunction::summary() const { //---------------------------------------------------------------------------------------------- /// Initialize the algorithm's properties. void EvaluateFunction::initConcrete() { - declareProperty(new WorkspaceProperty<API::Workspace>("OutputWorkspace", "", - Direction::Output), + declareProperty(make_unique<WorkspaceProperty<API::Workspace>>( + "OutputWorkspace", "", Direction::Output), "An output workspace."); } diff --git a/Framework/CurveFitting/src/Algorithms/Fit.cpp b/Framework/CurveFitting/src/Algorithms/Fit.cpp index 691c80925982e6ae5a54273bd4949e54a93a50e6..4349db099dd9deca2f4f7f4b10056013dbd62cc3 100644 --- a/Framework/CurveFitting/src/Algorithms/Fit.cpp +++ b/Framework/CurveFitting/src/Algorithms/Fit.cpp @@ -49,10 +49,10 @@ void Fit::initConcrete() { std::vector<std::string> minimizerOptions = API::FuncMinimizerFactory::Instance().getKeys(); + Kernel::IValidator_sptr minimizerValidator = + boost::make_shared<Kernel::StartsWithValidator>(minimizerOptions); - declareProperty("Minimizer", "Levenberg-Marquardt", - Kernel::IValidator_sptr( - new Kernel::StartsWithValidator(minimizerOptions)), + declareProperty("Minimizer", "Levenberg-Marquardt", minimizerValidator, "Minimizer to use for fitting. Minimizers available are " "\"Levenberg-Marquardt\", \"Simplex\", \"FABADA\", " "\"Conjugate gradient (Fletcher-Reeves imp.)\", \"Conjugate " @@ -69,10 +69,10 @@ void Fit::initConcrete() { costFuncOption = ""; } } + Kernel::IValidator_sptr costFuncValidator = + boost::make_shared<Kernel::ListValidator<std::string>>(costFuncOptions); declareProperty( - "CostFunction", "Least squares", - Kernel::IValidator_sptr( - new Kernel::ListValidator<std::string>(costFuncOptions)), + "CostFunction", "Least squares", costFuncValidator, "The cost function to be used for the fit, default is Least squares", Kernel::Direction::InOut); declareProperty( @@ -91,7 +91,8 @@ void Fit::initConcrete() { declareProperty("OutputCompositeMembers", false, "If true and CreateOutput is true then the value of each " "member of a Composite Function is also output."); - declareProperty(new Kernel::PropertyWithValue<bool>("ConvolveMembers", false), + declareProperty(Kernel::make_unique<Kernel::PropertyWithValue<bool>>( + "ConvolveMembers", false), "If true and OutputCompositeMembers is true members of any " "Convolution are output convolved\n" "with corresponding resolution"); @@ -111,8 +112,8 @@ void Fit::copyMinimizerOutput(const API::IFuncMinimizer &minimizer) { for (auto property : properties) { if ((*property).direction() == Kernel::Direction::Output && (*property).isValid() == "") { - Kernel::Property *clonedProperty = (*property).clone(); - declareProperty(clonedProperty); + auto clonedProperty = std::unique_ptr<Kernel::Property>((*property).clone()); + declareProperty(std::move(clonedProperty)); } } } @@ -249,7 +250,7 @@ void Fit::execConcrete() { baseName += "_"; declareProperty( - new API::WorkspaceProperty<API::ITableWorkspace>( + Kernel::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>( "OutputNormalisedCovarianceMatrix", "", Kernel::Direction::Output), "The name of the TableWorkspace in which to store the final covariance " "matrix"); @@ -303,10 +304,11 @@ void Fit::execConcrete() { // create output parameter table workspace to store final fit parameters // including error estimates if derivative of fitting function defined - declareProperty(new API::WorkspaceProperty<API::ITableWorkspace>( - "OutputParameters", "", Kernel::Direction::Output), - "The name of the TableWorkspace in which to store the " - "final fit parameters"); + declareProperty( + Kernel::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>( + "OutputParameters", "", Kernel::Direction::Output), + "The name of the TableWorkspace in which to store the " + "final fit parameters"); setPropertyValue("OutputParameters", baseName + "Parameters"); diff --git a/Framework/CurveFitting/src/Algorithms/Fit1D.cpp b/Framework/CurveFitting/src/Algorithms/Fit1D.cpp index 8b67a7749122a36829cfbf3bb3c927b0657aa7fd..770ea5f09788201776fd309b6548474ff2af3846 100644 --- a/Framework/CurveFitting/src/Algorithms/Fit1D.cpp +++ b/Framework/CurveFitting/src/Algorithms/Fit1D.cpp @@ -277,8 +277,8 @@ void Fit1D::modifyFinalFittedParameters(std::vector<double> &fittedParameter) { /** Initialisation method */ void Fit1D::init() { - declareProperty(new WorkspaceProperty<MatrixWorkspace>("InputWorkspace", "", - Direction::Input), + declareProperty(make_unique<WorkspaceProperty<MatrixWorkspace>>( + "InputWorkspace", "", Direction::Input), "Name of the input Workspace"); auto mustBePositive = boost::make_shared<BoundedValidator<int>>(); @@ -628,7 +628,7 @@ void Fit1D::exec() { standardDeviations.push_back(sdExtended[i]); declareProperty( - new WorkspaceProperty<API::ITableWorkspace>( + make_unique<WorkspaceProperty<API::ITableWorkspace>>( "OutputNormalisedCovarianceMatrix", "", Direction::Output), "The name of the TableWorkspace in which to store the final " "covariance matrix"); @@ -666,13 +666,13 @@ void Fit1D::exec() { setProperty("OutputNormalisedCovarianceMatrix", m_covariance); } - declareProperty(new WorkspaceProperty<API::ITableWorkspace>( + declareProperty(make_unique<WorkspaceProperty<API::ITableWorkspace>>( "OutputParameters", "", Direction::Output), "The name of the TableWorkspace in which to store the " "final fit parameters"); declareProperty( - new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "", - Direction::Output), + make_unique<WorkspaceProperty<MatrixWorkspace>>("OutputWorkspace", "", + Direction::Output), "Name of the output Workspace holding resulting simlated spectrum"); setPropertyValue("OutputParameters", output + "_Parameters"); diff --git a/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp b/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp index 3cd55fd9ff7e1c9c6ce8de45f85fa787c798e4ed..b6e7a99e935832d2575600bd53d969981d26b9b4 100644 --- a/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp +++ b/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp @@ -84,47 +84,48 @@ FitPowderDiffPeaks::~FitPowderDiffPeaks() {} */ void FitPowderDiffPeaks::init() { // Input data workspace - declareProperty(new WorkspaceProperty<MatrixWorkspace>( + declareProperty(Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( "InputWorkspace", "Anonymous", Direction::Input), "Input workspace for data (diffraction pattern). "); // Output workspace - declareProperty(new WorkspaceProperty<Workspace2D>( + declareProperty(Kernel::make_unique<WorkspaceProperty<Workspace2D>>( "OutputWorkspace", "Anonymous2", Direction::Output), "Output Workspace2D for the fitted peaks. "); // Input/output peaks table workspace declareProperty( - new WorkspaceProperty<TableWorkspace>("BraggPeakParameterWorkspace", - "AnonymousPeak", Direction::Input), + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( + "BraggPeakParameterWorkspace", "AnonymousPeak", Direction::Input), "TableWorkspace containg all peaks' parameters."); // Input and output instrument parameters table workspace - declareProperty(new WorkspaceProperty<TableWorkspace>( + declareProperty(Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "InstrumentParameterWorkspace", "AnonymousInstrument", Direction::InOut), "TableWorkspace containg instrument's parameters."); // Workspace to output fitted peak parameters declareProperty( - new WorkspaceProperty<TableWorkspace>("OutputBraggPeakParameterWorkspace", - "AnonymousOut2", Direction::Output), + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( + "OutputBraggPeakParameterWorkspace", "AnonymousOut2", + Direction::Output), "Output TableWorkspace containing the fitted peak parameters for each " "peak."); // Data workspace containing fitted peak parameters - declareProperty(new WorkspaceProperty<Workspace2D>( + declareProperty(Kernel::make_unique<WorkspaceProperty<Workspace2D>>( "OutputBraggPeakParameterDataWorkspace", "ParameterData", Direction::Output), "Output Workspace2D containing fitted peak parameters for " "further refinement."); // Zscore table workspace - declareProperty(new WorkspaceProperty<TableWorkspace>("OutputZscoreWorkspace", - "ZscoreTable", - Direction::Output), - "Output TableWorkspace containing the Zscore of the fitted " - "peak parameters. "); + declareProperty( + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( + "OutputZscoreWorkspace", "ZscoreTable", Direction::Output), + "Output TableWorkspace containing the Zscore of the fitted " + "peak parameters. "); // Workspace index of the declareProperty("WorkspaceIndex", 0, @@ -171,9 +172,10 @@ void FitPowderDiffPeaks::init() { "are correlated by an analytical function"); // Option for peak's HKL for minimum d-spacing - auto arrayprop = new ArrayProperty<int>("MinimumHKL", ""); - declareProperty(arrayprop, "Miller index of the left most peak (peak with " - "minimum d-spacing) to be fitted. "); + auto arrayprop = Kernel::make_unique<ArrayProperty<int>>("MinimumHKL", ""); + declareProperty(std::move(arrayprop), + "Miller index of the left most peak (peak with " + "minimum d-spacing) to be fitted. "); // Number of the peaks to fit left to peak with minimum HKL declareProperty("NumberPeaksToFitBelowLowLimit", 0, @@ -181,8 +183,9 @@ void FitPowderDiffPeaks::init() { "less than specified minimum. "); // Right most peak property - auto righthklprop = new ArrayProperty<int>("RightMostPeakHKL", ""); - declareProperty(righthklprop, + auto righthklprop = + Kernel::make_unique<ArrayProperty<int>>("RightMostPeakHKL", ""); + declareProperty(std::move(righthklprop), "Miller index of the right most peak. " "It is only required and used in RobustFit mode."); diff --git a/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp b/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp index 5306e2c4e118ad5ef4c32bdfb281954a3ca685fd..c392da23ea3abb04aa47cb403609362fd5895cab 100644 --- a/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp +++ b/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp @@ -83,42 +83,44 @@ void LeBailFit::init() { // Input Data Workspace this->declareProperty( - new WorkspaceProperty<MatrixWorkspace>("InputWorkspace", "", - Direction::Input), + Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( + "InputWorkspace", "", Direction::Input), "Input workspace containing the data to fit by LeBail algorithm."); // Output Result Data/Model Workspace - this->declareProperty(new WorkspaceProperty<Workspace2D>( + this->declareProperty(Kernel::make_unique<WorkspaceProperty<Workspace2D>>( "OutputWorkspace", "", Direction::Output), "Output workspace containing calculated pattern or " "calculated background. "); // Instrument profile Parameters - this->declareProperty(new WorkspaceProperty<TableWorkspace>( + this->declareProperty(Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "InputParameterWorkspace", "", Direction::Input), "Input table workspace containing the parameters " "required by LeBail fit. "); // Output instrument profile parameters - auto tablewsprop1 = new WorkspaceProperty<TableWorkspace>( + auto tablewsprop1 = Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "OutputParameterWorkspace", "", Direction::Output, API::PropertyMode::Optional); - this->declareProperty(tablewsprop1, "Input table workspace containing the " - "parameters required by LeBail fit. "); + this->declareProperty(std::move(tablewsprop1), + "Input table workspace containing the " + "parameters required by LeBail fit. "); // Single peak: Reflection (HKL) Workspace, PeaksWorkspace this->declareProperty( - new WorkspaceProperty<TableWorkspace>("InputHKLWorkspace", "", - Direction::Input), + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( + "InputHKLWorkspace", "", Direction::Input), "Input table workspace containing the list of reflections (HKL). "); // Bragg peaks profile parameter output table workspace - auto tablewsprop2 = new WorkspaceProperty<TableWorkspace>( + auto tablewsprop2 = Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "OutputPeaksWorkspace", "", Direction::Output, API::PropertyMode::Optional); - this->declareProperty(tablewsprop2, "Optional output table workspace " - "containing all peaks' peak " - "parameters. "); + this->declareProperty(std::move(tablewsprop2), + "Optional output table workspace " + "containing all peaks' peak " + "parameters. "); // WorkspaceIndex this->declareProperty("WorkspaceIndex", 0, @@ -126,7 +128,7 @@ void LeBailFit::init() { // Interested region this->declareProperty( - new Kernel::ArrayProperty<double>("FitRegion"), + Kernel::make_unique<Kernel::ArrayProperty<double>>("FitRegion"), "Region of data (TOF) for LeBail fit. Default is whole range. "); // Functionality: Fit/Calculation/Background @@ -154,16 +156,17 @@ void LeBailFit::init() { // Input background parameters (array) this->declareProperty( - new Kernel::ArrayProperty<double>("BackgroundParameters"), + Kernel::make_unique<Kernel::ArrayProperty<double>>( + "BackgroundParameters"), "Optional: enter a comma-separated list of background order parameters " "from order 0. "); // Input background parameters (tableworkspace) - auto tablewsprop3 = new WorkspaceProperty<TableWorkspace>( + auto tablewsprop3 = Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "BackgroundParametersWorkspace", "", Direction::InOut, API::PropertyMode::Optional); this->declareProperty( - tablewsprop3, + std::move(tablewsprop3), "Optional table workspace containing the fit result for background."); // Peak Radius @@ -230,10 +233,11 @@ void LeBailFit::init() { //----------------- Parameters for Monte Carlo Simulated Annealing //-------------------------- - auto mcwsprop = new WorkspaceProperty<TableWorkspace>( + auto mcwsprop = Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "MCSetupWorkspace", "", Direction::Input, PropertyMode::Optional); - declareProperty(mcwsprop, "Name of table workspace containing parameters' " - "setup for Monte Carlo simualted annearling. "); + declareProperty(std::move(mcwsprop), + "Name of table workspace containing parameters' " + "setup for Monte Carlo simualted annearling. "); setPropertySettings( "MCSetupWorkspace", new VisibleWhenProperty("Function", IS_EQUAL_TO, "MonteCarlo")); diff --git a/Framework/CurveFitting/src/Algorithms/NormaliseByPeakArea.cpp b/Framework/CurveFitting/src/Algorithms/NormaliseByPeakArea.cpp index 9d5a46caaafafa084e7e80c85618afd306aa29aa..8d2e6d9d5351b62c5b6362593a258ba47b099621 100644 --- a/Framework/CurveFitting/src/Algorithms/NormaliseByPeakArea.cpp +++ b/Framework/CurveFitting/src/Algorithms/NormaliseByPeakArea.cpp @@ -63,8 +63,8 @@ void NormaliseByPeakArea::init() { wsValidator->add<HistogramValidator>(false); // point data wsValidator->add<InstrumentValidator>(); wsValidator->add<WorkspaceUnitValidator>("TOF"); - declareProperty(new WorkspaceProperty<>("InputWorkspace", "", - Direction::Input, wsValidator), + declareProperty(make_unique<WorkspaceProperty<>>( + "InputWorkspace", "", Direction::Input, wsValidator), "An input workspace."); auto mustBePositive = boost::make_shared<BoundedValidator<double>>(); @@ -77,18 +77,20 @@ void NormaliseByPeakArea::init() { "If true all spectra on the Y-space, fitted & symmetrised workspaces " "are summed in quadrature to produce the final result"); + declareProperty(make_unique<WorkspaceProperty<>>("OutputWorkspace", "", + Direction::Output), + "Input workspace normalised by the fitted peak area"); + declareProperty(make_unique<WorkspaceProperty<>>("YSpaceDataWorkspace", "", + Direction::Output), + "Input workspace converted to units of Y-space"); declareProperty( - new WorkspaceProperty<>("OutputWorkspace", "", Direction::Output), - "Input workspace normalised by the fitted peak area"); - declareProperty( - new WorkspaceProperty<>("YSpaceDataWorkspace", "", Direction::Output), - "Input workspace converted to units of Y-space"); - declareProperty( - new WorkspaceProperty<>("FittedWorkspace", "", Direction::Output), + make_unique<WorkspaceProperty<>>("FittedWorkspace", "", + Direction::Output), "Output from fit of the single mass peakin y-space. The output units are " "in momentum (A^-1)"); declareProperty( - new WorkspaceProperty<>("SymmetrisedWorkspace", "", Direction::Output), + make_unique<WorkspaceProperty<>>("SymmetrisedWorkspace", "", + Direction::Output), "The input data symmetrised about Y=0. The output units are in momentum " "(A^-1)"); } diff --git a/Framework/CurveFitting/src/Algorithms/PawleyFit.cpp b/Framework/CurveFitting/src/Algorithms/PawleyFit.cpp index 96c727bca7bbbf0cf919823fccb5a81ed2920c44..892a4510f0c3b04c3f5caf5eaa3e691dccea00e3 100644 --- a/Framework/CurveFitting/src/Algorithms/PawleyFit.cpp +++ b/Framework/CurveFitting/src/Algorithms/PawleyFit.cpp @@ -192,8 +192,8 @@ IFunction_sptr PawleyFit::getCompositeFunction( /// Initialization of properties. void PawleyFit::init() { - declareProperty(new WorkspaceProperty<MatrixWorkspace>("InputWorkspace", "", - Direction::Input), + declareProperty(make_unique<WorkspaceProperty<MatrixWorkspace>>( + "InputWorkspace", "", Direction::Input), "Input workspace that contains the spectrum on which to " "perform the Pawley fit."); @@ -219,7 +219,8 @@ void PawleyFit::init() { "alpha, beta, gamma'."); declareProperty( - new WorkspaceProperty<ITableWorkspace>("PeakTable", "", Direction::Input), + make_unique<WorkspaceProperty<ITableWorkspace>>("PeakTable", "", + Direction::Input), "Table with peak information. Can be used instead of " "supplying a list of indices for better starting parameters."); @@ -245,19 +246,19 @@ void PawleyFit::init() { "the function is only evaluated " "and output is generated."); - declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "", - Direction::Output), + declareProperty(make_unique<WorkspaceProperty<MatrixWorkspace>>( + "OutputWorkspace", "", Direction::Output), "Workspace that contains measured spectrum, calculated " "spectrum and difference curve."); declareProperty( - new WorkspaceProperty<ITableWorkspace>("RefinedCellTable", "", - Direction::Output), + make_unique<WorkspaceProperty<ITableWorkspace>>("RefinedCellTable", "", + Direction::Output), "TableWorkspace with refined lattice parameters, including errors."); declareProperty( - new WorkspaceProperty<ITableWorkspace>("RefinedPeakParameterTable", "", - Direction::Output), + make_unique<WorkspaceProperty<ITableWorkspace>>( + "RefinedPeakParameterTable", "", Direction::Output), "TableWorkspace with refined peak parameters, including errors."); declareProperty("ReducedChiSquare", 0.0, "Outputs the reduced chi square " diff --git a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp index d4d4c0e08cc23a36cda13ff6fb0c0e014ff839aa..f61b738021b7e2c257e01fb85d2a7ed6defbcf6b 100644 --- a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp +++ b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp @@ -67,8 +67,8 @@ void PlotPeakByLogValue::init() { "However, if spectra lists (or workspace-indices/values lists) are " "specified in the Input parameter string, \n" "or the Spectrum parameter integer, these take precedence."); - declareProperty(new WorkspaceProperty<ITableWorkspace>("OutputWorkspace", "", - Direction::Output), + declareProperty(make_unique<WorkspaceProperty<ITableWorkspace>>( + "OutputWorkspace", "", Direction::Output), "The output TableWorkspace"); declareProperty("Function", "", boost::make_shared<MandatoryValidator<std::string>>(), @@ -125,10 +125,11 @@ void PlotPeakByLogValue::init() { "If true and CreateOutput is true then the value of each " "member of a Composite Function is also output."); - declareProperty(new Kernel::PropertyWithValue<bool>("ConvolveMembers", false), - "If true and OutputCompositeMembers is true members of any " - "Convolution are output convolved\n" - "with corresponding resolution"); + declareProperty( + make_unique<Kernel::PropertyWithValue<bool>>("ConvolveMembers", false), + "If true and OutputCompositeMembers is true members of any " + "Convolution are output convolved\n" + "with corresponding resolution"); } /** diff --git a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp index a7dcb9ae7fa33decc4f78e082adfaf8fc2313d45..ad2f8841bb17097a8b53daa0f010d444c5d41b56 100644 --- a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp +++ b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp @@ -64,30 +64,32 @@ RefinePowderInstrumentParameters::~RefinePowderInstrumentParameters() {} void RefinePowderInstrumentParameters::init() { // Input/output peaks table workspace declareProperty( - new API::WorkspaceProperty<DataObjects::TableWorkspace>( + Kernel::make_unique<API::WorkspaceProperty<DataObjects::TableWorkspace>>( "BraggPeakParameterWorkspace", "Anonymous", Direction::Input), "TableWorkspace containg all peaks' parameters."); // Input and output instrument parameters table workspace - declareProperty(new API::WorkspaceProperty<DataObjects::TableWorkspace>( - "InstrumentParameterWorkspace", "AnonymousInstrument", - Direction::InOut), - "TableWorkspace containg instrument's parameters."); + declareProperty( + Kernel::make_unique<API::WorkspaceProperty<DataObjects::TableWorkspace>>( + "InstrumentParameterWorkspace", "AnonymousInstrument", + Direction::InOut), + "TableWorkspace containg instrument's parameters."); // Output workspace - declareProperty(new API::WorkspaceProperty<DataObjects::Workspace2D>( - "OutputWorkspace", "AnonymousOut", Direction::Output), - "Output Workspace2D for the d-TOF curves. "); + declareProperty( + Kernel::make_unique<API::WorkspaceProperty<DataObjects::Workspace2D>>( + "OutputWorkspace", "AnonymousOut", Direction::Output), + "Output Workspace2D for the d-TOF curves. "); // Workspace to output fitted peak parameters declareProperty( - new WorkspaceProperty<TableWorkspace>( + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "OutputInstrumentParameterWorkspace", "AnonymousOut2", Direction::Output), "Output TableWorkspace for the fitted peak parameters for each peak."); // Workspace to output N best MC parameters - declareProperty(new WorkspaceProperty<TableWorkspace>( + declareProperty(Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "OutputBestResultsWorkspace", "", Direction::Output, PropertyMode::Optional), "Output TableWorkspace for the N best MC fitting results. "); @@ -107,7 +109,8 @@ void RefinePowderInstrumentParameters::init() { "Number of Monte Carlo random walk steps. "); // Parameters to fit - declareProperty(new Kernel::ArrayProperty<std::string>("ParametersToFit"), + declareProperty(Kernel::make_unique<Kernel::ArrayProperty<std::string>>( + "ParametersToFit"), "Names of the parameters to fit. "); // Mininum allowed peak's sigma (avoid wrong fitting peak with very narrow diff --git a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp index 548cfe7614b4299d440e12975d72777fb9dff017..168e652b160248b3361ffb7b83027447453ab521 100644 --- a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp +++ b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp @@ -39,8 +39,8 @@ RefinePowderInstrumentParameters3::~RefinePowderInstrumentParameters3() {} void RefinePowderInstrumentParameters3::init() { // Peak position workspace declareProperty( - new WorkspaceProperty<Workspace2D>("InputPeakPositionWorkspace", - "Anonymous", Direction::Input), + Kernel::make_unique<WorkspaceProperty<Workspace2D>>( + "InputPeakPositionWorkspace", "Anonymous", Direction::Input), "Data workspace containing workspace positions in TOF agains dSpacing."); // Workspace Index @@ -50,20 +50,20 @@ void RefinePowderInstrumentParameters3::init() { // Output workspace declareProperty( - new WorkspaceProperty<Workspace2D>("OutputPeakPositionWorkspace", - "Anonymous2", Direction::Output), + Kernel::make_unique<WorkspaceProperty<Workspace2D>>( + "OutputPeakPositionWorkspace", "Anonymous2", Direction::Output), "Output data workspace containing refined workspace positions in TOF " "agains dSpacing."); // Input Table workspace containing instrument profile parameters declareProperty( - new WorkspaceProperty<TableWorkspace>("InputInstrumentParameterWorkspace", - "Anonymous3", Direction::Input), + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( + "InputInstrumentParameterWorkspace", "Anonymous3", Direction::Input), "INput tableWorkspace containg instrument's parameters."); // Output table workspace containing the refined parameters declareProperty( - new WorkspaceProperty<TableWorkspace>( + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "OutputInstrumentParameterWorkspace", "Anonymous4", Direction::Output), "Output tableworkspace containing instrument's fitted parameters. "); diff --git a/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp b/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp index ddc571743ca836622a43c7254641c695c811351c..50dd6d71033dd3f431e4cb0b8aa64248164c6004 100644 --- a/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp +++ b/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp @@ -22,10 +22,10 @@ using namespace API; /// Initialisation method void SplineBackground::init() { - declareProperty(new WorkspaceProperty<API::MatrixWorkspace>( + declareProperty(make_unique<WorkspaceProperty<API::MatrixWorkspace>>( "InputWorkspace", "", Direction::Input), "The name of the input workspace."); - declareProperty(new WorkspaceProperty<API::MatrixWorkspace>( + declareProperty(make_unique<WorkspaceProperty<API::MatrixWorkspace>>( "OutputWorkspace", "", Direction::Output), "The name to use for the output workspace."); auto mustBePositive = boost::make_shared<BoundedValidator<int>>(); diff --git a/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp b/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp index 30c11bc1bb2f9b0c1efba747aeab8c99776fda7c..edfce63baaac45c2efa00805acdab92bb537c989 100644 --- a/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp +++ b/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp @@ -46,21 +46,23 @@ const std::string SplineInterpolation::category() const { /** Initialize the algorithm's properties. */ void SplineInterpolation::init() { - declareProperty( - new WorkspaceProperty<>("WorkspaceToMatch", "", Direction::Input), - "The workspace which defines the points of the spline."); + declareProperty(make_unique<WorkspaceProperty<>>("WorkspaceToMatch", "", + Direction::Input), + "The workspace which defines the points of the spline."); declareProperty( - new WorkspaceProperty<>("WorkspaceToInterpolate", "", Direction::Input), + make_unique<WorkspaceProperty<>>("WorkspaceToInterpolate", "", + Direction::Input), "The workspace on which to perform the interpolation algorithm."); declareProperty( - new WorkspaceProperty<>("OutputWorkspace", "", Direction::Output), + make_unique<WorkspaceProperty<>>("OutputWorkspace", "", + Direction::Output), "The workspace containing the calculated points and derivatives"); - declareProperty(new WorkspaceProperty<WorkspaceGroup>("OutputWorkspaceDeriv", - "", Direction::Output, - PropertyMode::Optional), + declareProperty(make_unique<WorkspaceProperty<WorkspaceGroup>>( + "OutputWorkspaceDeriv", "", Direction::Output, + PropertyMode::Optional), "The workspace containing the calculated derivatives"); auto validator = boost::make_shared<BoundedValidator<int>>(0, 2); diff --git a/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp b/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp index 9cc5d65aa7a0b3cd1810bed4218231eb5931fe52..d0261dbbd25e7c029c6511a23774498208af0118 100644 --- a/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp +++ b/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp @@ -48,17 +48,17 @@ const std::string SplineSmoothing::category() const { /** Initialize the algorithm's properties. */ void SplineSmoothing::init() { - declareProperty(new WorkspaceProperty<MatrixWorkspace>("InputWorkspace", "", - Direction::Input), + declareProperty(make_unique<WorkspaceProperty<MatrixWorkspace>>( + "InputWorkspace", "", Direction::Input), "The workspace on which to perform the smoothing algorithm."); - declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "", - Direction::Output), + declareProperty(make_unique<WorkspaceProperty<MatrixWorkspace>>( + "OutputWorkspace", "", Direction::Output), "The workspace containing the calculated points"); - declareProperty(new WorkspaceProperty<WorkspaceGroup>("OutputWorkspaceDeriv", - "", Direction::Output, - PropertyMode::Optional), + declareProperty(make_unique<WorkspaceProperty<WorkspaceGroup>>( + "OutputWorkspaceDeriv", "", Direction::Output, + PropertyMode::Optional), "The workspace containing the calculated derivatives"); auto validator = boost::make_shared<BoundedValidator<int>>(); diff --git a/Framework/CurveFitting/src/FuncMinimizers/FABADAMinimizer.cpp b/Framework/CurveFitting/src/FuncMinimizers/FABADAMinimizer.cpp index 8dfb56ddfe79925b570b040a2095bcabffc1bb6d..b050eeaad58af469b59039909b592e956de4a3eb 100644 --- a/Framework/CurveFitting/src/FuncMinimizers/FABADAMinimizer.cpp +++ b/Framework/CurveFitting/src/FuncMinimizers/FABADAMinimizer.cpp @@ -65,22 +65,24 @@ FABADAMinimizer::FABADAMinimizer() "Variance in Cost Function for considering convergence reached."); declareProperty("JumpAcceptanceRate", 0.6666666, "Desired jumping acceptance rate"); + declareProperty(Kernel::make_unique<API::WorkspaceProperty<>>( + "PDF", "PDF", Kernel::Direction::Output), + "The name to give the output workspace"); + declareProperty(Kernel::make_unique<API::WorkspaceProperty<>>( + "Chains", "", Kernel::Direction::Output), + "The name to give the output workspace"); + declareProperty(Kernel::make_unique<API::WorkspaceProperty<>>( + "ConvergedChain", "", Kernel::Direction::Output, + API::PropertyMode::Optional), + "The name to give the output workspace"); declareProperty( - new API::WorkspaceProperty<>("PDF", "PDF", Kernel::Direction::Output), + Kernel::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>( + "CostFunctionTable", "", Kernel::Direction::Output), "The name to give the output workspace"); declareProperty( - new API::WorkspaceProperty<>("Chains", "", Kernel::Direction::Output), + Kernel::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>( + "Parameters", "", Kernel::Direction::Output), "The name to give the output workspace"); - declareProperty(new API::WorkspaceProperty<>("ConvergedChain", "", - Kernel::Direction::Output, - API::PropertyMode::Optional), - "The name to give the output workspace"); - declareProperty(new API::WorkspaceProperty<API::ITableWorkspace>( - "CostFunctionTable", "", Kernel::Direction::Output), - "The name to give the output workspace"); - declareProperty(new API::WorkspaceProperty<API::ITableWorkspace>( - "Parameters", "", Kernel::Direction::Output), - "The name to give the output workspace"); } //---------------------------------------------------------------------------------------------- diff --git a/Framework/CurveFitting/src/Functions/ProcessBackground.cpp b/Framework/CurveFitting/src/Functions/ProcessBackground.cpp index 9f81f5357b1b5fdc9b8b9ce47b1f0e4470b5c97f..8ac8bc1034c409fc2cdc57026d3514c7f5e89805 100644 --- a/Framework/CurveFitting/src/Functions/ProcessBackground.cpp +++ b/Framework/CurveFitting/src/Functions/ProcessBackground.cpp @@ -55,8 +55,8 @@ ProcessBackground::~ProcessBackground() {} void ProcessBackground::init() { // Input and output Workspace declareProperty( - new WorkspaceProperty<Workspace2D>("InputWorkspace", "Anonymous", - Direction::Input), + Kernel::make_unique<WorkspaceProperty<Workspace2D>>( + "InputWorkspace", "Anonymous", Direction::Input), "Name of the output workspace containing the processed background."); // Workspace index @@ -64,8 +64,8 @@ void ProcessBackground::init() { "Workspace index for the input workspaces."); // Output workspace - declareProperty(new WorkspaceProperty<Workspace2D>("OutputWorkspace", "", - Direction::Output), + declareProperty(Kernel::make_unique<WorkspaceProperty<Workspace2D>>( + "OutputWorkspace", "", Direction::Output), "Output workspace containing processed background"); // Function Options @@ -82,10 +82,11 @@ void ProcessBackground::init() { declareProperty("UpperBound", Mantid::EMPTY_DBL(), "Upper boundary of the data to have background processed."); - auto refwsprop = new WorkspaceProperty<Workspace2D>( + auto refwsprop = Kernel::make_unique<WorkspaceProperty<Workspace2D>>( "ReferenceWorkspace", "", Direction::Input, PropertyMode::Optional); - declareProperty(refwsprop, "Name of the workspace containing the data " - "required by function AddRegion."); + declareProperty(std::move(refwsprop), + "Name of the workspace containing the data " + "required by function AddRegion."); setPropertySettings( "ReferenceWorkspace", new VisibleWhenProperty("Options", IS_EQUAL_TO, "AddRegion")); @@ -122,10 +123,12 @@ void ProcessBackground::init() { "FitGivenDataPoints")); // User input background points for "SelectBackground" - auto arrayproperty = new Kernel::ArrayProperty<double>("BackgroundPoints"); - declareProperty(arrayproperty, "Vector of doubles, each of which is the " - "X-axis value of the background point " - "selected by user."); + auto arrayproperty = + Kernel::make_unique<Kernel::ArrayProperty<double>>("BackgroundPoints"); + declareProperty(std::move(arrayproperty), + "Vector of doubles, each of which is the " + "X-axis value of the background point " + "selected by user."); setPropertySettings("BackgroundPoints", new VisibleWhenProperty("Options", IS_EQUAL_TO, "SelectBackgroundPoints")); @@ -133,7 +136,7 @@ void ProcessBackground::init() { new VisibleWhenProperty("SelectionMode", IS_EQUAL_TO, "FitGivenDataPoints")); - declareProperty(new WorkspaceProperty<TableWorkspace>( + declareProperty(Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "BackgroundTableWorkspace", "", Direction::Input, PropertyMode::Optional), "Name of the table workspace containing background " @@ -173,7 +176,7 @@ void ProcessBackground::init() { "SelectBackgroundPoints")); // Optional output workspace - declareProperty(new WorkspaceProperty<Workspace2D>( + declareProperty(Kernel::make_unique<WorkspaceProperty<Workspace2D>>( "UserBackgroundWorkspace", "_dummy01", Direction::Output), "Output workspace containing fitted background from points " "specified by users."); @@ -183,7 +186,7 @@ void ProcessBackground::init() { // Optional output workspace declareProperty( - new WorkspaceProperty<TableWorkspace>( + Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "OutputBackgroundParameterWorkspace", "_dummy02", Direction::Output), "Output parameter table workspace containing the background fitting " "result. "); @@ -210,7 +213,7 @@ void ProcessBackground::init() { "SelectBackgroundPoints")); // Peak table workspac for "RemovePeaks" - declareProperty(new WorkspaceProperty<TableWorkspace>( + declareProperty(Kernel::make_unique<WorkspaceProperty<TableWorkspace>>( "BraggPeakTableWorkspace", "", Direction::Input, PropertyMode::Optional), "Name of table workspace containing peaks' parameters. "); diff --git a/Framework/CurveFitting/src/IFittingAlgorithm.cpp b/Framework/CurveFitting/src/IFittingAlgorithm.cpp index 54bf9b1397de76328c210dee18f54d123b4585ec..e530562ffe4ce479b3b828f0a01cd65d814acd34 100644 --- a/Framework/CurveFitting/src/IFittingAlgorithm.cpp +++ b/Framework/CurveFitting/src/IFittingAlgorithm.cpp @@ -77,10 +77,10 @@ const std::string IFittingAlgorithm::category() const { return "Optimization"; } */ void IFittingAlgorithm::init() { declareProperty( - new API::FunctionProperty("Function"), + make_unique<API::FunctionProperty>("Function"), "Parameters defining the fitting function and its initial values"); - declareProperty(new API::WorkspaceProperty<API::Workspace>( + declareProperty(make_unique<API::WorkspaceProperty<API::Workspace>>( "InputWorkspace", "", Kernel::Direction::Input), "Name of the input Workspace"); declareProperty("IgnoreInvalidData", false, @@ -158,7 +158,7 @@ void IFittingAlgorithm::setFunction() { m_workspacePropertyNames[i] = workspacePropertyName; if (!existsProperty(workspacePropertyName)) { declareProperty( - new API::WorkspaceProperty<API::Workspace>( + Kernel::make_unique<API::WorkspaceProperty<API::Workspace>>( workspacePropertyName, "", Kernel::Direction::Input), "Name of the input Workspace"); }