Struct average::Max[][src]

pub struct Max { /* fields omitted */ }

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

Example

use average::Max;

let a: Max = (1..6).map(f64::from).collect();
assert_eq!(a.max(), 5.);

Methods

impl Max
[src]

Create a new maxium estimator from a given value.

Create a new maximum estimator.

Estimate the maxium of the population.

Trait Implementations

impl Debug for Max
[src]

Formats the value using the given formatter. Read more

impl Clone for Max
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Max
[src]

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

impl FromIterator<f64> for Max
[src]

Creates a value from an iterator. Read more

impl<'a> FromIterator<&'a f64> for Max
[src]

Creates a value from an iterator. Read more

impl Estimate for Max
[src]

Add an observation sampled from the population.

Estimate the statistic of the population.

impl Merge for Max
[src]

Merge another sample into this one.

Example

use average::{Max, Merge};

let sequence: &[f64] = &[1., 2., 3., 4., 5., 6., 7., 8., 9.];
let (left, right) = sequence.split_at(3);
let max_total: Max = sequence.iter().collect();
let mut max_left: Max = left.iter().collect();
let max_right: Max = right.iter().collect();
max_left.merge(&max_right);
assert_eq!(max_total.max(), max_left.max());

Auto Trait Implementations

impl Send for Max

impl Sync for Max