[−][src]Struct randomize::PCG32
A permuted congruential generator with 32-bit output. Pick this by default.
Fields
state: u64
State value. Changes with every use.
inc: u64
Inc value. Selects the output stream ordering.
This doesn't change as the generator is used. You just set it and forget
it. If this value isn't odd, your generator won't have a full period
before it loops. The seed constructor will ensure that the
inc
value is set to be odd, but the From
constructors will not.
Methods
impl PCG32
[src]
pub const fn seed(seed: u64, inc: u64) -> Self
[src]
Crates a generator from the seed and inc given.
The precise seeding details are not considered a "stable" part of the API.
If you wish to exactly create a generator using particular state
and
inc
values then use the From
impl.
pub fn next_u32(&mut self) -> u32
[src]
Runs the generator once and gets a u32
as output.
pub fn fill_bytes(&mut self, bytes: &mut [u8])
[src]
Fill a mutable byte slice from this generator.
pub fn jump(&mut self, delta: u64)
[src]
Advances the generator delta
steps in log(delta)
time.
Trait Implementations
impl Debug for PCG32
[src]
impl PartialEq<PCG32> for PCG32
[src]
impl Eq for PCG32
[src]
impl Hash for PCG32
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl From<[u64; 2]> for PCG32
[src]
impl From<(u64, u64)> for PCG32
[src]
impl From<PCG32> for [u64; 2]
[src]
impl From<PCG32> for (u64, u64)
[src]
impl Clone for PCG32
[src]
fn clone(&self) -> PCG32
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for PCG32
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,