The Gaudi Framework  v31r0 (aeb156f0)
GaudiMath Namespace Reference

GaudiMath.h GaudiMath/GaudiMath.h. More...

Namespaces

 Integration
 
 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

GAUDI_API AIDAFunction adapter (const AIDA::IFunction &function)
 
GAUDI_API Function2D adapter (Function2D::Function function)
 
GAUDI_API Function3D adapter (Function3D::Function function)
 
GAUDI_API SimpleFunction adapter (SimpleFunction::Function1 function)
 
GAUDI_API SimpleFunction adapter (const size_t dim, SimpleFunction::Function2 function)
 
GAUDI_API SimpleFunction adapter (const size_t dim, SimpleFunction::Function3 function)
 
GAUDI_API GSLFunctionWithMode adapter (GSLFunctionWithMode::Function function, const gsl_mode_t &mode)
 
GAUDI_API GSLFunctionWithError adapter (GSLFunctionWithError::Function function)
 
GAUDI_API GSLFunctionWithModeAndError adapter (GSLFunctionWithModeAndError::Function function, const gsl_mode_t &mode)
 
GAUDI_API 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)
 
GAUDI_API 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)
 
GAUDI_API 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)
 
GAUDI_API 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)
 
GAUDI_API 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)
 

Detailed Description

Typedef Documentation

typedef Genfun::AbsFunction GaudiMath::Function

Definition at line 23 of file GaudiMath.h.

Function Documentation

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

Definition at line 24 of file Adapters.cpp.

24 { return AIDAFunction( function ); }
Genfun::GaudiMathImplementation::AdapterIFunction AIDAFunction
Definition: Adapters.h:14
Function2D GaudiMath::adapter ( Function2D::Function  function)

Definition at line 26 of file Adapters.cpp.

26 { return Function2D( function ); }
Genfun::GaudiMathImplementation::Adapter2DoubleFunction Function2D
Definition: Adapters.h:15
Function3D GaudiMath::adapter ( Function3D::Function  function)

Definition at line 28 of file Adapters.cpp.

28 { return Function3D( function ); }
Genfun::GaudiMathImplementation::Adapter3DoubleFunction Function3D
Definition: Adapters.h:16
SimpleFunction GaudiMath::adapter ( SimpleFunction::Function1  function)

Definition at line 30 of file Adapters.cpp.

30 { return SimpleFunction( function ); }
Genfun::GaudiMathImplementation::SimpleFunction SimpleFunction
Definition: Adapters.h:17
SimpleFunction GaudiMath::adapter ( const size_t  dim,
SimpleFunction::Function2  function 
)

Definition at line 32 of file Adapters.cpp.

32  {
33  return SimpleFunction( function, dim );
34  }
Genfun::GaudiMathImplementation::SimpleFunction SimpleFunction
Definition: Adapters.h:17
SimpleFunction GaudiMath::adapter ( const size_t  dim,
SimpleFunction::Function3  function 
)

Definition at line 36 of file Adapters.cpp.

36  {
37  return SimpleFunction( function, dim );
38  }
Genfun::GaudiMathImplementation::SimpleFunction SimpleFunction
Definition: Adapters.h:17
GSLFunctionWithMode GaudiMath::adapter ( GSLFunctionWithMode::Function  function,
const gsl_mode_t &  mode 
)

Definition at line 40 of file Adapters.cpp.

40  {
41  return GSLFunctionWithMode( function, mode );
42  }
Genfun::GaudiMathImplementation::GSLFunctionWithMode GSLFunctionWithMode
Definition: Adapters.h:19
GSLFunctionWithError GaudiMath::adapter ( GSLFunctionWithError::Function  function)

Definition at line 44 of file Adapters.cpp.

44 { return GSLFunctionWithError( function ); }
Genfun::GaudiMathImplementation::GSLFunctionWithError GSLFunctionWithError
Definition: Adapters.h:20
GSLFunctionWithModeAndError GaudiMath::adapter ( GSLFunctionWithModeAndError::Function  function,
const gsl_mode_t &  mode 
)

Definition at line 46 of file Adapters.cpp.

46  {
47  return GSLFunctionWithModeAndError( function, mode );
48  }
Genfun::GaudiMathImplementation::GSLFunctionWithModeAndError GSLFunctionWithModeAndError
Definition: Adapters.h:21
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 25 of file Integral.cpp.

