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 ) ;