pub struct Max { /* private fields */ }
Expand description
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§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Max
impl<'de> Deserialize<'de> for Max
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> FromIterator<&'a f64> for Max
impl<'a> FromIterator<&'a f64> for Max
source§impl FromIterator<f64> for Max
impl FromIterator<f64> for Max
source§impl<'a> FromParallelIterator<&'a f64> for Max
Available on crate feature rayon
only.
impl<'a> FromParallelIterator<&'a f64> for Max
Available on crate feature
rayon
only.source§fn from_par_iter<I>(par_iter: I) -> Max
fn from_par_iter<I>(par_iter: I) -> Max
Creates an instance of the collection from the parallel iterator
par_iter
. Read moresource§impl FromParallelIterator<f64> for Max
Available on crate feature rayon
only.
impl FromParallelIterator<f64> for Max
Available on crate feature
rayon
only.source§fn from_par_iter<I>(par_iter: I) -> Max
fn from_par_iter<I>(par_iter: I) -> Max
Creates an instance of the collection from the parallel iterator
par_iter
. Read moresource§impl Merge for Max
impl Merge for Max
source§fn merge(&mut self, other: &Max)
fn merge(&mut self, other: &Max)
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 Freeze for Max
impl RefUnwindSafe for Max
impl Send for Max
impl Sync for Max
impl Unpin for Max
impl UnwindSafe for Max
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more