irox_stats::streaming

Trait StreamingStatistic

Source
pub trait StreamingStatistic {
    type Type;

    // Required methods
    fn add_sample(&mut self, sample: Self::Type) -> Self::Type;
    fn get_last_sample(&self) -> Self::Type;
    fn get_last_result(&self) -> Self::Type;
    fn get_num_samples(&self) -> u64;
}
Expand description

A statistic type that can be incrementally calculated after each sample is added. Does not necessarily have to have the full set of data available to it, and as such, should be fast.

Required Associated Types§

Required Methods§

Source

fn add_sample(&mut self, sample: Self::Type) -> Self::Type

adds a sample to this streaming statistic, returning a result of the operation.

Source

fn get_last_sample(&self) -> Self::Type

Returns a copy of the last sample added

Source

fn get_last_result(&self) -> Self::Type

Returns the last value returned by ‘add_sample’

Source

fn get_num_samples(&self) -> u64

Returns the total number of samples pushed in

Implementors§

Source§

impl<T> StreamingStatistic for BiasedStandardDeviation<T>
where T: Sub<T, Output = T> + Copy + Default + Div<f64, Output = T> + Add<T, Output = T> + Mul<f64, Output = T> + Mul<T, Output = T> + FloatExt<Type = T>,

Source§

type Type = T

Source§

impl<T> StreamingStatistic for BiasedVariance<T>
where T: Sub<T, Output = T> + Copy + Default + Div<f64, Output = T> + Add<T, Output = T> + Mul<f64, Output = T> + Mul<T, Output = T>,

Source§

type Type = T

Source§

impl<T> StreamingStatistic for Max<T>
where T: PartialOrd + Copy + Default,

Source§

type Type = T

Source§

impl<T> StreamingStatistic for Min<T>
where T: PartialOrd + Copy + Default,

Source§

type Type = T

Source§

impl<T> StreamingStatistic for UnbiasedStandardDeviation<T>
where T: Sub<T, Output = T> + Copy + Default + Div<f64, Output = T> + Add<T, Output = T> + Mul<f64, Output = T> + Mul<T, Output = T> + FloatExt<Type = T>,

Source§

type Type = T

Source§

impl<T> StreamingStatistic for UnbiasedVariance<T>
where T: Sub<T, Output = T> + Copy + Default + Div<f64, Output = T> + Add<T, Output = T> + Mul<f64, Output = T> + Mul<T, Output = T>,

Source§

type Type = T

Source§

impl<Type> StreamingStatistic for Mean<Type>
where Type: Sub<Type, Output = Type> + Copy + Div<f64, Output = Type> + Add<Type, Output = Type> + Default,

Source§

type Type = Type

Source§

impl<Type> StreamingStatistic for UnweightedSumOfSquares<Type>
where Type: Sub<Type, Output = Type> + Copy + Default + Div<f64, Output = Type> + Add<Type, Output = Type> + Mul<f64, Output = Type> + Mul<Type, Output = Type>,

Source§

type Type = Type