12#include <gsl/gsl_sf_erf.h>
24using namespace CurveFitting;
32 declareParameter(
"Width", 1.0);
33 declareParameter(
"Tcross", 1.0);
35 declareParameter(
"Beta0", 0.0);
36 declareParameter(
"Beta1", 0.0);
37 declareParameter(
"Beta0t", 0.0);
38 declareParameter(
"Beta1t", 0.0);
52 for (
size_t i = 0; i < nData; ++i) {
53 out[i] =
corefunction(xValues[i], width, tcross, beta0, beta1, beta0t, beta1t);
67 double beta0t,
double beta1t)
const {
68 double n = 0.5 * gsl_sf_erfc(width * (tcross - 1.0 / dh));
69 double beta = 1.0 / (
n * (beta0 + beta1 * dh) + (1.0 -
n) * (beta0t - beta1t / 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.
ThermalNeutronBk2BkExpBETA : Function to calculate Beta of Bk2Bk Exponential function from Thermal Ne...
void function1D(double *out, const double *xValues, const size_t nData) const override
Override.
double corefunction(double dh, double width, double tcross, double beta0, double beta1, double beta0t, double beta1t) 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.