16using namespace CurveFitting;
18using namespace Kernel;
25 declareParameter(
"Height", 1.0,
"Height at time zero");
26 declareParameter(
"Lifetime", 1.0,
"Relaxation time of the standard exponential");
27 declareParameter(
"Stretching", 1.0,
"Stretching exponent");
41 for (
size_t i = 0; i < nData; i++) {
42 double x = xValues[i];
46 throw std::runtime_error(
"StretchExp is undefined for negative argument.");
48 out[i] = h * exp(-pow(
x / t, b));
63 for (
size_t i = 0; i < nData; i++) {
64 double x = xValues[i];
65 double a = pow(
x / t, b);
68 out->
set(i, 1, h * a * b * e / t);
73 out->
set(i, 2, -h * a * e * log(
x / t));
#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 Streteched Exponential fitting function: h*exp(-(x/t)^b )
void function1D(double *out, const double *xValues, const size_t nData) const override
Function you want to fit to.
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override
Derivatives of function with respect to active parameters.