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§
Sourcetype Float: IntegrableFloat
type Float: IntegrableFloat
Underlying floating-point type used by the integrator.
Sourcetype Input: ComplexField<RealField = Self::Float> + Copy
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.
Required Methods§
Sourcefn integrand(&self, input: &Self::Input) -> Self::Output
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".