Struct average::Min [] [src]

pub struct Min { /* fields omitted */ }

Estimate the minimum of a sequence of numbers ("population").

Example

use average::Min;

let a: Min = (1..6).map(Into::into).collect();
println!("The minimum is {}.", a.min());

Methods

impl Min
[src]

[src]

Create a new minium estimator from a given value.

[src]

Create a new minimum estimator.

[src]

Estimate the minium of the population.

Trait Implementations

impl Debug for Min
[src]

[src]

Formats the value using the given formatter.

impl Clone for Min
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Min
[src]

[src]

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

impl FromIterator<f64> for Min
[src]

[src]

Creates a value from an iterator. Read more

impl Estimate for Min
[src]

[src]

Add an observation sampled from the population.

[src]

Estimate the statistic of the population.

impl Merge for Min
[src]

[src]

Merge another sample into this one.

Example

use average::{Min, Merge};

let sequence: &[f64] = &[1., 2., 3., 4., 5., 6., 7., 8., 9.];
let (left, right) = sequence.split_at(3);
let min_total: Min = sequence.iter().map(|x| *x).collect();
let mut min_left: Min = left.iter().map(|x| *x).collect();
let min_right: Min = right.iter().map(|x| *x).collect();
min_left.merge(&min_right);
assert_eq!(min_total.min(), min_left.min());