Expand description
Numerical integration using the Gauss-Hermite quadrature rule.
This rule can integrate integrands of the form
e^(-x^2) * f(x)
over the domain (-∞, ∞).
§Example
Integrate x^2 * e^(-x^2)
use gauss_quad::hermite::GaussHermite;
use approx::assert_abs_diff_eq;
let quad = GaussHermite::new(10)?;
let integral = quad.integrate(|x| x.powi(2));
assert_abs_diff_eq!(integral, core::f64::consts::PI.sqrt() / 2.0, epsilon = 1e-14);
Structs§
- A Gauss-Hermite quadrature scheme.
- The error returned by
GaussHermite::new
if it is given a degree of 0 or 1. - An owning iterator over the node-weight pairs of the quadrature rule.
- An iterator over the node-weight pairs of the quadrature rule.
- An iterator over the nodes of the quadrature rule.
- An iterator over the weights of the quadrature rule.