Struct rgsl::types::integration::IntegrationWorkspace [] [src]

pub struct IntegrationWorkspace { /* fields omitted */ }

The QAG algorithm is a simple adaptive integration procedure. The integration region is divided into subintervals, and on each iteration the subinterval with the largest estimated error is bisected. This reduces the overall error rapidly, as the subintervals become concentrated around local difficulties in the integrand. These subintervals are managed by a gsl_integration_workspace struct, which handles the memory for the subinterval ranges, results and error estimates.

Methods

impl IntegrationWorkspace
[src]

This function allocates a workspace sufficient to hold n double precision intervals, their integration results and error estimates. One workspace may be used multiple times as all necessary reinitialization is performed automatically by the integration routines.

This function applies an integration rule adaptively until an estimate of the integral of f over (a,b) is achieved within the desired absolute and relative error limits, epsabs and epsrel. The function returns the final approximation, result, and an estimate of the absolute error, abserr. The integration rule is determined by the value of key, which should be chosen from the following symbolic names,

GSL_INTEG_GAUSS15 (key = 1)

GSL_INTEG_GAUSS21 (key = 2)

GSL_INTEG_GAUSS31 (key = 3)

GSL_INTEG_GAUSS41 (key = 4)

GSL_INTEG_GAUSS51 (key = 5)

GSL_INTEG_GAUSS61 (key = 6)

corresponding to the 15f64, 21f64, 31f64, 41f64, 51 and 61 point Gauss-Kronrod rules. The higher-order rules give better accuracy for smooth functions, while lower-order rules save time when the function contains local difficulties, such as discontinuities.

On each iteration the adaptive integration strategy bisects the interval with the largest error estimate. The subintervals and their results are stored in the memory provided by workspace. The maximum number of subintervals is given by limit, which may not exceed the allocated size of the workspace.

This function applies the Gauss-Kronrod 21-point integration rule adaptively until an estimate of the integral of f over (a,b) is achieved within the desired absolute and relative error limits, epsabs and epsrel. The results are extrapolated using the epsilon-algorithm, which accelerates the convergence of the integral in the presence of discontinuities and integrable singularities. The function returns the final approximation from the extrapolation, result, and an estimate of the absolute error, abserr. The subintervals and their results are stored in the memory provided by workspace. The maximum number of subintervals is given by limit, which may not exceed the allocated size of the workspace.

This function applies the adaptive integration algorithm QAGS taking account of the user-supplied locations of singular points. The array pts of length npts should contain the endpoints of the integration ranges defined by the integration region and locations of the singularities. For example, to integrate over the region (a,b) with break-points at x_1, x_2, x_3 (where a < x_1 < x_2 < x_3 < b) the following pts array should be used

pts[0] = a pts[1] = x_1 pts[2] = x_2 pts[3] = x_3 pts[4] = b with npts = 5.

If you know the locations of the singular points in the integration region then this routine will be faster than QAGS.

This function computes the integral of the function f over the infinite interval (-\infty,+\infty). The integral is mapped onto the semi-open interval (0,1] using the transformation x = (1-t)/t,

\int_{-\infty}{+\infty} dx f(x) = \int_01 dt (f((1-t)/t) + f((-1+t)/t))/t2.

It is then integrated using the QAGS algorithm. The normal 21-point Gauss-Kronrod rule of QAGS is replaced by a 15-point rule, because the transformation can generate an integrable singularity at the origin. In this case a lower-order rule is more efficient.

This function computes the integral of the function f over the semi-infinite interval (a,+\infty). The integral is mapped onto the semi-open interval (0,1] using the transformation x = a + (1-t)/t,

\int_{a}{+\infty} dx f(x) = \int_01 dt f(a + (1-t)/t)/t2

and then integrated using the QAGS algorithm.

This function computes the integral of the function f over the semi-infinite interval (-\infty,b). The integral is mapped onto the semi-open interval (0,1] using the transformation x = b - (1-t)/t,

\int_{-\infty}{b} dx f(x) = \int_01 dt f(b - (1-t)/t)/t2

and then integrated using the QAGS algorithm.

This function computes the Cauchy principal value of the integral of f over (a,b), with a singularity at c,

I = \int_ab dx f(x) / (x - c)

The adaptive bisection algorithm of QAG is used, with modifications to ensure that subdivisions do not occur at the singular point x = c. When a subinterval contains the point x = c or is close to it then a special 25-point modified Clenshaw-Curtis rule is used to control the singularity. Further away from the singularity the algorithm uses an ordinary 15-point Gauss-Kronrod integration rule.

Trait Implementations

impl Drop for IntegrationWorkspace
[src]

A method called when the value goes out of scope. Read more