Struct stats::Unsorted [] [src]

pub struct Unsorted<T> {
    // some 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]

fn new() -> Unsorted<T>

Create initial empty state.

fn add(&mut self, v: T)

Add a new element to the set.

fn len(&self) -> usize

Return the number of data points.

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

fn cardinality(&mut self) -> usize

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

fn mode(&mut self) -> Option<T>

Returns the mode of the data.

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

fn median(&mut self) -> Option<f64>

Returns the median of the data.

Trait Implementations

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

fn clone(&self) -> Unsorted<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

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

fn merge(&mut self, v: Unsorted<T>)

Merges the value other into self.

fn consume<I: Iterator<Item=Self>>(&mut self, other: I)

Merges the values in the iterator into self.

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

fn default() -> Unsorted<T>

Returns the "default value" for a type. Read more

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

fn from_iter<I: IntoIterator<Item=T>>(it: I) -> Unsorted<T>

Creates a value from an iterator. Read more

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

fn extend<I: IntoIterator<Item=T>>(&mut self, it: I)

Extends a collection with the contents of an iterator. Read more