NumericalIntegrator

Trait NumericalIntegrator 

Source
pub trait NumericalIntegrator {
    // Required method
    fn integrate<F>(
        &self,
        f: F,
        a: f64,
        b: f64,
        config: &IntegrationConfig,
    ) -> Result<IntegrationResult, MathError>
       where F: Fn(f64) -> f64;
}
Expand description

Trait for numerical integrators

Required Methods§

Source

fn integrate<F>( &self, f: F, a: f64, b: f64, config: &IntegrationConfig, ) -> Result<IntegrationResult, MathError>
where F: Fn(f64) -> f64,

Integrate a function over an interval

§Arguments
  • f - Function to integrate (as closure)
  • a - Lower bound of integration
  • b - Upper bound of integration
  • config - Integration configuration
§Returns

Integration result with value and error estimate

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§