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§
Sourcefn terms(&self) -> usize
fn terms(&self) -> usize
Returns the number of individual functions that are terms of the summation.
Sourcefn term_value(&self, position: &[f64], term: usize) -> f64
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§
Sourcefn partial_value<T: IntoIterator<Item = I>, I: Borrow<usize>>(
&self,
position: &[f64],
terms: T,
) -> f64
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.