11 #include "gsl/gsl_errno.h" 12 #include "gsl/gsl_integration.h" 31 # pragma warning( disable : 1572 ) 37 # pragma warning( disable : 4996 ) 41 namespace GaudiMathImplementation {
101 const double a,
const double b,
119 m_DIM =
function.dimensionality() - 1;
134 const double a,
const double b,
151 m_DIM =
function.dimensionality() - 1;
159 [&](
double x ) {
return x < lim.first || lim.second < x; } );
205 m_DIM =
function.dimensionality() - 1;
252 m_DIM =
function.dimensionality() - 1;
294 m_DIM =
function.dimensionality() - 1;
321 throw GaudiException(
"NumericalDefiniteIntegral::" + message,
"*GaudiMath*", sc );
335 if ( 1 !=
m_DIM ) {
Exception(
"operator(): invalid argument size " ); };
346 if ( idx >=
m_DIM ) {
Exception(
"::partial(i): invalid variable index " ); };
349 return Genfun::FunctionNoop( &aux );
362 if ( argument.dimension() !=
m_DIM ) {
Exception(
"operator(): invalid argument size " ); };
366 for (
size_t i = 0; i <
m_DIM; ++i ) {
368 const size_t j = i <
m_index ? i : i + 1;
402 Exception(
"::operator(): invalid type " );
406 Exception(
"::operator(): invalid category " );
419 m_ws->ws = gsl_integration_workspace_alloc(
size() );
420 if ( !
m_ws->ws ) {
Exception(
"allocate()::invalid workspace" ); };
431 if ( !F ) {
Exception(
"::QAGI: invalid function" ); }
448 if ( ierror ) { gsl_error(
"NumericalDefiniteIntegral::QAGI", __FILE__, __LINE__, ierror ); }
458 if ( !F ) {
Exception(
"QAGP::invalid function" ); }
467 if ( ierror ) { gsl_error(
"NumericalDefiniteIntegral::QAGI ", __FILE__, __LINE__, ierror ); }
480 if ( !F ) {
Exception(
"QNG::invalid function" ); }
488 if ( ierror ) { gsl_error(
"NumericalIndefiniteIntegral::QNG ", __FILE__, __LINE__, ierror ); }
500 if ( !F ) {
Exception(
"QAG::invalid function" ); }
511 if ( ierror ) { gsl_error(
"NumericalDefiniteIntegral::QAG ", __FILE__, __LINE__, ierror ); }
523 if ( !F ) {
Exception(
"QAG::invalid function" ); }
540 if ( ierror ) { gsl_error(
"NumericalDefiniteIntegral::QAGS ", __FILE__, __LINE__, ierror ); }
GaudiMath::Integration::Category category() const
integration category
StatusCode Exception(const std::string &message, const StatusCode &sc=StatusCode::FAILURE) const
Define general base for Gaudi exception.
GaudiMath::Integration::Category m_category
double operator()(double argument) const override
Function value.
Genfun::Derivative partial(unsigned int index) const override
Derivatives.
NumericalDefiniteIntegral()
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
unsigned int dimensionality() const override
dimensionality of the problem
double epsabs() const
absolute precision
GaudiMath::Integration::KronrodRule m_rule
This class is used for returning status codes from appropriate routines.
Type
type of integration (for finite limits)
double QAG(_Function *fun) const
double GSL_Adaptor(double x, void *params)
double epsrel() const
relatiove precision
Numerical derivative (using GSL adaptive numerical differentiation)
_Workspace * allocate() const
allocate the integration workspace
GaudiMath::Integration::Type m_type
std::unique_ptr< _Workspace, gsl_ws_deleter > m_ws
GaudiMath::Integration::Type type() const
integration type
std::unique_ptr< const AbsFunction > m_function
const Points & points() const
known singularities
double QAGP(_Function *fun) const
GaudiMath.h GaudiMath/GaudiMath.h.
KronrodRule
integration rule
double QNG(_Function *fun) const
double QAGI(_Function *fun) const
const AbsFunction & function() const
accessor to the function itself
the simple structure to be used for adaption interface Genfun::AbsFunction to gsl_function structure ...
GaudiMath::Integration::KronrodRule rule() const
integration rule
double a() const
integration limit
collection of common types for classes NumericalIndefiniteIntegral and NumericalDefiniteIntegral ...
double QAGS(_Function *fun) const
This class allows the numerical evaluation of the following functions: