13 #ifndef ROOT_Math_WrappedMultiTF1 14 #define ROOT_Math_WrappedMultiTF1 64 if (fOwnFunc && fFunc)
delete fFunc;
99 return fFunc->GetParameters();
106 fFunc->SetParameters(p);
113 return fFunc->GetNpar();
118 return std::string(fFunc->GetParName(i));
122 void ParameterGradient(
const double *
x,
const double *
par,
double *grad)
const;
126 static void SetDerivPrecision(
double eps);
129 static double GetDerivPrecision();
139 void SetAndCopyFunction(
const TF1 *
f = 0);
145 return fFunc->EvalPar(x, p);
152 return fFunc->EvalPar(x, 0);
162 return fFunc->EvalPar(x, 0);
166 double DoParameterDerivative(
const double *x,
const double *p,
unsigned int ipar)
const;
198 while (
fLinear && ip < fFunc->GetNpar()) {
229 if (
this == &rhs)
return *
this;
253 unsigned int np =
NPar();
254 for (
unsigned int i = 0; i < np; ++i)
272 if (ipar == 0)
return 1.0;
273 return std::pow(x[0], static_cast<int>(ipar));
278 return (const_cast<TFormula *>(df))->EvalPar(x) ;
virtual void SetParameters(const Double_t *params)
Namespace for new ROOT classes and functions.
double DoParameterDerivative(const double *x, const double *p, unsigned int ipar) const
evaluate the partial derivative with respect to the parameter
const TF1 * GetFunction() const
method to retrieve the internal function pointer
Interface (abstract class) for parametric gradient multi-dimensional functions providing in addition ...
void SetParameters(const double *p)
set parameter values (only the cached one in this class,leave unchanges those of TF1) ...
static double GetDerivPrecision()
get precision value used for calculating the derivative step-size
unsigned int NPar() const
return number of parameters
Class to Wrap a ROOT Function class (like TF1) in a IParamMultiFunction interface of multi-dimensions...
double pow(double, double)
virtual Int_t GetNdim() const
virtual Double_t GradientPar(Int_t ipar, const Double_t *x, Double_t eps=0.01)
Compute the gradient (derivative) wrt a parameter ipar.
void ParameterGradient(const double *x, const double *par, double *grad) const
Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at ...
ROOT::Math::IParametricGradFunctionMultiDimTempl< T > BaseParamFunc
Documentation for the abstract class IBaseFunctionMultiDim.
TF1 * CopyTF1Ptr(const TF1 *funcToCopy)
std::string ParameterName(unsigned int i) const
return parameter name (from TF1)
T DoEvalVec(const T *x) const
evaluate function using the cached parameter values (of TF1) re-implement for better efficiency ...
virtual const TObject * GetLinearPart(Int_t i) const
T DoEvalPar(const T *x, const double *p) const
evaluate function passing coordinates x and vector of parameters
virtual Bool_t IsLinear() const
WrappedMultiTF1Templ(TF1 &f, unsigned int dim=0)
constructor from a function pointer to a TF1 If dim = 0 dimension is taken from TF1::GetNdim().
IMultiGenFunctionTempl< T > * Clone() const
Clone the wrapper but not the original function.
static void SetDerivPrecision(double eps)
precision value used for calculating the derivative step-size h = eps * |x|.
ROOT::Math::IParametricFunctionMultiDimTempl< T >::BaseFunc BaseFunc
double DerivPrecision(double eps)
~WrappedMultiTF1Templ()
Destructor (no operations).
Namespace for new Math classes and functions.
Binding & operator=(OUT(*fun)(void))
unsigned int NDim() const
Retrieve the dimension of the function.
T DoEval(const T *x) const
evaluate function using the cached parameter values (of TF1) re-implement for better efficiency ...
WrappedMultiTF1Templ & operator=(const WrappedMultiTF1Templ< T > &rhs)
Assignment operator.
const double * Parameters() const
get the parameter values (return values from TF1)
virtual Int_t GetNumber() const
void SetAndCopyFunction(const TF1 *f=0)
method to set a new function pointer and copy it inside.