pub struct Xoroshiro {
seed_lo: u64,
seed_hi: u64,
next_gaussian: Option<f64>,
}Expand description
A Xoroshiro128++ random number generator.
Fields§
§seed_lo: u64§seed_hi: u64§next_gaussian: Option<f64>Implementations§
Source§impl Xoroshiro
impl Xoroshiro
Sourcepub const fn from_seed_unmixed(seed: u64) -> Self
pub const fn from_seed_unmixed(seed: u64) -> Self
Creates a new Xoroshiro from a seed without mixing.
const fn new(lo: u64, hi: u64) -> Self
const fn upgrade_seed_to_128_bit(seed: u64) -> (u64, u64)
const fn next(&mut self, bits: u64) -> u64
const fn next_random(&mut self) -> u64
Trait Implementations§
Source§impl From<Xoroshiro> for RandomSource
impl From<Xoroshiro> for RandomSource
Source§fn from(v: Xoroshiro) -> RandomSource
fn from(v: Xoroshiro) -> RandomSource
Converts to this type from the input type.
Source§impl MarsagliaPolarGaussian for Xoroshiro
impl MarsagliaPolarGaussian for Xoroshiro
Source§fn stored_next_gaussian(&self) -> Option<f64>
fn stored_next_gaussian(&self) -> Option<f64>
Gets the stored next gaussian.
Source§fn set_stored_next_gaussian(&mut self, value: Option<f64>)
fn set_stored_next_gaussian(&mut self, value: Option<f64>)
Sets the stored next gaussian.
Source§fn calculate_gaussian(&mut self) -> f64
fn calculate_gaussian(&mut self) -> f64
Calculates the next gaussian.
Source§impl Random for Xoroshiro
impl Random for Xoroshiro
fn fork(&mut self) -> Self
fn next_i32(&mut self) -> i32
fn next_i32_bounded(&mut self, bound: i32) -> i32
fn next_i64(&mut self) -> i64
fn next_f32(&mut self) -> f32
fn next_f64(&mut self) -> f64
fn next_bool(&mut self) -> bool
fn next_gaussian(&mut self) -> f64
fn next_positional(&mut self) -> RandomSplitter
fn next_i32_between(&mut self, min: i32, max: i32) -> i32
fn next_i32_between_exclusive(&mut self, min: i32, max: i32) -> i32
fn triangle(&mut self, min: f64, max: f64) -> f64
fn triangle_f32(&mut self, min: f32, max: f32) -> f32
fn consume_count(&mut self, count: i32)
Auto Trait Implementations§
impl Freeze for Xoroshiro
impl RefUnwindSafe for Xoroshiro
impl Send for Xoroshiro
impl Sync for Xoroshiro
impl Unpin for Xoroshiro
impl UnsafeUnpin for Xoroshiro
impl UnwindSafe for Xoroshiro
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