pub struct AugRng { /* private fields */ }Expand description
A simple deterministic Linear Congruential Generator (LCG) RNG.
This is intentionally lightweight and avoids pulling in the rand crate.
Constants follow Knuth’s MMIX multiplier.
Implementations§
Source§impl AugRng
impl AugRng
Sourcepub fn next_normal(&mut self) -> f64
pub fn next_normal(&mut self) -> f64
Standard normal sample via Box-Muller transform.
Sourcepub fn next_usize(&mut self, max: usize) -> usize
pub fn next_usize(&mut self, max: usize) -> usize
Uniform integer in [0, max).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AugRng
impl RefUnwindSafe for AugRng
impl Send for AugRng
impl Sync for AugRng
impl Unpin for AugRng
impl UnsafeUnpin for AugRng
impl UnwindSafe for AugRng
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more