pub struct MT19937 { /* private fields */ }Expand description
MT19937-64 Mersenne Twister BitGenerator.
Period 2^19937 - 1. The jump operation is not implemented for the
64-bit Mersenne Twister in this crate; the standard polynomial-jump
table is large and not required for the typical use case.
Trait Implementations§
Source§impl BitGenerator for MT19937
impl BitGenerator for MT19937
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 MT19937
impl RefUnwindSafe for MT19937
impl Send for MT19937
impl Sync for MT19937
impl Unpin for MT19937
impl UnsafeUnpin for MT19937
impl UnwindSafe for MT19937
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