[][src]Struct stats::Unsorted

pub struct Unsorted<T> { /* fields omitted */ }

A commutative data structure for lazily sorted sequences of data.

The sort does not occur until statistics need to be computed.

Note that this works on types that do not define a total ordering like f32 and f64. When an ordering is not defined, an arbitrary order is returned.

Methods

impl<T: PartialOrd> Unsorted<T>[src]

pub fn new() -> Unsorted<T>[src]

Create initial empty state.

pub fn add(&mut self, v: T)[src]

Add a new element to the set.

pub fn len(&self) -> usize[src]

Return the number of data points.

impl<T: PartialOrd + Eq + Clone> Unsorted<T>[src]

pub fn cardinality(&mut self) -> usize[src]

impl<T: PartialOrd + Clone> Unsorted<T>[src]

pub fn mode(&mut self) -> Option<T>[src]

Returns the mode of the data.

pub fn modes(&mut self) -> Vec<T>[src]

Returns the modes of the data.

impl<T: PartialOrd + ToPrimitive> Unsorted<T>[src]

pub fn median(&mut self) -> Option<f64>[src]

Returns the median of the data.

Trait Implementations

impl<T: Clone> Clone for Unsorted<T>[src]

impl<T: PartialOrd> Commute for Unsorted<T>[src]

impl<T: PartialOrd> Default for Unsorted<T>[src]

impl<T: PartialOrd> Extend<T> for Unsorted<T>[src]

impl<T: PartialOrd> FromIterator<T> for Unsorted<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Unsorted<T> where
    T: RefUnwindSafe

impl<T> Send for Unsorted<T> where
    T: Send

impl<T> Sync for Unsorted<T> where
    T: Sync

impl<T> Unpin for Unsorted<T> where
    T: Unpin

impl<T> UnwindSafe for Unsorted<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.