16using namespace CurveFitting;
18using namespace Kernel;
25 declareParameter(
"A", 10.0,
"Amplitude at time 0");
26 declareParameter(
"Sigma", 0.2,
"Decay rate");
33 for (
size_t i = 0; i < nData; i++) {
34 double x = xValues[i];
35 out[i] = A * exp(-G * G *
x *
x);
43 for (
size_t i = 0; i < nData; i++) {
44 double x = xValues[i];
45 double g = exp(-G * G *
x *
x);
47 out->
set(i, 1, -2 * G *
x *
x * A * g);
double value
The value of the point.
#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.
void setParameter(size_t, const double &value, bool explicitlySet=true) override
Set i-th parameter.
std::string parameterName(size_t i) const override
Returns the name of parameter i.
double getParameter(size_t i) const override
Get i-th parameter.
Provide gaussian decay function: A*exp(-(sigma.x)^2))
void setActiveParameter(size_t i, double value) override
Set new value of i-th active parameter.
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.