pub fn gridpts(
r: usize,
mu: f64,
a: f64,
b: f64,
) -> Result<IntegrationGrid, IntegrationError>Expand description
Construct Simpson’s rule grid points for canonical normal integration.
§Errors
Returns IntegrationError::InvalidStencil when r < 2 and
IntegrationError::NonIncreasingBounds when the truncation interval does
not satisfy a < b.
§Examples
use gsdesign::{gridpts, IntegrationError};
let grid = gridpts(5, 0.5, -2.0, 2.0)?;
assert_eq!(grid.points.len(), grid.weights.len());
assert!(grid.weights.iter().all(|w| *w >= 0.0));