6 #include "gsl/gsl_interp.h" 7 #include "gsl/gsl_spline.h" 25 namespace GaudiMathImplementation
55 m_x.reserve(data.
size());
56 m_y.reserve(data.
size());
57 for(
const auto& i : data ) {
58 m_x.push_back( i.first );
59 m_y.push_back( i.second );
70 const gsl_interp_type* T = nullptr ;
75 T = gsl_interp_linear ; break ;
77 T = gsl_interp_polynomial ; break ;
79 T = gsl_interp_cspline ; break ;
81 T = gsl_interp_cspline_periodic ; break ;
83 T = gsl_interp_akima ; break ;
85 T = gsl_interp_akima_periodic ; break ;
87 T = gsl_interp_cspline ; break ;
126 const double b )
const 223 return Genfun::FunctionNoop( &aux ) ;
226 return Genfun::FunctionNoop( &aux ) ;
318 {
return m_spline.deriv ( x[0] ) ; }
329 return Genfun::FunctionNoop( &aux ) ;
332 return Genfun::FunctionNoop( &aux ) ;
414 {
return m_spline.deriv2 ( x[0] ) ; }
425 return Genfun::FunctionNoop( &aux ) ;
428 return Genfun::FunctionNoop( &aux ) ;
514 {
return m_spline.integ ( m_low , x ) ; }
517 {
return m_spline.integ ( m_low , x[0] ) ; }
528 return Genfun::FunctionNoop( &aux ) ;
530 const AbsFunction& aux =
GSLSpline( *
this ) ;
531 return Genfun::FunctionNoop( &aux ) ;
double integ(const double a, const double b) const
evaluate the integral on [a,b]
double operator()(double a) const override
main method: evaluate the function
SplineBase(const Data1D &x, const Data1D &y, const GaudiMath::Interpolation::Type type)
constructor from vectors and type
double eval(const double x) const
evaluate the function
double operator()(double a) const override
main method: evaluate the function
double operator()(double a) const override
main method: evaluate the function
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
GaudiMath::Interpolation::Type m_type
transient
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
double deriv2(const double x) const
evaluate the second derivative
double deriv(const double x) const
evaluate the first derivative
GSLSplineDeriv2(const Data1D &x, const Data1D &y, const GaudiMath::Interpolation::Type type)
mandatory macro from CLHEP/GenericFunctions
GSLSplineDeriv()
default construtor is desabled ;
std::vector< double > m_y
double operator()(double a) const override
main methgod: evaluate teh function
GSLSpline(const Data1D &x, const Data1D &y, const GaudiMath::Interpolation::Type type)
mandatory macro from CLHEP/GenericFunctions
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
std::unique_ptr< gsl_interp_accel, details::gsl_deleter > m_accel
transient
GSLSplineInteg(const Data1D &x, const Data1D &y, const GaudiMath::Interpolation::Type type, const double low=0)
mandatory macro from CLHEP/GenericFunctions
Genfun::GaudiMathImplementation::Constant Constant
std::vector< double > m_x
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
std::unique_ptr< gsl_spline, details::gsl_deleter > m_spline