33 #ifndef ROOT_Math_Derivator
34 #define ROOT_Math_Derivator
68 typedef double ( * GSLFuncPointer ) ( double,
void * );
78 explicit Derivator(
const IGenFunction &f);
85 explicit Derivator(
const GSLFuncPointer &f,
void * p = 0);
93 Derivator(
const Derivator &);
94 Derivator & operator = (
const Derivator &);
106 template <
class UserFunc>
107 inline void SetFunction(
const UserFunc &f) {
109 SetFunction( &GSLFunctionAdapter<UserFunc>::F, const_cast<void *>(p) );
117 void SetFunction(
const IGenFunction &f);
126 void SetFunction(
const GSLFuncPointer &f,
void * p = 0);
136 double Eval(
double x,
double h = 1E-8)
const;
144 double EvalCentral(
double x,
double h = 1E-8)
const;
151 double EvalForward(
double x,
double h = 1E-8)
const;
158 double EvalBackward(
double x,
double h = 1E-8)
const;
170 static double Eval(
const IGenFunction & f,
double x,
double h = 1E-8);
176 static double EvalCentral(
const IGenFunction & f,
double x,
double h = 1E-8);
184 static double EvalForward(
const IGenFunction & f,
double x,
double h = 1E-8);
191 static double EvalBackward(
const IGenFunction & f,
double x,
double h = 1E-8);
198 static double Eval(
const IMultiGenFunction & f,
const double * x,
unsigned int icoord = 0,
double h = 1E-8);
204 static double Eval(IParamFunction & f,
double x,
const double * p,
unsigned int ipar = 0,
double h = 1E-8);
210 static double Eval(IParamMultiFunction & f,
const double * x,
const double * p,
unsigned int ipar = 0,
double h = 1E-8);
221 double Result()
const;
226 double Error()
const;
232 mutable GSLDerivator * fDerivator;