pub struct WeightedU64Index { /* private fields */ }Expand description
Compatibility weighted sampler for u64 numbers
Sampler uses provided rand::Rng reference to generate random u64 numbers and
map them to the index of the weight from weights vector provided on initialization.
This utility exists only to provide compatibility of sampling algorithm with rand
library at versions <=0.8.5, since parts of the system rely on reproducible sequence
of numbers given stable seeded random number generator.
The algorithm reproduces indices returned by rand::distributions::WeightedIndex
for the same weights vector and seeded random number generator.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WeightedU64Index
impl RefUnwindSafe for WeightedU64Index
impl Send for WeightedU64Index
impl Sync for WeightedU64Index
impl Unpin for WeightedU64Index
impl UnsafeUnpin for WeightedU64Index
impl UnwindSafe for WeightedU64Index
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more