Struct tango_bench::Summary
source · pub struct Summary<T> {
pub n: usize,
pub min: T,
pub max: T,
pub mean: f64,
pub variance: f64,
}Expand description
Statistical summary for a given iterator of numbers.
Calculates all the information using single pass over the data. Mean and variance are calculated using streaming algorithm described in [1].
[1]: Art of Computer Programming, Vol 2, page 232
Fields§
§n: usize§min: T§max: T§mean: f64§variance: f64Implementations§
source§impl<'a, T: PartialOrd + Copy + Default + 'a> Summary<T>
impl<'a, T: PartialOrd + Copy + Default + 'a> Summary<T>
pub fn from<C>(values: C) -> Option<Self>where T: ToPrimitive, C: IntoIterator<Item = &'a T>,
pub fn running<I>(iter: I) -> impl Iterator<Item = Summary<T>>where T: ToPrimitive, I: Iterator<Item = T>,
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Summary<T>where T: RefUnwindSafe,
impl<T> Send for Summary<T>where T: Send,
impl<T> Sync for Summary<T>where T: Sync,
impl<T> Unpin for Summary<T>where T: Unpin,
impl<T> UnwindSafe for Summary<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more