pub struct Rng { /* private fields */ }Expand description
Pseudo-random number generator (xoshiro256**) with fixed seed.
Implementations§
Source§impl Rng
impl Rng
Sourcepub fn next_usize(&mut self, n: usize) -> usize
pub fn next_usize(&mut self, n: usize) -> usize
Generates a uniform index in [0, n).
Sourcepub fn normal_params(&mut self, mu: f64, sigma: f64) -> f64
pub fn normal_params(&mut self, mu: f64, sigma: f64) -> f64
Generates a normal sample with parameters (mu, sigma).
Sourcepub fn fill_uniform(&mut self, buf: &mut [f64])
pub fn fill_uniform(&mut self, buf: &mut [f64])
Fills buf with uniform values in [0, 1).
Sourcepub fn fill_normal(&mut self, buf: &mut [f64])
pub fn fill_normal(&mut self, buf: &mut [f64])
Fills buf with standard normal values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rng
impl RefUnwindSafe for Rng
impl Send for Rng
impl Sync for Rng
impl Unpin for Rng
impl UnsafeUnpin for Rng
impl UnwindSafe for Rng
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