16namespace CurveFitting {
62 const std::string
name()
const override {
return "UserFunction1D"; }
64 int version()
const override {
return (1); }
66 const std::string
category()
const override {
return "Optimization\\FitAlgorithms"; }
68 const std::string
summary()
const override {
return "Fits a histogram from a workspace to a user defined function."; }
69 const std::vector<std::string>
seeAlso()
const override {
return {
"Fit"}; }
74 void function(
const double *in,
double *out,
const double *xValues,
const size_t nData)
override;
81 static double *
AddVariable(
const char *varName,
void *palg);
Represents the Jacobian in IFitFunction::functionDeriv.
Deprecation notice: instead of using this algorithm please use the Fit algorithm instead.
Deprecation notice: instead of using this algorithm please use the Fit algorithm where the Function p...
int m_nPars
Number of actual parameters.
void declareAdditionalProperties() override
Declare properties that are not fit parameters.
std::vector< double > m_tmp
Temporary data storage.
UserFunction1D()
Constructor.
mu::Parser m_parser
muParser instance
std::vector< double > m_parameters
Pointer to muParser variables' buffer.
void functionDeriv(const double *in, API::Jacobian *out, const double *xValues, const size_t nData) override
Derivatives of function with respect to parameters you are trying to fit.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::string summary() const override
Summary of algorithms purpose.
static double * AddVariable(const char *varName, void *palg)
Static callback function used by MuParser to initialize variables implicitly.
bool m_x_set
True indicates that input formula contains 'x' variable.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
void function(const double *in, double *out, const double *xValues, const size_t nData) override
overwrite base class methods
void prepare() override
Declare fit parameters using muParser's implicit variable initialization.
void declareParameters() override
Declare parameters specific to fitting function.
double m_x
Used as 'x' variable in m_parser.
std::vector< double > m_tmp1
Temporary data storage.
int version() const override
Algorithm's version for identification overriding a virtual method.
Helper class which provides the Collimation Length for SANS instruments.