1 #ifndef GAUDIMATH_SPLINES_H 2 #define GAUDIMATH_SPLINES_H 1 15 #include "CLHEP/GenericFunctions/GenericFunctions.hh" 16 #include "CLHEP/GenericFunctions/Argument.hh" 17 #include "CLHEP/GenericFunctions/AbsFunction.hh" 25 #include "gsl/gsl_interp.h" 26 #include "gsl/gsl_spline.h" 31 #pragma clang diagnostic push 32 #pragma clang diagnostic ignored "-Winconsistent-missing-override" 37 namespace GaudiMathImplementation
60 (
const Data2D& data ,
68 template <
class DATAX,
class DATAY>
74 : m_dim ( end_x - begin_x )
75 , m_x (
new double[ end_x - begin_x ] )
76 , m_y (
new double[ end_x - begin_x ] )
79 std::copy ( begin_x , end_x , m_x.get() ) ;
80 std::copy ( begin_y , begin_y + ( end_x - begin_x ) , m_y.get() ) ;
94 : m_dim ( end - begin )
95 , m_x (
new double[ end - begin ] )
96 , m_y (
new double[ end - begin ] )
99 double* _x = m_x.get() ;
100 double* _y = m_y.get() ;
101 for (
auto it = begin ; end != it ; ++ it )
103 *_x++ = it -> first ;
113 double eval (
const double x )
const ;
115 double deriv (
const double x )
const ;
117 double deriv2 (
const double x )
const ;
119 double integ (
const double a ,
const double b )
const ;
122 void initialize ()
const ;
129 mutable bool m_init =
false;
133 mutable gsl_spline* m_spline =
nullptr;
134 mutable gsl_interp_accel* m_accel =
nullptr;
190 ( const Data2D& data ,
225 , m_spline( type , begin_x , end_x , begin_y )
238 template <
class DATA>
244 , m_spline( type , begin , end )
254 double operator() (
double a )
const override ;
256 double operator() (
const Argument& x )
const override ;
329 ( const Data2D& data ,
364 , m_spline( type , begin_x , end_x , begin_y )
377 template <
class DATA>
383 , m_spline( type , begin , end )
393 double operator() (
double a )
const override;
395 double operator() (
const Argument& x )
const override;
468 ( const Data2D& data ,
503 , m_spline( type , begin_x , end_x , begin_y )
516 template <
class DATA>
522 , m_spline( type , begin , end )
532 double operator() (
double a )
const override;
534 double operator() (
const Argument& x )
const override;
589 const
double low = 0 ) ;
610 ( const Data2D& data ,
612 const
double low = 0 ) ;
648 , m_spline ( type , begin_x , end_x , begin_y )
663 template <
class DATA>
669 : m_spline ( type , std::forward<DATA>(
begin) , std::forward<DATA>(
end) )
674 const double low = 0 ) ;
681 double operator() (
double a )
const override;
683 double operator() (
const Argument& x )
const override;
709 #pragma clang diagnostic pop 712 #endif // GAUDIMATH_SPLINES_H
const SplineBase & spline() const
acess to the spline function
unsigned int dimensionality() const override
SplineBase::Data2D Data2D
SplineBase::Data2D Data2D
const SplineBase & spline() const
acess to the spline function
SplineBase::Data1D Data1D
const SplineBase & spline() const
acess to the spline function
SplineBase::Data2D Data2D
std::unique_ptr< double[]> m_y
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
auto begin(reverse_wrapper< T > &w)
PropertyMgr & operator=(const PropertyMgr &)=delete
unsigned int dimensionality() const override
SplineBase::Data1D Data1D
bool hasAnalyticDerivative() const override
Does this function have an analytic derivative?
std::vector< double > Data1D
GaudiMath::Interpolation::Type m_type
std::unique_ptr< double[]> m_x
auto end(reverse_wrapper< T > &w)
SplineBase::Data1D Data1D
SplineBase::Data2D Data2D
unsigned int dimensionality() const override
bool hasAnalyticDerivative() const override
Does this function have an analytic derivative?
bool hasAnalyticDerivative() const override
Does this function have an analytic derivative?
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
SplineBase::Data1D Data1D
bool hasAnalyticDerivative() const override
Does this function have an analytic derivative?
GaudiMath.h GaudiMath/GaudiMath.h.
const SplineBase & spline() const
acess to the spline function
Type
the list of available types for ntuples
unsigned int dimensionality() const override
std::vector< std::pair< double, double > > Data2D