pub struct Rule { /* private fields */ }Expand description
A one-dimensional Gauss-Kronrod integration rule.
A Gaussian numerical integration rule approximates an integral of a function by performing a weighted sum of the function evaluated at defined points/abscissae. The order of an integration rule, $n$, denotes the number of abscissae, $x_{i}$, at which the function is evaluated and the number of weights $w_{i}$ for the weighted sum, such that the approximation is, $$ I = \int_{b}^{a} f(x) dx \approx \sum_{i = 1}^{n} W_{i} f(X_{i}) = I_{n} $$ where the $X_{i}$ and $W_{i}$ are the rescaled abscissae and weights, $$ X_{i} = \frac{b + a + (a - b) x_{i}}{2} ~~~~~~~~ W_{i} = \frac{(a - b) w_{i}}{2} $$ A Gauss-Kronrod integration rule combines two rules of different order for efficient estimation of the numerical error. The rules for an $n$-point Gauss-Kronrod rule contain $m = (n - 1) / 2$ abscissae shared by the Gaussian and Kronrod rules and an extended set of $n - m$ Kronrod abscissae. The weighted sum of the full set of $n$ Kronrod function evaluations are used to approximate the result of the integration, while the weighted sum of the lower order set of $m$ Gaussian points are used to calculate the numerical error in the routine, $$ E = |I_{n} - I_{m}| $$ This approach is efficient, as only $n$ total function evaluations are required to obtain the result approximation and error estimate.
The Rule struct defines a Gauss-Kronrod quadrature rule for use in the one-dimensional
numerical integration routines Basic, Adaptive, and AdaptiveSingularity. Rules of varying
order $n$ are generated through dedicated constructor functions Rule::gk*.
Implementations§
Source§impl Rule
Constructors
impl Rule
Constructors
Sourcepub const fn gk15() -> Self
pub const fn gk15() -> Self
15-point Gauss-Kronrod rule
Generates the evaluation points/abscissae $x_{i}$ and weights $w_{i}$ for a 15-point Gauss-Kronrod integration rule.
Sourcepub const fn gk21() -> Self
pub const fn gk21() -> Self
21-point Gauss-Kronrod rule
Generates the evaluation points/abscissae $x_{i}$ and weights $w_{i}$ for a 21-point Gauss-Kronrod integration rule.
Sourcepub const fn gk31() -> Self
pub const fn gk31() -> Self
31-point Gauss-Kronrod rule
Generates the evaluation points/abscissae $x_{i}$ and weights $w_{i}$ for a 31-point Gauss-Kronrod integration rule.
Sourcepub const fn gk41() -> Self
pub const fn gk41() -> Self
41-point Gauss-Kronrod rule
Generates the evaluation points/abscissae $x_{i}$ and weights $w_{i}$ for a 41-point Gauss-Kronrod integration rule.