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.);

Implementations

impl Max[src]

pub fn from_value(x: f64) -> Max[src]

Create a new maxium estimator from a given value.

pub fn new() -> Max[src]

Create a new maximum estimator.

pub fn max(&self) -> f64[src]

Estimate the maxium of the population.

Trait Implementations

impl Clone for Max[src]

impl Debug for Max[src]

impl Default for Max[src]

impl<'de> Deserialize<'de> for Max[src]

impl Estimate for Max[src]

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

impl FromIterator<f64> for Max[src]

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

impl FromParallelIterator<f64> for Max[src]

impl Merge for Max[src]

fn merge(&mut self, other: &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());

impl Serialize for Max[src]

Auto Trait Implementations

impl RefUnwindSafe for Max

impl Send for Max

impl Sync for Max

impl Unpin for Max

impl UnwindSafe for Max

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<S, T> Cast<T> for S where
    T: Conv<S>, 
[src]

impl<S, T> CastFloat<T> for S where
    T: ConvFloat<S>, 
[src]

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.