pub struct BenchRng { /* private fields */ }Expand description
A splitmix64 stream. State advances by the golden-ratio constant on every draw; the output is the standard splitmix64 finalizer.
Implementations§
Source§impl BenchRng
impl BenchRng
Sourcepub fn keyed(seed: u64, key: u64) -> Self
pub fn keyed(seed: u64, key: u64) -> Self
Derive an independent stream for (seed, stream index) pairs.
Sourcepub fn below(&mut self, n: u64) -> u64
pub fn below(&mut self, n: u64) -> u64
Uniform integer in 0..n (rejection-free multiply-high; bias is
negligible at our n ≤ 255 and identical on every platform).
Sourcepub fn permutation(&mut self, n: usize) -> Vec<usize>
pub fn permutation(&mut self, n: usize) -> Vec<usize>
Fisher–Yates shuffle of 0..n drawn from this stream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BenchRng
impl RefUnwindSafe for BenchRng
impl Send for BenchRng
impl Sync for BenchRng
impl Unpin for BenchRng
impl UnsafeUnpin for BenchRng
impl UnwindSafe for BenchRng
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