Skip to main content

Integrable

Trait Integrable 

Source
pub trait Integrable {
    type Float: IntegrableFloat;
    type Input: ComplexField<RealField = Self::Float> + Copy;
    type Output: Clone;

    // Required method
    fn integrand(&self, input: &Self::Input) -> Self::Output;
}
Expand description

Function-like object that can be numerically integrated.

An Integrable defines:

  • the scalar type used internally by the integrator (Float),
  • the input domain (Input),
  • the output type (Output),

together with a method for evaluating the integrand.

§Associated types

  • Float: underlying floating-point type.
  • Input: integration domain. This may be real or complex.
  • Output: value returned by the integrand.

§Examples

A real-valued function:

f : ℝ → ℝ

A contour integrand:

f : ℂ → ℂ

A vector-valued integrand:

f : ℝ → ℝⁿ

Required Associated Types§

Source

type Float: IntegrableFloat

Underlying floating-point type used by the integrator.

Source

type Input: ComplexField<RealField = Self::Float> + Copy

Input domain of the integrand.

This may be a real scalar such as f64 or a complex scalar used for contour integration.

Source

type Output: Clone

Output of the integrand.

This may be a scalar, complex scalar, vector, matrix, or other type implementing [IntegrationOutput].

Required Methods§

Source

fn integrand(&self, input: &Self::Input) -> Self::Output

Evaluates the integrand at input.

This method performs no validation and may return non-finite values. Integrators should generally call checked_integrand instead unless they explicitly wish to handle invalid values themselves.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§