13#ifndef ROOT_Math_WrappedTF1
14#define ROOT_Math_WrappedTF1
85 return fFunc->GetParameters();
93 fFunc->SetParameters(p);
97 unsigned int NPar()
const override
100 return fFunc->GetNpar();
106 return std::string(
fFunc->GetParName(i));
110 using BaseGradFunc::operator();
116 void FdF(
double x,
double &
f,
double &deriv)
const override
148 return fFunc->EvalPar(
fX,
nullptr);
160 mutable double fX[1];
Interface (abstract class) for one-dimensional functions providing a gradient calculation.
IParametricFunctionOneDim::BaseFunc BaseFunc
Class to Wrap a ROOT Function class (like TF1) in a IParamFunction interface of one dimensions to be ...
double DoDerivative(double x) const override
return the function derivatives w.r.t. x
double DoEvalPar(double x, const double *p) const override
evaluate function passing coordinates x and vector of parameters
double DoEval(double x) const override
evaluate function using the cached parameter values (of TF1) re-implement for better efficiency
std::string ParameterName(unsigned int i) const override
return parameter name (this is stored in TF1)
WrappedTF1 & operator=(const WrappedTF1 &rhs)
Assignment operator.
double fX[1]
! cached vector for x value (needed for TF1::EvalPar signature)
WrappedTF1(TF1 &f)
constructor from a TF1 function pointer.
const double * Parameters() const override
get the parameter values (return values cachen inside, those inside TF1 might be different)
double DoParameterDerivative(double x, const double *p, unsigned int ipar) const override
evaluate the derivative of the function with respect to the parameters
void SetParameters(const double *p) override
set parameter values need to call also SetParameters in TF1 in ace some other operations (re-normaliz...
ROOT::Math::IGenFunction * Clone() const override
Clone the wrapper but not the original function.
unsigned int NPar() const override
return number of parameters
void FdF(double x, double &f, double &deriv) const override
calculate function and derivative at same time (required by IGradient interface)
static void SetDerivPrecision(double eps)
precision value used for calculating the derivative step-size h = eps * |x|.
static double GetDerivPrecision()
get precision value used for calculating the derivative step-size
ROOT::Math::IParamGradFunction BaseGradFunc
ROOT::Math::IGradientFunctionOneDim IGrad
void ParameterGradient(double x, const double *par, double *grad) const override
evaluate the derivative of the function with respect to the parameters
~WrappedTF1() override
Destructor (no operations).
ROOT::Math::IParamGradFunction::BaseFunc BaseFunc
IParametricGradFunctionOneDim IParamGradFunction
IBaseFunctionOneDim IGenFunction