| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# GaudiMath Namespace Reference

## Detailed Description

GaudiMath.h GaudiMath/GaudiMath.h.

Author:
  Vanya BELYAEV Ivan.Belyaev@itep.ru

Date:
  2003-08-31

## Namespaces
namespace | Integration
namespace | Interpolation
## Typedefs
typedef Genfun::GaudiMathImplementation::AdapterIFunction | AIDAFunction
typedef Genfun::GaudiMathImplementation::Adapter2DoubleFunction | Function2D
typedef Genfun::GaudiMathImplementation::Adapter3DoubleFunction | Function3D
typedef Genfun::GaudiMathImplementation::SimpleFunction | SimpleFunction
typedef Genfun::GaudiMathImplementation::GSLFunctionWithMode | GSLFunctionWithMode
typedef Genfun::GaudiMathImplementation::GSLFunctionWithError | GSLFunctionWithError
typedef Genfun::GaudiMathImplementation::GSLFunctionWithModeAndError | GSLFunctionWithModeAndError
typedef Genfun::AbsFunction | Function
typedef Genfun::GaudiMathImplementation::Constant | Constant
typedef Genfun::GaudiMathImplementation::NumericalDerivative | Derivative
typedef Genfun::GaudiMathImplementation::SimpleFunction | SimpleFun
typedef Genfun::GaudiMathImplementation::NumericalIndefiniteIntegral | IndIntegral
typedef Genfun::GaudiMathImplementation::NumericalDefiniteIntegral | DefIntegral
typedef Genfun::GaudiMathImplementation::SplineBase | SimpleSpline
typedef Genfun::GaudiMathImplementation::GSLSpline | Spline
typedef Genfun::GaudiMathImplementation::GSLSplineDeriv | SplineDeriv
typedef Genfun::GaudiMathImplementation::GSLSplineDeriv2 | SplineDeriv2
typedef Genfun::GaudiMathImplementation::GSLSplineInteg | SplineInteg
## Functions
AIDAFunction | adapter (const AIDA::IFunction &function)
Function2D | adapter (Function2D::Function function)
Function3D | adapter (Function3D::Function function)
SimpleFunction | adapter (SimpleFunction::Function1 function)
SimpleFunction | adapter (const size_t dim, SimpleFunction::Function2 function)
SimpleFunction | adapter (const size_t dim, SimpleFunction::Function3 function)
GSLFunctionWithMode | adapter (GSLFunctionWithMode::Function function, const gsl_mode_t &mode)
GSLFunctionWithError | adapter (GSLFunctionWithError::Function function)
GSLFunctionWithModeAndError | adapter (GSLFunctionWithModeAndError::Function function, const gsl_mode_t &mode)
double | Integral (const Genfun::AbsFunction &function, const double a, const double b, const GaudiMath::Integration::Type type=GaudiMath::Integration::Adaptive, const GaudiMath::Integration::KronrodRule rule=GaudiMath::Integration::Default, const double epsabs=1.e-10, const double epsrel=1.e-7, const size_t size=1000)
double | Integral (const Genfun::AbsFunction &function, const double a, const double b, const std::vector< double > &points, const double epsabs=1e-9, const double epsrel=1.e-6, const size_t size=1000)
double | Integral (const Genfun::AbsFunction &function, const double a, const GaudiMath::Integration::Inf b=GaudiMath::Integration::Infinity, const double epsabs=1e-9, const double epsrel=1.e-6, const size_t size=1000)
double | Integral (const Genfun::AbsFunction &function, const GaudiMath::Integration::Inf a, const double b, const double epsabs=1e-9, const double epsrel=1.e-6, const size_t size=1000)
double | Integral (const Genfun::AbsFunction &function, const GaudiMath::Integration::Inf a=GaudiMath::Integration::Infinity, const GaudiMath::Integration::Inf b=GaudiMath::Integration::Infinity, const double epsabs=1e-9, const double epsrel=1.e-6, const size_t size=1000)

## Typedef Documentation

typedef Genfun::GaudiMathImplementation::AdapterIFunction GaudiMath::AIDAFunction

Definition at line 18 of file Adapters.h.

typedef Genfun::GaudiMathImplementation::Constant GaudiMath::Constant

Definition at line 29 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::NumericalDefiniteIntegral GaudiMath::DefIntegral

Definition at line 37 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::NumericalDerivative GaudiMath::Derivative

Definition at line 31 of file GaudiMath.h.

typedef Genfun::AbsFunction GaudiMath::Function

Definition at line 26 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::Adapter2DoubleFunction GaudiMath::Function2D

Definition at line 20 of file Adapters.h.

typedef Genfun::GaudiMathImplementation::Adapter3DoubleFunction GaudiMath::Function3D

Definition at line 22 of file Adapters.h.

typedef Genfun::GaudiMathImplementation::GSLFunctionWithError GaudiMath::GSLFunctionWithError

Definition at line 29 of file Adapters.h.

typedef Genfun::GaudiMathImplementation::GSLFunctionWithMode GaudiMath::GSLFunctionWithMode

