6 #include "gsl/gsl_interp.h"
7 #include "gsl/gsl_spline.h"
11 #include "GaudiMath/Splines.h"
12 #include "GaudiMath/GaudiMath.h"
25 namespace GaudiMathImplementation
38 , m_x (
new double[ x.size() ] )
39 , m_y (
new double[ y.size() ] )
49 #pragma warning(disable:4996)
51 std::copy( x.begin() , x.end() , m_x.get() ) ;
52 std::copy( y.begin() , y.end() , m_y.get() ) ;
70 , m_dim ( data.size() )
71 , m_x (
new double[ data.size() ] )
72 , m_y (
new double[ data.size() ] )
77 double* _x = m_x.get() ;
78 double* _y = m_y.get() ;
79 for(
const auto&
i : data )
81 *_x =
i.first ; ++_x ;
82 *_y =
i.second ; ++_y ;
92 , m_dim ( right.m_dim )
93 , m_x ( new double[ right.m_dim ] )
94 , m_y ( new double[ right.m_dim ] )
97 , m_type ( right.m_type )
117 if (
m_init ) { return ; }
119 const gsl_interp_type* T = 0 ;
124 T = gsl_interp_linear ; break ;
126 T = gsl_interp_polynomial ; break ;
128 T = gsl_interp_cspline ; break ;
130 T = gsl_interp_cspline_periodic ; break ;
132 T = gsl_interp_akima ; break ;
134 T = gsl_interp_akima_periodic ; break ;
136 T = gsl_interp_cspline ; break ;
143 m_accel = gsl_interp_accel_alloc() ;
176 const double b )
const
215 , m_spline ( x , y , type )
243 , m_spline ( data , type )
289 return Genfun::FunctionNoop( &aux ) ;
292 return Genfun::FunctionNoop( &aux ) ;
327 , m_spline ( x , y , type )
355 , m_spline ( data , type )
401 return Genfun::FunctionNoop( &aux ) ;
404 return Genfun::FunctionNoop( &aux ) ;
439 , m_spline ( x , y , type )
467 , m_spline ( data , type )
513 return Genfun::FunctionNoop( &aux ) ;
516 return Genfun::FunctionNoop( &aux ) ;
553 , m_spline ( x , y , type )
583 , m_spline ( data , type )
607 , m_low ( right.
m_low )
633 return Genfun::FunctionNoop( &aux ) ;
635 const AbsFunction& aux =
GSLSpline( *
this ) ;
636 return Genfun::FunctionNoop( &aux ) ;
double integ(const double a, const double b) const
evaluate the integral on [a,b]
GSLSpline()=delete
default construtor is disabled ;
GSLSplineDeriv2()=delete
default construtor is disabled ;
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
SplineBase::Data2D Data2D
SplineBase::Data2D Data2D
double eval(const double x) const
evaluate the function
virtual double operator()(double a) const
main methgod: evaluate teh function
SplineBase::Data1D Data1D
std::unique_ptr< double[]> m_y
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
SplineBase::Data2D Data2D
double operator()(double a) const override
main method: evaluate the function
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
~GSLSplineInteg() override
destructor
SplineBase::Data1D Data1D
GSLSplineInteg()=delete
default construtor is disabled ;
std::vector< double > Data1D
virtual ~GSLSpline()
destructor
GaudiMath::Interpolation::Type m_type
std::unique_ptr< double[]> m_x
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 ;
~GSLSplineDeriv2() override
destructor
SplineBase::Data1D Data1D
double operator()(double a) const override
main method: evaluate the function
SplineBase::Data2D Data2D
SplineBase::Data1D Data1D
GaudiMath.h GaudiMath/GaudiMath.h.
virtual Genfun::Derivative partial(unsigned int i) const
Derivatives.
Genfun::Derivative partial(unsigned int i) const override
Derivatives.
double operator()(double a) const override
main method: evaluate the function
Type
the list of available types for ntuples
gsl_interp_accel * m_accel
Genfun::GaudiMathImplementation::Constant Constant
std::vector< std::pair< double, double > > Data2D
~GSLSplineDeriv() override
destructor
virtual ~SplineBase()
destructor