Struct histogram_sampler::Sampler [−][src]
pub struct Sampler { /* fields omitted */ }
Expand description
Used to sample values according to a histogram distribution.
See crate-level docs for details.
Use like:
let original_data = vec![ (bin, count), ]; let sampler = Sampler::from_bins(original_data, 10 /* bin width */); let mut rng = rand::thread_rng(); use rand::distributions::Distribution; println!("{}", sampler.sample(&mut rng));
Implementations
Report the number of distinct values that can be produced.
Produced samples are guaranteed to be in the range 0..self.nvalues()
.
Trait Implementations
Generate a random value of T
, using rng
as the source of randomness.
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Auto Trait Implementations
impl RefUnwindSafe for Sampler
impl UnwindSafe for Sampler
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V