pub struct Simpson13Engine { /* private fields */ }Expand description
The composite Simpson’s 1/3 rule on n equally spaced points (n − 1 panels of width
h = (b − a)/(n − 1)): weights h/3 · (1, 4, 2, 4, …, 2, 4, 1).
Fourth order (the rule minus the integral is (b − a) h⁴ f⁽⁴⁾(ξ) / 180) and exact for cubics. The 1/3 rule needs an
even number of panels; with an odd number, the last three panels use Simpson’s 3/8 rule so the
result stays fourth order. Two points fall back to the trapezoid rule.
Implementations§
Source§impl Simpson13Engine
impl Simpson13Engine
Sourcepub fn new(
number_of_points: usize,
lower_bound: f64,
upper_bound: f64,
cache_x_points: bool,
) -> Self
pub fn new( number_of_points: usize, lower_bound: f64, upper_bound: f64, cache_x_points: bool, ) -> Self
An engine using number_of_points samples on [lower_bound, upper_bound]. With
cache_x_points, the sample points are computed once and reused by every call to
integrate.
Sourcepub fn set_number_of_points(&mut self, x: usize)
pub fn set_number_of_points(&mut self, x: usize)
Changes the number of samples (refreshing the cache, if enabled).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Simpson13Engine
impl RefUnwindSafe for Simpson13Engine
impl Send for Simpson13Engine
impl Sync for Simpson13Engine
impl Unpin for Simpson13Engine
impl UnsafeUnpin for Simpson13Engine
impl UnwindSafe for Simpson13Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more