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() ] )
40 , m_spline (
nullptr )
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() ] )
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
211 , m_spline ( x , y , type )
239 , m_spline ( data , type )
285 return Genfun::FunctionNoop( &aux ) ;
288 return Genfun::FunctionNoop( &aux ) ;
323 , m_spline ( x , y , type )
351 , m_spline ( data , type )
397 return Genfun::FunctionNoop( &aux ) ;
400 return Genfun::FunctionNoop( &aux ) ;
435 , m_spline ( x , y , type )
463 , m_spline ( data , type )
509 return Genfun::FunctionNoop( &aux ) ;
512 return Genfun::FunctionNoop( &aux ) ;
549 , m_spline ( x , y , type )
579 , m_spline ( data , type )
603 , m_low ( right.
m_low )
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]
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