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§
sourcefn sample_subset_without_replacement<'s: 'a>(
&'s self,
size: usize
) -> Result<O, String>
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