17using namespace CurveFitting;
19using namespace Kernel;
26 declareParameter(
"Magnitude", 1.0,
"coefficient for linear term");
27 declareParameter(
"Exponent", 1.0,
"exponent");
28 declareParameter(
"Constant", 0.0,
"coefficient for constant term");
36 for (
size_t i = 0; i < nData; i++) {
37 out[i] = c + a * pow(xValues[i], b);
45 for (
size_t i = 0; i < nData; i++) {
46 double diffa = pow(xValues[i], b);
47 double diffb = a * pow(xValues[i], b) * log(xValues[i]);
48 out->
set(i, 0, diffa);
49 out->
set(i, 1, diffb);
#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 Power Law function interface to IFunction.
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.