Mantid
Loading...
Searching...
No Matches
Fit.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
13
14namespace Mantid {
15
16namespace API {
17class FunctionDomain;
18class FunctionValues;
19class Workspace;
20class IFuncMinimizer;
21} // namespace API
22
23namespace CurveFitting {
24namespace Algorithms {
78class MANTID_CURVEFITTING_DLL Fit : public IFittingAlgorithm {
79public:
81 Fit();
83 const std::string name() const override { return "Fit"; }
85 const std::string summary() const override { return "Fits a function to data in a Workspace"; }
87 int version() const override { return (1); }
88 const std::vector<std::string> seeAlso() const override {
89 return {"FitGaussian", "UserFunction1D", "PlotPeakByLogValue", "SplineBackground", "EvaluateFunction"};
90 }
91
92private:
93 void initConcrete() override;
94 void execConcrete() override;
95 std::map<std::string, std::string> validateInputs() override;
96 void readProperties();
97 void initializeMinimizer(size_t maxIterations);
98 size_t runMinimizer();
99 void finalizeMinimizer(size_t nIterations);
100 void copyMinimizerOutput(const API::IFuncMinimizer &minimizer);
101 void createOutput();
103 std::shared_ptr<CostFunctions::CostFuncFitting> m_costFunction;
105 std::shared_ptr<API::IFuncMinimizer> m_minimizer;
108};
109
110} // namespace Algorithms
111} // namespace CurveFitting
112} // namespace Mantid
An interface for function minimizers.
A generic fitting algorithm.
Definition: Fit.h:78
std::shared_ptr< CostFunctions::CostFuncFitting > m_costFunction
The cost function.
Definition: Fit.h:103
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: Fit.h:88
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: Fit.h:87
const std::string summary() const override
Summary of algorithms purpose.
Definition: Fit.h:85
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: Fit.h:83
size_t m_maxIterations
Max number of iterations.
Definition: Fit.h:107
std::shared_ptr< API::IFuncMinimizer > m_minimizer
The minimizer.
Definition: Fit.h:105
A base class for fitting algorithms.
Helper class which provides the Collimation Length for SANS instruments.