Definition at line 27 of file Adapters.h.

typedef Genfun::GaudiMathImplementation::GSLFunctionWithModeAndError GaudiMath::GSLFunctionWithModeAndError

Definition at line 31 of file Adapters.h.

typedef Genfun::GaudiMathImplementation::NumericalIndefiniteIntegral GaudiMath::IndIntegral

Definition at line 35 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::SimpleFunction GaudiMath::SimpleFun

Definition at line 33 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::SimpleFunction GaudiMath::SimpleFunction

Definition at line 24 of file Adapters.h.

typedef Genfun::GaudiMathImplementation::SplineBase GaudiMath::SimpleSpline

Definition at line 40 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::GSLSpline GaudiMath::Spline

Definition at line 42 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::GSLSplineDeriv GaudiMath::SplineDeriv

Definition at line 44 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::GSLSplineDeriv2 GaudiMath::SplineDeriv2

Definition at line 46 of file GaudiMath.h.

typedef Genfun::GaudiMathImplementation::GSLSplineInteg GaudiMath::SplineInteg

Definition at line 48 of file GaudiMath.h.

## Function Documentation

GSLFunctionWithModeAndError GaudiMath::adapter | ( | GSLFunctionWithModeAndError::Function | function,
|  | const gsl_mode_t & | mode |
| ) |  |  |

Definition at line 63 of file Adapters.cpp.

    00065   { return GSLFunctionWithModeAndError ( function , mode ) ; }

GSLFunctionWithError GaudiMath::adapter | ( | GSLFunctionWithError::Function | function | ) |

Definition at line 59 of file Adapters.cpp.

    00060   { return GSLFunctionWithError ( function ) ; }

GSLFunctionWithMode GaudiMath::adapter | ( | GSLFunctionWithMode::Function | function,
|  | const gsl_mode_t & | mode |
| ) |  |  |

Definition at line 54 of file Adapters.cpp.

    00056   { return GSLFunctionWithMode  ( function , mode ) ; }

SimpleFunction GaudiMath::adapter | ( | const size_t | dim,
|  | SimpleFunction::Function3 | function |
| ) |  |  |

Definition at line 49 of file Adapters.cpp.

    00051   { return SimpleFunction ( function , dim ) ; }

SimpleFunction GaudiMath::adapter | ( | const size_t | dim,
|  | SimpleFunction::Function2 | function |
| ) |  |  |

Definition at line 44 of file Adapters.cpp.

    00046   { return SimpleFunction ( function , dim ) ; }

SimpleFunction GaudiMath::adapter | ( | SimpleFunction::Function1 | function | ) |

Definition at line 40 of file Adapters.cpp.

    00041   { return SimpleFunction ( function ) ; }

Function3D GaudiMath::adapter | ( | Function3D::Function | function | ) |

Definition at line 36 of file Adapters.cpp.

    00037   { return Function3D ( function ) ; }

Function2D GaudiMath::adapter | ( | Function2D::Function | function | ) |

Definition at line 32 of file Adapters.cpp.

    00033   { return Function2D ( function ) ; }

AIDAFunction GaudiMath::adapter | ( | const AIDA::IFunction & | function | ) |

Definition at line 28 of file Adapters.cpp.

    00029   { return AIDAFunction( function ) ; }

double GaudiMath::Integral | ( | const Genfun::AbsFunction & | function,
|  | const GaudiMath::Integration::Inf | a = `GaudiMath::Integration::Infinity`,
|  | const GaudiMath::Integration::Inf | b = `GaudiMath::Integration::Infinity`,
|  | const double | epsabs = `1e-9`,
|  | const double | epsrel = `1.e-6`,
|  | const size_t | size = `1000` |
| ) |  |  |

Definition at line 130 of file Integral.cpp.

    00136   {
    00137     if ( 1 != function.dimensionality() )
    00138       { throw GaudiException
    00139           ("GaudiMath::Integral: illegal function dimension" ,
    00140            "*GaudiMath*" , StatusCode::FAILURE ); }
    00141
    00142     const Genfun::AbsFunction& one   =
    00143       Genfun::GaudiMathImplementation::Constant ( 1.0 , 1 ) ;
    00144
    00145     const Genfun::AbsFunction& cross =
    00146       Genfun::FunctionDirectProduct (&one , &function ) ;
    00147
    00148     // FIXME: (MCl) the static_cast below are needed to avoid warnings and to
    00149     // match the signature in NumericalDefiniteIntegral.h (around line 288).
    00150     const Genfun::AbsFunction& result =
    00151       Genfun::GaudiMathImplementation::NumericalDefiniteIntegral
    00152       ( cross , 1 , static_cast<float>(epsabs) , static_cast<float>(epsrel) , size ) ;
    00153
    00154     return result( Genfun::Argument(1) ) ;
    00155   };

