14#include "MantidCurveFitting/DllConfig.h"
22namespace CurveFitting {
38 std::string
name()
const override {
return "UserFunction"; }
40 const std::string
category()
const override {
return "General"; }
43 void function1D(
double *out,
const double *xValues,
const size_t nData)
const override;
50 std::vector<std::string>
getAttributeNames()
const override {
return std::vector<std::string>(1,
"Formula"); }
53 return attName ==
"Formula" ?
Attribute(m_formula) : getAttribute(attName);
56 void setAttribute(
const std::string &attName,
const Attribute &
value)
override;
58 bool hasAttribute(
const std::string &attName)
const override {
return attName ==
"Formula"; }
70 mutable std::vector<double>
m_tmp;
75 static double *AddVariable(
const char *varName,
void *pufun);
double value
The value of the point.
Mantid::API::IFunction::Attribute Attribute
Base class that represents the domain of a function.
This is a specialization of IFunction for functions of one real argument.
Attribute is a non-fitting parameter.
Represents the Jacobian in IFitFunction::functionDeriv.
Implements the part of IFunction interface dealing with parameters.
bool hasAttribute(const std::string &attName) const override
Check if attribute attName exists.
std::vector< std::string > getAttributeNames() const override
Returns a list of attribute names.
std::string name() const override
Returns the function's name.
std::vector< double > m_tmp1
Temporary data storage used in functionDeriv.
bool m_x_set
True indicates that input formula contains 'x' variable.
double m_x
Used as 'x' variable in m_parser.
std::vector< double > m_tmp
Temporary data storage used in functionDeriv.
std::string m_formula
The formula.
Attribute getAttribute(const std::string &attName) const override
Return a value of attribute attName.
const std::string category() const override
The categories the Fit function belong to.
mu::Parser * m_parser
extended muParser instance
size_t nAttributes() const override
Returns the number of attributes associated with the function.
Helper class which provides the Collimation Length for SANS instruments.