Skip to main content

IntegrationOutput

Trait IntegrationOutput 

Source
pub trait IntegrationOutput<S>: Clone + Default {
    type Float: IntegrableFloat;

    // Required methods
    fn add(&self, other: &Self) -> Self;
    fn sub(&self, other: &Self) -> Self;
    fn mul_scalar(&self, scalar: &S) -> Self;
    fn modulus(&self) -> Self::Float;
    fn is_finite(&self) -> bool;
    fn max_component(&self) -> Self::Float;
    fn mean_component(&self) -> Self::Float;

    // Provided method
    fn reduce_error(&self, mode: ErrorNorm) -> Self::Float { ... }
}
Expand description

Type that can be used as an integrand output.

The integrator forms linear combinations of integrand outputs using scalar weights from the integration domain. Therefore an output must support addition, subtraction, multiplication by its scalar type, and division by its scalar type.

IntegrationOutput also provides scalar diagnostics:

  • modulus, used for absolute integral estimates,
  • is_finite, used to detect invalid integrand values,
  • reduce_error, used to convert an output-valued local error estimate into a scalar adaptive error.

§Associated types

  • Float: underlying real floating-point type.

Required Associated Types§

Source

type Float: IntegrableFloat

Underlying real floating-point type.

Required Methods§

Source

fn add(&self, other: &Self) -> Self

Source

fn sub(&self, other: &Self) -> Self

Source

fn mul_scalar(&self, scalar: &S) -> Self

Source

fn modulus(&self) -> Self::Float

Returns a scalar magnitude for this output.

For scalar outputs this is the absolute value or complex modulus. For array-like outputs this should return a norm-like aggregate magnitude.

Source

fn is_finite(&self) -> bool

Returns false if this output contains NaN or infinity.

Source

fn max_component(&self) -> Self::Float

Returns the largest component magnitude.

Source

fn mean_component(&self) -> Self::Float

Returns the mean component magnitude.

Provided Methods§

Source

fn reduce_error(&self, mode: ErrorNorm) -> Self::Float

Reduces this output to a scalar error according to mode.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IntegrationOutput<Complex<f32>> for Complex<f32>

Source§

type Float = f32

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn mul_scalar(&self, scalar: &Complex<f32>) -> Self

Source§

fn modulus(&self) -> Self::Float

Source§

fn is_finite(&self) -> bool

Source§

fn max_component(&self) -> Self::Float

Source§

fn mean_component(&self) -> Self::Float

Source§

impl IntegrationOutput<Complex<f64>> for Complex<f64>

Source§

type Float = f64

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn mul_scalar(&self, scalar: &Complex<f64>) -> Self

Source§

fn modulus(&self) -> Self::Float

Source§

fn is_finite(&self) -> bool

Source§

fn max_component(&self) -> Self::Float

Source§

fn mean_component(&self) -> Self::Float

Source§

impl IntegrationOutput<f32> for Complex<f32>

Source§

type Float = f32

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn mul_scalar(&self, scalar: &f32) -> Self

Source§

fn modulus(&self) -> Self::Float

Source§

fn is_finite(&self) -> bool

Source§

fn max_component(&self) -> Self::Float

Source§

fn mean_component(&self) -> Self::Float

Source§

impl IntegrationOutput<f32> for f32

Source§

type Float = f32

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn mul_scalar(&self, scalar: &f32) -> Self

Source§

fn modulus(&self) -> Self::Float

Source§

fn is_finite(&self) -> bool

Source§

fn max_component(&self) -> Self::Float

Source§

fn mean_component(&self) -> Self::Float

Source§

impl IntegrationOutput<f64> for Complex<f64>

Source§

type Float = f64

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn mul_scalar(&self, scalar: &f64) -> Self

Source§

fn modulus(&self) -> Self::Float

Source§

fn is_finite(&self) -> bool

Source§

fn max_component(&self) -> Self::Float

Source§

fn mean_component(&self) -> Self::Float

Source§

impl IntegrationOutput<f64> for f64

Source§

type Float = f64

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn mul_scalar(&self, scalar: &f64) -> Self

Source§

fn modulus(&self) -> Self::Float

Source§

fn is_finite(&self) -> bool

Source§

fn max_component(&self) -> Self::Float

Source§

fn mean_component(&self) -> Self::Float

Implementors§