pub trait CanIntegrate1D {
// Required methods
fn set_lower_bound(&mut self, x: f64);
fn set_upper_bound(&mut self, x: f64);
fn integrate<F>(&self, f: F) -> Result<f64, ErrorsJSL>
where F: Fn(f64) -> f64;
}Expand description
A one-dimensional quadrature rule on an interval [a, b], approximating ∫ₐᵇ f(x) dx.
Engines are configured at construction (number of points, tolerance, …); the bounds can be changed afterwards, so one engine can be reused across many integrals. See the book’s numerical integration chapter for how to choose an engine.
Required Methods§
Sourcefn set_lower_bound(&mut self, x: f64)
fn set_lower_bound(&mut self, x: f64)
Sets the lower bound a.
Sourcefn set_upper_bound(&mut self, x: f64)
fn set_upper_bound(&mut self, x: f64)
Sets the upper bound b.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".