pub struct Pcg64Dxsm { /* private fields */ }Expand description
PCG64DXSM (DXSM output function) pseudo-random number generator.
128-bit linear congruential generator with the DXSM (double-xorshift
multiply) output function. Period 2^128. Recommended over the
classic XSL-RR Pcg64 for new applications because the DXSM
permutation has stronger empirical bit-level randomness.
Trait Implementations§
Source§impl BitGenerator for Pcg64Dxsm
impl BitGenerator for Pcg64Dxsm
Source§fn state_bytes(&self) -> Result<Vec<u8>, FerrayError>
fn state_bytes(&self) -> Result<Vec<u8>, FerrayError>
Serialize the full internal state of this generator to a
little-endian byte vector. Pair with [
set_state_bytes] to
restore. Read moreSource§fn set_state_bytes(&mut self, bytes: &[u8]) -> Result<(), FerrayError>
fn set_state_bytes(&mut self, bytes: &[u8]) -> Result<(), FerrayError>
Restore the generator’s state from previously-serialized bytes
produced by [
state_bytes]. Read moreSource§fn seed_from_u64(seed: u64) -> Self
fn seed_from_u64(seed: u64) -> Self
Create a new generator seeded from a single
u64.Source§fn jump(&mut self) -> Option<()>
fn jump(&mut self) -> Option<()>
Advance the generator state by a large step (2^128 for Xoshiro256**). Read more
Source§fn stream(_seed: u64, _stream_id: u64) -> Option<Self>
fn stream(_seed: u64, _stream_id: u64) -> Option<Self>
Create a new generator from a seed and a stream ID. Read more
Source§fn fill_bytes(&mut self, dest: &mut [u8])
fn fill_bytes(&mut self, dest: &mut [u8])
Fill a byte slice with random bytes.
Source§fn next_u64_bounded(&mut self, bound: u64) -> u64
fn next_u64_bounded(&mut self, bound: u64) -> u64
Generate a
u64 in the range [0, bound) using rejection sampling.Auto Trait Implementations§
impl Freeze for Pcg64Dxsm
impl RefUnwindSafe for Pcg64Dxsm
impl Send for Pcg64Dxsm
impl Sync for Pcg64Dxsm
impl Unpin for Pcg64Dxsm
impl UnsafeUnpin for Pcg64Dxsm
impl UnwindSafe for Pcg64Dxsm
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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