6 #include "gsl/gsl_interp.h" 7 #include "gsl/gsl_spline.h" 25 namespace GaudiMathImplementation
38 , m_x (
new double[ x.
size() ] )
39 , m_y (
new double[ y.
size() ] )
40 , m_spline (
nullptr )
49 #pragma warning(disable:4996) 70 , m_dim ( data.
size() )
71 , m_x (
new double[ data.
size() ] )
72 , m_y (
new double[ data.
size() ] )
75 double* _x = m_x.get() ;
76 double* _y = m_y.get() ;
77 for(
const auto& i : data )
79 *_x = i.first ; ++_x ;
80 *_y = i.second ; ++_y ;
90 , m_dim ( right.m_dim )
91 , m_x ( new double[ right.m_dim ] )
92 , m_y ( new double[ right.m_dim ] )
93 , m_type ( right.m_type )
113 if (
m_init ) { return ; }
115 const gsl_interp_type* T = nullptr ;
120 T = gsl_interp_linear ; break ;
122 T = gsl_interp_polynomial ; break ;
124 T = gsl_interp_cspline ; break ;
126 T = gsl_interp_cspline_periodic ; break ;
128 T = gsl_interp_akima ; break ;
130 T = gsl_interp_akima_periodic ; break ;
132 T = gsl_interp_cspline ; break ;
139 m_accel = gsl_interp_accel_alloc() ;
172 const double b )
const 285 return Genfun::FunctionNoop( &aux ) ;
288 return Genfun::FunctionNoop( &aux ) ;
386 {
return m_spline.deriv ( x[0] ) ; }
397 return Genfun::FunctionNoop( &aux ) ;
400 return Genfun::FunctionNoop( &aux ) ;
498 {
return m_spline.deriv2 ( x[0] ) ; }
509 return Genfun::FunctionNoop( &aux ) ;
512 return Genfun::FunctionNoop( &aux ) ;
603 , m_low ( right.
m_low )
615 {
return m_spline.integ ( m_low , x ) ; }
618 {
return m_spline.integ ( m_low , x[0] ) ; }
629 return Genfun::FunctionNoop( &aux ) ;
631 const AbsFunction& aux =
GSLSpline( *
this ) ;
632 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
GSLSpline()=delete
default construtor is disabled ;
GSLSplineDeriv2()=delete
default construtor is disabled ;
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.
std::unique_ptr< double[]> m_y
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
~GSLSplineInteg() override
destructor
GSLSplineInteg()=delete
default construtor is disabled ;
GaudiMath::Interpolation::Type m_type
std::unique_ptr< double[]> m_x
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
GSLSplineDeriv()
default construtor is desabled ;
~GSLSpline() override
destructor
double operator()(double a) const override
main methgod: evaluate teh function
~GSLSplineDeriv2() override
destructor
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
gsl_interp_accel * m_accel
Genfun::GaudiMathImplementation::Constant Constant
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
~GSLSplineDeriv() override
destructor