Genfun::GaudiMathImplementation::SplineBase Class Reference
#include <Splines.h>
List of all members.
Public Types |
| typedef std::vector< double > | Data1D |
typedef std::vector< std::pair
< double, double > > | Data2D |
Public Member Functions |
| | SplineBase (const Data1D &x, const Data1D &y, const GaudiMath::Interpolation::Type type) |
| | constructor from vectors and type
|
| | SplineBase (const Data2D &data, const GaudiMath::Interpolation::Type type) |
| | constructor from vector of (x,y(x)) pairs
|
| template<class DATAX , class DATAY > |
| | SplineBase (const GaudiMath::Interpolation::Type type, DATAX begin_x, DATAX end_x, DATAY begin_y) |
| | templated constructor in the spirit of STL-algorithms
|
| template<class DATA > |
| | SplineBase (const GaudiMath::Interpolation::Type type, DATA begin, DATA end) |
| | templated constructor from the sequence of (x,y(x)) pairs as sequence of pairs the class TabulatedProperty can be used
|
| | SplineBase (const SplineBase &) |
| | copy constructor
|
| virtual | ~SplineBase () |
| | destructor
|
| double | eval (const double x) const |
| | evaluate the function
|
| double | deriv (const double x) const |
| | evaluate the first derivative
|
| double | deriv2 (const double x) const |
| | evaluate the second derivative
|
| double | integ (const double a, const double b) const |
| | evaluate the integral on [a,b]
|
Protected Member Functions |
| void | initialize () const |
Private Member Functions |
| | SplineBase () |
| SplineBase & | operator= (const SplineBase &) |
Private Attributes |
| bool | m_init |
| size_t | m_dim |
| double * | m_x |
| double * | m_y |
| gsl_spline * | m_spline |
| gsl_interp_accel * | m_accel |
| GaudiMath::Interpolation::Type | m_type |
Detailed Description
Definition at line 36 of file Splines.h.
Member Typedef Documentation
Constructor & Destructor Documentation
constructor from vectors and type
- Parameters:
-
| x | vector of x |
| y | vector of y(x) |
| type | interpolation type |
Definition at line 32 of file Splines.cpp.
00035 : m_init ( false )
00036 , m_dim ( x.size() )
00037 , m_x ( new double[ x.size() ] )
00038 , m_y ( new double[ y.size() ] )
00039 , m_spline ( 0 )
00040 , m_accel ( 0 )
00041 , m_type ( type )
00042 {
00043 std::copy( x.begin() , x.end() , m_x ) ;
00044 std::copy( y.begin() , y.end() , m_y ) ;
00045 }
constructor from vector of (x,y(x)) pairs
- Parameters:
-
| data | vector of (x,y(x)) pairs |
| type | interpolaiton type |
Definition at line 55 of file Splines.cpp.
00057 : m_init ( false )
00058 , m_dim ( data.size() )
00059 , m_x ( new double[ data.size() ] )
00060 , m_y ( new double[ data.size() ] )
00061 , m_spline ( 0 )
00062 , m_accel ( 0 )
00063 , m_type ( type )
00064 {
00065 double* _x = m_x ;
00066 double* _y = m_y ;
00067 for( Data2D::const_iterator it =
00068 data.begin() ; data.end() != it ; ++it )
00069 {
00070 *_x = it -> first ; ++_x ;
00071 *_y = it -> second ; ++_y ;
00072 }
00073 }
template<class DATAX , class DATAY >
| Genfun::GaudiMathImplementation::SplineBase::SplineBase |
( |
const GaudiMath::Interpolation::Type |
type, |
|
|
DATAX |
begin_x, |
|
|
DATAX |
end_x, |
|
|
DATAY |
begin_y | |
|
) |
| | [inline] |
templated constructor in the spirit of STL-algorithms
- Parameters:
-
| type | interpolation type |
| begin_x | begin of X-sequence |
| end_x | end of X-sequence |
| begin_Y | begin of Y-sequence |
Definition at line 66 of file Splines.h.
00070 : m_init ( false )
00071 , m_dim ( end_x - begin_x )
00072 , m_x ( new double[ end_x - begin_x ] )
00073 , m_y ( new double[ end_x - begin_x ] )
00074 , m_spline ( 0 )
00075 , m_accel ( 0 )
00076 , m_type ( type )
00077 {
00078 std::copy ( begin_x , end_x , m_x ) ;
00079 std::copy ( begin_y , begin_y + ( end_x - begin_x ) , m_y ) ;
00080 }
templated constructor from the sequence of (x,y(x)) pairs as sequence of pairs the class TabulatedProperty can be used
- Parameters:
-
| type | interpolation type |
| begin | begin of sequence of (x,y(x)) pairs |
| end | end of sequence of (x,y(x)) pairs |
Definition at line 90 of file Splines.h.
00093 : m_init ( false )
00094 , m_dim ( end - begin )
00095 , m_x ( new double[ end - begin ] )
00096 , m_y ( new double[ end - begin ] )
00097 , m_spline ( 0 )
00098 , m_accel ( 0 )
00099 , m_type ( type )
00100 {
00101 double* _x = m_x ;
00102 double* _y = m_y ;
00103 for ( DATA it = begin ; end != it ; ++ it )
00104 {
00105 *_x = it -> first ; ++_x ;
00106 *_y = it -> second ; ++_y ;
00107 };
00108 }
| Genfun::GaudiMathImplementation::SplineBase::SplineBase |
( |
const SplineBase & |
right |
) |
|
copy constructor
Definition at line 79 of file Splines.cpp.
00080 : m_init ( false )
00081 , m_dim ( right.m_dim )
00082 , m_x ( new double[ right.m_dim ] )
00083 , m_y ( new double[ right.m_dim ] )
00084 , m_spline ( 0 )
00085 , m_accel ( 0 )
00086 , m_type ( right.m_type )
00087 {
00088 std::copy( right.m_x , right.m_x + right.m_dim , m_x ) ;
00089 std::copy( right.m_y , right.m_y + right.m_dim , m_y ) ;
00090 }
| Genfun::GaudiMathImplementation::SplineBase::~SplineBase |
( |
|
) |
[virtual] |
destructor
Definition at line 96 of file Splines.cpp.
00097 {
00098 if ( 0 != m_spline ) { gsl_spline_free ( m_spline ) ; }
00099 if ( 0 != m_accel ) { gsl_interp_accel_free ( m_accel ) ; }
00100
00101 if ( 0 != m_x ) { delete[] m_x ; }
00102 if ( 0 != m_y ) { delete[] m_y ; }
00103 }
| Genfun::GaudiMathImplementation::SplineBase::SplineBase |
( |
|
) |
[private] |
Member Function Documentation
| double Genfun::GaudiMathImplementation::SplineBase::deriv |
( |
const double |
x |
) |
const |
evaluate the first derivative
Definition at line 151 of file Splines.cpp.
| double Genfun::GaudiMathImplementation::SplineBase::deriv2 |
( |
const double |
x |
) |
const |
evaluate the second derivative
Definition at line 159 of file Splines.cpp.
| double Genfun::GaudiMathImplementation::SplineBase::eval |
( |
const double |
x |
) |
const |
| void Genfun::GaudiMathImplementation::SplineBase::initialize |
( |
|
) |
const [protected] |
| double Genfun::GaudiMathImplementation::SplineBase::integ |
( |
const double |
a, |
|
|
const double |
b | |
|
) |
| | const |
evaluate the integral on [a,b]
Definition at line 167 of file Splines.cpp.
Member Data Documentation
The documentation for this class was generated from the following files:
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r0/GaudiGSL/GaudiMath/Splines.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r0/GaudiGSL/src/Lib/Splines.cpp