Struct average::Max [−][src]
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]
fn from_iter<T>(iter: T) -> Max where
T: IntoIterator<Item = &'a f64>, [src]
T: IntoIterator<Item = &'a f64>,
impl FromIterator<f64> for Max[src]
fn from_iter<T>(iter: T) -> Max where
T: IntoIterator<Item = f64>, [src]
T: IntoIterator<Item = f64>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<S, T> Cast<T> for S where
T: Conv<S>, [src]
T: Conv<S>,
impl<S, T> CastFloat<T> for S where
T: ConvFloat<S>, [src]
T: ConvFloat<S>,
pub fn cast_trunc(self) -> T[src]
pub fn cast_nearest(self) -> T[src]
pub fn cast_floor(self) -> T[src]
pub fn cast_ceil(self) -> T[src]
impl<T> Conv<T> for T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,