36 #include "gsl/gsl_deriv.h" 50 std::cerr <<
"GSLDerivator: Error : The function has not been specified" << std::endl;
61 std::cerr <<
"GSLDerivator: Error : The function has not been specified" << std::endl;
72 std::cerr <<
"GSLDerivator: Error : The function has not been specified" << std::endl;
84 double result, error = 0;
86 gsl_deriv_central( gslfw.
GetFunc(),
x, h, &result, &error);
93 double result, error = 0;
95 gsl_deriv_forward( gslfw.
GetFunc(),
x, h, &result, &error);
102 double result, error = 0;
104 gsl_deriv_backward( gslfw.
GetFunc(),
x, h, &result, &error);
double Result() const
return the result of the last derivative calculation
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Namespace for new ROOT classes and functions.
double EvalForward(double x, double h)
Computes the numerical derivative at a point x using an adaptive forward difference algorithm with a ...
void SetFunction(const FuncType &f)
fill the GSL C struct from a generic C++ callable object implementing operator()
void SetFunction(const IGenFunction &f)
Set the function for calculating the derivatives.
double EvalBackward(double x, double h)
Computes the numerical derivative at a point x using an adaptive backward difference algorithm with a...
double Error() const
return the estimate of the absolute error of the last derivative calculation
double(* GSLFuncPointer)(double, void *)
Function pointer corresponding to gsl_function signature.
int Status() const
return the error status of the last integral calculation
bool IsValid()
check if function is valid (has been set)
* x
Deprecated and error prone model selection interface.
GSLFunctionWrapper fFunction
void SetFuncPointer(GSLFuncPointer f)
set in the GSL C struct the pointer to the function evaluation
Namespace for new Math classes and functions.
Wrapper class to the gsl_function C structure.
double EvalCentral(double x, double h)
Computes the numerical derivative at a point x using an adaptive central difference algorithm with a ...
void SetParams(void *p)
set in the GSL C struct the extra-object pointer