Module gauss_quad::laguerre

source ·
Expand description

Numerical integration using the generalized Gauss-Laguerre quadrature rule.

A Gauss-Laguerre rule of degree n has nodes and weights chosen such that it can integrate polynomials of degree 2n - 1 exactly with the weighing function w(x, alpha) = x^alpha * e^(-x) over the domain [0, ∞).

Examples

use gauss_quad::laguerre::GaussLaguerre;
use approx::assert_abs_diff_eq;

let quad = GaussLaguerre::init(10, 1.0);
let integral = quad.integrate(|x| x.powi(2));
assert_abs_diff_eq!(integral, 6.0, epsilon = 1e-14);

Structs