Struct histogram_sampler::Sampler
source · pub struct Sampler { /* private fields */ }
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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Sampler
impl Send for Sampler
impl Sync for Sampler
impl Unpin for Sampler
impl UnwindSafe for Sampler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more