Trait SummaryStatistics

Source
pub trait SummaryStatistics
where Self::Item: FromPrimitive, Self::Output: NumOps<Self::Item, Self::Output>,
{ type Item; type Output; // 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>, for<'a> &'a A: Product,

Source§

type Item = A

Source§

type Output = A

Source§

fn len(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Item = T

Source§

type Output = T

Source§

fn len(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Item = T

Source§

type Output = T

Source§

fn len(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Item = T

Source§

type Output = T

Source§

fn len(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§