Trait Summation

Source
pub trait Summation: Function {
    // Required methods
    fn terms(&self) -> usize;
    fn term_value(&self, position: &[f64], term: usize) -> f64;

    // Provided method
    fn partial_value<T: IntoIterator<Item = I>, I: Borrow<usize>>(
        &self,
        position: &[f64],
        terms: T,
    ) -> f64 { ... }
}
Expand description

Defines a summation of individual functions, i.e., f(x) = ∑ᵢ fᵢ(x).

Required Methods§

Source

fn terms(&self) -> usize

Returns the number of individual functions that are terms of the summation.

Source

fn term_value(&self, position: &[f64], term: usize) -> f64

Comptues the value of one individual function indentified by its index term, given the position x.

Provided Methods§

Source

fn partial_value<T: IntoIterator<Item = I>, I: Borrow<usize>>( &self, position: &[f64], terms: T, ) -> f64

Computes the partial sum over a set of individual functions identified by terms.

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§