7 #include "gsl/gsl_interp.h"
8 #include "gsl/gsl_spline.h"
26 namespace GaudiMathImplementation
39 , m_x (
new double[ x.size() ] )
40 , m_y (
new double[ y.size() ] )
50 #pragma warning(disable:4996)
52 std::copy( x.begin() , x.end() , m_x ) ;
53 std::copy( y.begin() , y.end() , m_y ) ;
71 , m_dim ( data.size() )
72 , m_x (
new double[ data.size() ] )
73 , m_y (
new double[ data.size() ] )
80 for( Data2D::const_iterator it =
81 data.begin() ; data.end() != it ; ++it )
83 *_x = it -> first ; ++_x ;
84 *_y = it -> second ; ++_y ;
94 , m_dim ( right.m_dim )
95 , m_x ( new double[ right.m_dim ] )
96 , m_y ( new double[ right.m_dim ] )
99 , m_type ( right.m_type )
101 const std::size_t size =
sizeof(double) *
m_dim;
102 std::memcpy(
m_x, right.
m_x, size);
103 std::memcpy(
m_y, right.
m_y, size);
115 if ( 0 !=
m_x ) {
delete[]
m_x ; }
116 if ( 0 !=
m_y ) {
delete[]
m_y ; }
123 if (
m_init ) { return ; }
125 const gsl_interp_type* T = 0 ;
130 T = gsl_interp_linear ; break ;
132 T = gsl_interp_polynomial ; break ;
134 T = gsl_interp_cspline ; break ;
136 T = gsl_interp_cspline_periodic ; break ;
138 T = gsl_interp_akima ; break ;
140 T = gsl_interp_akima_periodic ; break ;
142 T = gsl_interp_cspline ; break ;
149 m_accel = gsl_interp_accel_alloc() ;
182 const double b )
const
219 const GaudiMath::Interpolation::
Type type )
221 , m_spline ( x , y , type )
249 , m_spline ( data , type )
295 return Genfun::FunctionNoop( &aux ) ;
298 return Genfun::FunctionNoop( &aux ) ;
331 const GaudiMath::Interpolation::
Type type )
333 , m_spline ( x , y , type )
361 , m_spline ( data , type )
407 return Genfun::FunctionNoop( &aux ) ;
410 return Genfun::FunctionNoop( &aux ) ;
443 const GaudiMath::Interpolation::
Type type )
445 , m_spline ( x , y , type )
473 , m_spline ( data , type )
519 return Genfun::FunctionNoop( &aux ) ;
522 return Genfun::FunctionNoop( &aux ) ;
556 const GaudiMath::Interpolation::
Type type ,
559 , m_spline ( x , y , type )
589 , m_spline ( data , type )
613 , m_low ( right.
m_low )
639 return Genfun::FunctionNoop( &aux ) ;
641 const AbsFunction& aux =
GSLSpline( *
this ) ;
642 return Genfun::FunctionNoop( &aux ) ;
double integ(const double a, const double b) const
evaluate the integral on [a,b]
GSLSplineDeriv2()
default construtor is desabled ;
GSLSpline()
default construtor is desabled ;
SplineBase::Data2D Data2D
SplineBase::Data2D Data2D
virtual double operator()(double a) const
main method: evaluate the function
double eval(const double x) const
evaluate the function
virtual double operator()(double a) const
main methgod: evaluate teh function
SplineBase::Data1D Data1D
virtual ~GSLSplineDeriv2()
destructor
SplineBase::Data2D Data2D
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
virtual Genfun::Derivative partial(unsigned int i) const
Derivatives.
SplineBase::Data1D Data1D
virtual Genfun::Derivative partial(unsigned int i) const
Derivatives.
virtual double operator()(double a) const
main method: evaluate the function
std::vector< double > Data1D
virtual ~GSLSpline()
destructor
GaudiMath::Interpolation::Type m_type
virtual Genfun::Derivative partial(unsigned int i) const
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 ;
GSLSplineInteg()
default construtor is desabled ;
SplineBase::Data1D Data1D
SplineBase::Data2D Data2D
SplineBase::Data1D Data1D
virtual double operator()(double a) const
main method: evaluate the function
virtual Genfun::Derivative partial(unsigned int i) const
Derivatives.
gsl_interp_accel * m_accel
Type
the list of available types for ntuples
Genfun::GaudiMathImplementation::Constant Constant
std::vector< std::pair< double, double > > Data2D
virtual ~GSLSplineDeriv()
destructor
virtual ~GSLSplineInteg()
destructor
virtual ~SplineBase()
destructor