31 #ifndef ROOT_Math_GSLInterpolator
32 #define ROOT_Math_GSLInterpolator
40 #include "gsl/gsl_interp.h"
41 #include "gsl/gsl_spline.h"
43 #include "gsl/gsl_errno.h"
71 bool Init(
unsigned int ndata,
const double *x,
const double * y);
73 double Eval(
double x )
const
77 static unsigned int nErrors = 0;
85 MATH_WARN_MSG(
"GSLInterpolator::Eval",
"Suppressing additional warnings");
94 static unsigned int nErrors = 0;
96 int ierr = gsl_spline_eval_deriv_e(
fSpline, x,
fAccel, &deriv );
101 else if(nErrors == 4)
102 MATH_WARN_MSG(
"GSLInterpolator::Deriv",
"Suppressing additional warnings");
110 static unsigned int nErrors = 0;
112 int ierr = gsl_spline_eval_deriv2_e(
fSpline, x,
fAccel, &deriv2 );
117 else if(nErrors == 4)
118 MATH_WARN_MSG(
"GSLInterpolator::Deriv2",
"Suppressing additional warnings");
123 double Integ(
double a,
double b)
const {
124 if ( a > b)
return -
Integ(b,a);
127 static unsigned int nErrors = 0;
129 int ierr = gsl_spline_eval_integ_e(
fSpline, a, b,
fAccel, &result );
134 else if(nErrors == 4)
135 MATH_WARN_MSG(
"GSLInterpolator::Integ",
"Suppress additional warnings" )
Namespace for new ROOT classes and functions.
double Deriv2(double x) const
double Eval(double x) const
double Deriv(double x) const
#define MATH_WARN_MSG(loc, str)
virtual ~GSLInterpolator()
GSLInterpolator & operator=(const GSLInterpolator &)
bool Init(unsigned int ndata, const double *x, const double *y)
Interpolation class based on GSL interpolation functions.
Type
Enumeration defining the types of interpolation methods availables.
Namespace for new Math classes and functions.
gsl_interp_accel * fAccel
const gsl_interp_type * fInterpType
double Integ(double a, double b) const
GSLInterpolator(unsigned int ndata, Interpolation::Type type)