double GaudiMath::Integral | ( | const Genfun::AbsFunction & | function,
|  | const GaudiMath::Integration::Inf | a,
|  | const double | b,
|  | const double | epsabs = `1e-9`,
|  | const double | epsrel = `1.e-6`,
|  | const size_t | size = `1000` |
| ) |  |  |

Definition at line 102 of file Integral.cpp.

    00108   {
    00109     if ( 1 != function.dimensionality() )
    00110       { throw GaudiException
    00111           ("GaudiMath::Integral: illegal function dimension" ,
    00112            "*GaudiMath*" , StatusCode::FAILURE ); }
    00113
    00114     const Genfun::AbsFunction& one   =
    00115       Genfun::GaudiMathImplementation::Constant ( 1.0 , 1 ) ;
    00116
    00117     const Genfun::AbsFunction& cross =
    00118       Genfun::FunctionDirectProduct (&one , &function ) ;
    00119
    00120     const Genfun::AbsFunction& result =
    00121       Genfun::GaudiMathImplementation::NumericalDefiniteIntegral
    00122       ( cross , 1 , a , b , epsabs , epsrel , size ) ;
    00123
    00124     return result( Genfun::Argument(1) ) ;
    00125   };

double GaudiMath::Integral | ( | const Genfun::AbsFunction & | function,
|  | const double | a,
|  | const GaudiMath::Integration::Inf | b = `GaudiMath::Integration::Infinity`,
|  | const double | epsabs = `1e-9`,
|  | const double | epsrel = `1.e-6`,
|  | const size_t | size = `1000` |
| ) |  |  |

Definition at line 76 of file Integral.cpp.

    00082   {
    00083     if ( 1 != function.dimensionality() )
    00084       { throw GaudiException
    00085           ("GaudiMath::Integral: illegal function dimension" ,
    00086            "*GaudiMath*" , StatusCode::FAILURE ); }
    00087
    00088     const Genfun::AbsFunction& one   =
    00089       Genfun::GaudiMathImplementation::Constant ( 1.0 , 1 ) ;
    00090
    00091     const Genfun::AbsFunction& cross =
    00092       Genfun::FunctionDirectProduct (&one , &function ) ;
    00093
    00094     const Genfun::AbsFunction& result =
    00095       Genfun::GaudiMathImplementation::NumericalDefiniteIntegral
    00096       ( cross , 1 , a , b , epsabs , epsrel , size ) ;
    00097
    00098     return result( Genfun::Argument(1) ) ;
    00099   };

double GaudiMath::Integral | ( | const Genfun::AbsFunction & | function,
|  | const double | a,
|  | const double | b,
|  | const std::vector< double > & | points,
|  | const double | epsabs = `1e-9`,
|  | const double | epsrel = `1.e-6`,
|  | const size_t | size = `1000` |
| ) |  |  |

Definition at line 48 of file Integral.cpp.

    00055   {
    00056
    00057   if ( 1 != function.dimensionality() )
    00058       { throw GaudiException
    00059           ("GaudiMath::Integral: illegal function dimension" ,
    00060            "*GaudiMath*" , StatusCode::FAILURE ); }
    00061
    00062     const Genfun::AbsFunction& one   =
    00063       Genfun::GaudiMathImplementation::Constant ( 1.0 , 1 ) ;
    00064
    00065     const Genfun::AbsFunction& cross =
    00066       Genfun::FunctionDirectProduct (&one , &function ) ;
    00067
    00068     const Genfun::AbsFunction& result =
    00069       Genfun::GaudiMathImplementation::NumericalDefiniteIntegral
    00070       ( cross , 1 , a , b, points , epsabs , epsrel , size ) ;
    00071
    00072     return result( Genfun::Argument(1) ) ;
    00073   } ;

double GaudiMath::Integral | ( | const Genfun::AbsFunction & | function,
|  | const double | a,
|  | const double | b,
|  | const GaudiMath::Integration::Type | type = `GaudiMath::Integration::Adaptive`,
|  | const GaudiMath::Integration::KronrodRule | rule = `GaudiMath::Integration::Default`,
|  | const double | epsabs = `1.e-10`,
|  | const double | epsrel = `1.e-7`,
|  | const size_t | size = `1000` |
| ) |  |  |

Definition at line 20 of file Integral.cpp.

    00028   {
    00029     if ( 1 != function.dimensionality() )
    00030       { throw GaudiException
    00031           ("GaudiMath::Integral: illegal function dimension" ,
    00032            "*GaudiMath*" , StatusCode::FAILURE ); }
    00033
    00034     const Genfun::AbsFunction& one   =
    00035       Genfun::GaudiMathImplementation::Constant ( 1.0 , 1 ) ;
    00036
    00037     const Genfun::AbsFunction& cross =
    00038       Genfun::FunctionDirectProduct (&one , &function ) ;
    00039
    00040     const Genfun::AbsFunction& result =
    00041       Genfun::GaudiMathImplementation::NumericalDefiniteIntegral
    00042       ( cross , 1 , a , b, type , rule , epsabs , epsrel , size ) ;
    00043
    00044     return result( Genfun::Argument(1) ) ;
    00045   };