15using namespace CurveFitting;
17using namespace Kernel;
27 declareParameter(
"A0", 0.0,
"coefficient for constant term");
28 declareParameter(
"A1", 0.0,
"coefficient for linear term");
29 declareParameter(
"A2", 0.0,
"coefficient for quadratic term");
43 for (
size_t i = 0; i < nData; i++) {
44 out[i] = a0 + a1 * xValues[i] + a2 * xValues[i] * xValues[i];
55 for (
size_t i = 0; i < nData; i++) {
57 out->
set(i, 1, xValues[i]);
58 out->
set(i, 2, xValues[i] * xValues[i]);
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
Represents the Jacobian in IFitFunction::functionDeriv.
virtual void set(size_t iY, size_t iP, double value)=0
Set a value to a Jacobian matrix element.
double getParameter(size_t i) const override
Get i-th parameter.
Provide quadratic function interface to IFunction.
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override
Derivatives of function with respect to active parameters.
void function1D(double *out, const double *xValues, const size_t nData) const override
Function you want to fit to.