3 #ifndef GAUDIMATH_SPLINES_H
4 #define GAUDIMATH_SPLINES_H 1
16 #include "CLHEP/GenericFunctions/GenericFunctions.hh"
17 #include "CLHEP/GenericFunctions/Argument.hh"
18 #include "CLHEP/GenericFunctions/AbsFunction.hh"
26 #include "gsl/gsl_interp.h"
27 #include "gsl/gsl_spline.h"
33 namespace GaudiMathImplementation
64 template <
class DATAX,
class DATAY>
71 , m_dim ( end_x - begin_x )
72 , m_x (
new double[ end_x - begin_x ] )
73 , m_y (
new double[ end_x - begin_x ] )
79 std::copy ( begin_y , begin_y + ( end_x - begin_x ) , m_y ) ;
94 , m_dim ( end - begin )
95 , m_x (
new double[ end - begin ] )
96 , m_y (
new double[ end - begin ] )
103 for ( DATA it = begin ; end != it ; ++ it )
105 *_x = it -> first ; ++_x ;
106 *_y = it ->
second ; ++_y ;
115 double eval (
const double x )
const ;
117 double deriv (
const double x )
const ;
119 double deriv2 (
const double x )
const ;
121 double integ (
const double a ,
const double b )
const ;
172 const GaudiMath::Interpolation::
Type type ) ;
193 const GaudiMath::Interpolation::
Type type ) ;
222 ( const GaudiMath::Interpolation::
Type type ,
227 , m_spline( type , begin_x , end_x , begin_y )
240 template <
class DATA>
246 , m_spline( type , begin , end )
256 virtual double operator() (
double a )
const ;
258 virtual double operator() (
const Argument& x )
const ;
311 const GaudiMath::Interpolation::
Type type ) ;
332 const GaudiMath::Interpolation::
Type type ) ;
361 ( const GaudiMath::Interpolation::
Type type ,
366 , m_spline( type , begin_x , end_x , begin_y )
379 template <
class DATA>
385 , m_spline( type , begin , end )
395 virtual double operator() (
double a )
const ;
397 virtual double operator() (
const Argument& x )
const ;
450 const GaudiMath::Interpolation::
Type type ) ;
471 const GaudiMath::Interpolation::
Type type ) ;
500 ( const GaudiMath::Interpolation::
Type type ,
505 , m_spline( type , begin_x , end_x , begin_y )
518 template <
class DATA>
524 , m_spline( type , begin , end )
534 virtual double operator() (
double a )
const ;
536 virtual double operator() (
const Argument& x )
const ;
590 const GaudiMath::Interpolation::
Type type ,
591 const
double low = 0 ) ;
613 const GaudiMath::Interpolation::
Type type ,
614 const
double low = 0 ) ;
644 ( const GaudiMath::Interpolation::
Type type ,
650 , m_spline ( type , begin_x , end_x , begin_y )
665 template <
class DATA>
672 , m_spline ( type , begin , end )
677 const double low = 0 ) ;
684 virtual double operator() (
double a )
const ;
686 virtual double operator() (
const Argument& x )
const ;
712 #endif // GAUDIMATH_SPLINES_H