Struct average::Min [−][src]
pub struct Min { /* fields omitted */ }
Estimate the minimum of a sequence of numbers ("population").
Example
use average::Min; let a: Min = (1..6).map(f64::from).collect(); println!("The minimum is {}.", a.min());
Methods
impl Min
[src]
impl Min
pub fn from_value(x: f64) -> Min
[src]
pub fn from_value(x: f64) -> Min
Create a new minium estimator from a given value.
pub fn new() -> Min
[src]
pub fn new() -> Min
Create a new minimum estimator.
pub fn min(&self) -> f64
[src]
pub fn min(&self) -> f64
Estimate the minium of the population.
Trait Implementations
impl Debug for Min
[src]
impl Debug for Min
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Min
[src]
impl Clone for Min
fn clone(&self) -> Min
[src]
fn clone(&self) -> Min
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Default for Min
[src]
impl Default for Min
impl FromIterator<f64> for Min
[src]
impl FromIterator<f64> for Min
fn from_iter<T>(iter: T) -> Min where
T: IntoIterator<Item = f64>,
[src]
fn from_iter<T>(iter: T) -> Min where
T: IntoIterator<Item = f64>,
Creates a value from an iterator. Read more
impl<'a> FromIterator<&'a f64> for Min
[src]
impl<'a> FromIterator<&'a f64> for Min
fn from_iter<T>(iter: T) -> Min where
T: IntoIterator<Item = &'a f64>,
[src]
fn from_iter<T>(iter: T) -> Min where
T: IntoIterator<Item = &'a f64>,
Creates a value from an iterator. Read more
impl Estimate for Min
[src]
impl Estimate for Min
fn add(&mut self, x: f64)
[src]
fn add(&mut self, x: f64)
Add an observation sampled from the population.
fn estimate(&self) -> f64
[src]
fn estimate(&self) -> f64
Estimate the statistic of the population.
impl Merge for Min
[src]
impl Merge for Min
fn merge(&mut self, other: &Min)
[src]
fn merge(&mut self, other: &Min)
Merge another sample into this one.
Example
use average::{Min, Merge}; let sequence: &[f64] = &[1., 2., 3., 4., 5., 6., 7., 8., 9.]; let (left, right) = sequence.split_at(3); let min_total: Min = sequence.iter().collect(); let mut min_left: Min = left.iter().collect(); let min_right: Min = right.iter().collect(); min_left.merge(&min_right); assert_eq!(min_total.min(), min_left.min());