27  {
28  if ( 1 != function.dimensionality() ) {
29  throw GaudiException( "GaudiMath::Integral: illegal function dimension", "*GaudiMath*", StatusCode::FAILURE );
30  }
31 
32  const Genfun::AbsFunction& one = Genfun::GaudiMathImplementation::Constant( 1.0, 1 );
33 
34  const Genfun::AbsFunction& cross = Genfun::FunctionDirectProduct( &one, &function );
35 
36  const Genfun::AbsFunction& result =
37  Genfun::GaudiMathImplementation::NumericalDefiniteIntegral( cross, 1, a, b, type, rule, epsabs, epsrel, size );
38 
39  return result( Genfun::Argument( 1 ) );
40  }
Define general base for Gaudi exception.
constexpr auto size(const C &c) noexcept(noexcept(c.size())) -> decltype(c.size())
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:25
This class allows the numerical evaluation of the following functions:
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 42 of file Integral.cpp.

43  {
44 
45  if ( 1 != function.dimensionality() ) {
46  throw GaudiException( "GaudiMath::Integral: illegal function dimension", "*GaudiMath*", StatusCode::FAILURE );
47  }
48 
49  const Genfun::AbsFunction& one = Genfun::GaudiMathImplementation::Constant( 1.0, 1 );
50 
51  const Genfun::AbsFunction& cross = Genfun::FunctionDirectProduct( &one, &function );
52 
53  const Genfun::AbsFunction& result =
54  Genfun::GaudiMathImplementation::NumericalDefiniteIntegral( cross, 1, a, b, points, epsabs, epsrel, size );
55 
56  return result( Genfun::Argument( 1 ) );
57  }
Define general base for Gaudi exception.
constexpr auto size(const C &c) noexcept(noexcept(c.size())) -> decltype(c.size())
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:25
This class allows the numerical evaluation of the following functions:
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 59 of file Integral.cpp.

60  {
61  if ( 1 != function.dimensionality() ) {
62  throw GaudiException( "GaudiMath::Integral: illegal function dimension", "*GaudiMath*", StatusCode::FAILURE );
63  }
64 
65  const Genfun::AbsFunction& one = Genfun::GaudiMathImplementation::Constant( 1.0, 1 );
66 
67  const Genfun::AbsFunction& cross = Genfun::FunctionDirectProduct( &one, &function );
68 
69  const Genfun::AbsFunction& result =
70  Genfun::GaudiMathImplementation::NumericalDefiniteIntegral( cross, 1, a, b, epsabs, epsrel, size );
71 
72  return result( Genfun::Argument( 1 ) );
73  }
Define general base for Gaudi exception.
constexpr auto size(const C &c) noexcept(noexcept(c.size())) -> decltype(c.size())
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:25
This class allows the numerical evaluation of the following functions:
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 75 of file Integral.cpp.

76  {
77  if ( 1 != function.dimensionality() ) {
78  throw GaudiException( "GaudiMath::Integral: illegal function dimension", "*GaudiMath*", StatusCode::FAILURE );
79  }
80 
81  const Genfun::AbsFunction& one = Genfun::GaudiMathImplementation::Constant( 1.0, 1 );
82 
83  const Genfun::AbsFunction& cross = Genfun::FunctionDirectProduct( &one, &function );
84 
85  const Genfun::AbsFunction& result =
86  Genfun::GaudiMathImplementation::NumericalDefiniteIntegral( cross, 1, a, b, epsabs, epsrel, size );
87 
88  return result( Genfun::Argument( 1 ) );
89  }
Define general base for Gaudi exception.
constexpr auto size(const C &c) noexcept(noexcept(c.size())) -> decltype(c.size())
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:25
This class allows the numerical evaluation of the following functions:
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 91 of file Integral.cpp.

93  {
94  if ( 1 != function.dimensionality() ) {
95  throw GaudiException( "GaudiMath::Integral: illegal function dimension", "*GaudiMath*", StatusCode::FAILURE );
96  }
97 
98  const Genfun::AbsFunction& one = Genfun::GaudiMathImplementation::Constant( 1.0, 1 );
99 
100  const Genfun::AbsFunction& cross = Genfun::FunctionDirectProduct( &one, &function );
101 
102  // FIXME: (MCl) the static_cast below are needed to avoid warnings and to
103  // match the signature in NumericalDefiniteIntegral.h (around line 288).
104  const Genfun::AbsFunction& result = Genfun::GaudiMathImplementation::NumericalDefiniteIntegral(
105  cross, 1, static_cast<float>( epsabs ), static_cast<float>( epsrel ), size );
106 
107  return result( Genfun::Argument( 1 ) );
108  }
Define general base for Gaudi exception.
constexpr auto size(const C &c) noexcept(noexcept(c.size())) -> decltype(c.size())
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:25
This class allows the numerical evaluation of the following functions: