pub struct Max { /* fields omitted */ }
Estimate the maximum of a sequence of numbers ("population").
use average::Max;
let a: Max = (1..6).map(f64::from).collect();
assert_eq!(a.max(), 5.);
Create a new maxium estimator from a given value.
Create a new maximum estimator.
Estimate the maxium of the population.
Add an observation sampled from the population.
Estimate the statistic of the population.
Merge another sample into this one.
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());
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
Returns the "default value" for a type. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Approximate the subject to a given type with the default scheme.
Approximate the subject to a given type with a specific scheme.
Convert the subject to a given type.
Attempt to convert the subject to a given type.
Attempt a value conversion of the subject to a given type.
The error type produced by a failed conversion.
Convert the subject into an approximately equivalent representation.
The error type produced by a failed conversion.
Convert the subject into an exactly equivalent representation.
The error type produced by a failed conversion.
Convert the given value into an exactly equivalent representation.
The error type produced by a failed conversion.
Convert the given value into an approximately equivalent representation.
Approximate the subject with the default scheme.
Approximate the subject with a specific scheme.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
The error type produced by a failed conversion.
Convert the given value into the subject type.
The error type produced by a failed conversion.
Convert the subject into the destination type.