[][src]Struct average::Max

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 Estimate for Max[src]

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

impl FromIterator<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());

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme
[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme
[src]

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

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

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

impl<T, Dst> ConvAsUtil<Dst> for T[src]

impl<T> ConvUtil for T[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<Src> TryFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

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<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 
[src]

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.

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.

impl<Src> ValueFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 
[src]

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.