12#include <gsl/gsl_sf_erf.h>
24using namespace CurveFitting;
33 declareParameter(
"Width", 1.0);
34 declareParameter(
"Tcross", 1.0);
36 declareParameter(
"Alph0", 0.0);
37 declareParameter(
"Alph1", 0.0);
38 declareParameter(
"Alph0t", 0.0);
39 declareParameter(
"Alph1t", 0.0);
53 for (
size_t i = 0; i < nData; ++i) {
54 out[i] =
corefunction(xValues[i], width, tcross, alph0, alph1, alph0t, alph1t);
68 double alph0t,
double alph1t)
const {
69 double n = 0.5 * gsl_sf_erfc(width * (tcross - 1.0 / dh));
70 double alpha = 1.0 / (
n * (alph0 + alph1 * dh) + (1.0 -
n) * (alph0t - alph1t / dh));
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
Base class that represents the domain of a function.
void calNumericalDeriv(const FunctionDomain &domain, Jacobian &jacobian)
Calculate numerical derivatives.
Represents the Jacobian in IFitFunction::functionDeriv.
double getParameter(size_t i) const override
Get i-th parameter.
ThermalNeutronBk2BkExpAlpha : Function to calculate Alpha of Bk2Bk Exponential function from Thermal ...
void function1D(double *out, const double *xValues, const size_t nData) const override
Override.
double corefunction(double dh, double width, double tcross, double alph0, double alph1, double alph0t, double alph1t) const
Core function (inline) to calcualte TOF_h from d-spacing.
void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) override
Derivative to overwrite.
Helper class which provides the Collimation Length for SANS instruments.