Type Alias Pcg32

Source
pub type Pcg32 = Lcg64Xsh32;
Expand description

Lcg64Xsh32 is also officially known as pcg32.

Aliased Type§

struct Pcg32 { /* private fields */ }

Implementations

Source§

impl Lcg64Xsh32

Source

pub fn new(state: u64, stream: u64) -> Self

Construct an instance compatible with PCG seed and stream.

Note that PCG specifies default values for both parameters:

  • state = 0xcafef00dd15ea5e5
  • stream = 721347520444481703

Trait Implementations

Source§

impl Clone for Lcg64Xsh32

Source§

fn clone(&self) -> Lcg64Xsh32

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Lcg64Xsh32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RngCore for Lcg64Xsh32

Source§

fn next_u32(&mut self) -> u32

Return the next random u32. Read more
Source§

fn next_u64(&mut self) -> u64

Return the next random u64. Read more
Source§

fn fill_bytes(&mut self, dest: &mut [u8])

Fill dest with random data. Read more
Source§

fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>

Fill dest entirely with random data. Read more
Source§

impl SeedableRng for Lcg64Xsh32

We use a single 127-bit seed to initialise the state and select a stream. One seed bit (lowest bit of seed[8]) is ignored.

Source§

type Seed = [u8; 16]

Seed type, which is restricted to types mutably-dereferencable as u8 arrays (we recommend [u8; N] for some N). Read more
Source§

fn from_seed(seed: Self::Seed) -> Self

Create a new PRNG using the given seed. Read more
Source§

fn seed_from_u64(state: u64) -> Self

Create a new PRNG using a u64 seed. Read more
Source§

fn from_rng<R>(rng: R) -> Result<Self, Error>
where R: RngCore,

Create a new PRNG seeded from another Rng. Read more