Trait math::sample::Sample

source ·
pub trait Sample<'a, I: Iterator<Item = E>, E, O: Collecting<E> + Default>: Finite + ToIterator<'a, I, E> {
    // Provided methods
    fn sample_subset_without_replacement<'s: 'a>(
        &'s self,
        size: usize
    ) -> Result<O, String> { ... }
    fn sample_with_replacement<'s: 'a>(
        &'s self,
        size: usize
    ) -> Result<O, String> { ... }
}

Provided Methods§

source

fn sample_subset_without_replacement<'s: 'a>( &'s self, size: usize ) -> Result<O, String>

samples size elements without replacement size: the number of samples to be drawn returns Err if size is larger than the population size

source

fn sample_with_replacement<'s: 'a>(&'s self, size: usize) -> Result<O, String>

Implementations on Foreign Types§

source§

impl<'a, E: Clone> Sample<'a, Iter<'a, E>, &'a E, Vec<E>> for Vec<E>
where &'a E: Deref,

Implementors§