Trait SummaryStatistics

Source
pub trait SummaryStatistics {
    type Item: FromPrimitive;
    type Output: NumOps<Self::Item>;

    // Required methods
    fn len(&self) -> usize;
    fn product(&self) -> Self::Output;
    fn sum(&self) -> Self::Output;
    fn std(&self) -> Self::Output;
    fn var(&self) -> Self::Output;

    // Provided methods
    fn elems(&self) -> Self::Item { ... }
    fn is_empty(&self) -> bool { ... }
    fn mean(&self) -> Self::Output { ... }
}
Expand description

This trait describes the fundamental methods of summary statistics. These include the mean, standard deviation, variance, and more.

Required Associated Types§

Required Methods§

Source

fn len(&self) -> usize

returns the number of elements in the iterator

Source

fn product(&self) -> Self::Output

returns the number of elements in the iterator as an Item type.

Source

fn sum(&self) -> Self::Output

returns the sum of the iterator

Source

fn std(&self) -> Self::Output

returns the standard deviation of the iterator

Source

fn var(&self) -> Self::Output

returns the variance of the iterator

Provided Methods§

Source

fn elems(&self) -> Self::Item

returns the number of elements in the iterator as an Item type.

Source

fn is_empty(&self) -> bool

returns true if the iterator is empty

Source

fn mean(&self) -> Self::Output

returns the mean of the iterator

Implementations on Foreign Types§

Source§

impl<A, S, D> SummaryStatistics for ArrayBase<S, D>
where A: Copy + FromPrimitive + Num + Pow<i32, Output = A> + Product + Root<Output = A> + Sum, D: Dimension, S: Data<Elem = A>, &'a A: for<'a> Product,

Source§

impl<T> SummaryStatistics for [T]
where T: FromPrimitive + Num + Pow<i32, Output = T> + Product + Root<Output = T> + Copy + Sum,

Source§

impl<T> SummaryStatistics for Vec<T>
where T: FromPrimitive + Num + Pow<i32, Output = T> + Product + Root<Output = T> + Copy + Sum,

Source§

impl<T, I> SummaryStatistics for &I
where I: ExactSizeIterator<Item = T> + Clone, T: Copy + FromPrimitive + Num + Pow<i32, Output = T> + Product + Root<Output = T> + Sum,

Implementors§