Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::Numerics::QUADPACK Namespace Reference

Functions for performing numerical integration (quadrature). More...

Functions

void qagi (std::function< double(double)> f, double bound, const int inf, const double epsabs, const double epsrel, double &result, double &abserr, unsigned int &status)
 Estimates an integral over a semi-infinite or infinite interval.
void qk15i (std::function< double(double)> f, double bound, const int inf, const double a, const double b, double &result, double &abserr, double &resabs, double &resasc)
 15-point Gauss-Kronrod integration with (semi-)infinite integration range.
void qk15 (std::function< double(double)> f, const double a, const double b, double &result, double &abserr, double &resabs, double &resasc)
 15-point Gauss-Kronrod integration with finite integration range.

Detailed Description

Functions for performing numerical integration (quadrature).

Reimplemented from QUADPACK.

R. Piessens, E. de Doncker-Kapenger, C. Ueberhuber, D. Kahaner, QUADPACK, a Subroutine Package for Automatic Integration, Springer, 1983

Function Documentation

◆ qagi()

void Garfield::Numerics::QUADPACK::qagi ( std::function< double(double)> f,
double bound,
const int inf,
const double epsabs,
const double epsrel,
double & result,
double & abserr,
unsigned int & status )

Estimates an integral over a semi-infinite or infinite interval.

Calculates an approximation to an integral

\[ I = \int_{a}^{\infty} f\left(x\right) dx, \]

or

\[ I = \int_{-\infty}^{a} f\left(x\right) dx, \]

or

\[ I = \int_{-\infty}^{\infty} f\left(x\right) dx \]

hopefully satisfying

\[    \left| I - \mathrm{RESULT} \right| \leq
    \max(\varepsilon_{\mathrm{abs}}, \varepsilon_{\mathrm{rel}}
    \left|I\right|).
\]

Parameters
ffunction to be integrated.
boundvalue of the finite endpoint of the integration range (if any).
infindicates the type of integration range.
  • 1: ( bound, +Infinity)
  • -1: (-Infinity, bound)
  • 2: (-Infinity, +Infinity)
epsabsrequested absolute accuracy
epsrelrequested relative accuracy
resultthe estimated value of the integral
abserrestimated error
statuserror flag
  • 0: normal and reliable termination, requested accuracy has been achieved.
  • > 0: abnormal termination, estimates for result and error are less reliable.
    • 1: maximum number of subdivisions reached.
    • 2: occurance of roundoff error prevents the requested tolerance from being achieved. Error may be underestimated.
    • 3: extremely bad integrand behaviour at some points of the integration interval.
    • 4: algorithm does not converge, roundoff error is detected in the extrapolation table. It is assumed that the requested tolerance cannot be achieved and that the returned result is the best that can be obtained.
    • 5: integral is probably divergent, or slowly convergent.
    • 6: invalid input.

◆ qk15()

void Garfield::Numerics::QUADPACK::qk15 ( std::function< double(double)> f,
const double a,
const double b,
double & result,
double & abserr,
double & resabs,
double & resasc )

15-point Gauss-Kronrod integration with finite integration range.

◆ qk15i()

void Garfield::Numerics::QUADPACK::qk15i ( std::function< double(double)> f,
double bound,
const int inf,
const double a,
const double b,
double & result,
double & abserr,
double & resabs,
double & resasc )

15-point Gauss-Kronrod integration with (semi-)infinite integration range.

Parameters
ffunction to be integrated.
boundfinite bound of original integration range (0 if inf = 2).
infindicates the type of integration range.
alower limit for integration over subrange of (0, 1).
bupper limit for integration over subrange of (0, 1).
resultapproximation to the integral.
abserrestimate of the modulus of the absolute error.
resabsapproximation to the integral over $\left|f\right|$.
resascapproximation to the integral of $\left|f - I / (b-a)\right|$ over $(a,b)$.