Struct pcg_rand::PcgEngine [−][src]
pub struct PcgEngine<Itype, Xtype, StreamMix: Stream<Itype>, MulMix: Multiplier<Itype>, OutMix: OutputMixin<Itype, Xtype>> { /* fields omitted */ }
A generic PCG structure.
This structure allows the building of many types of PCG generators by using various Mixins for both the stream, multiplier, and permutation function.
Methods
impl<Itype, Xtype, StreamMix, MulMix, OutMix> PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Zero,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, Xtype>,
PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix>: SeedableRng,
[src]
impl<Itype, Xtype, StreamMix, MulMix, OutMix> PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Zero,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, Xtype>,
PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix>: SeedableRng,
pub fn new_unseeded() -> Self
[src]
pub fn new_unseeded() -> Self
Creates a new PCG without specifying a seed.
WARNING: Every PCG created with this method will produce the same
output. In most cases a seeded PCG will be more useful, please check
the references for rand::SeedableRng
and rand::FromEntropy
for
methods to seed a PCG.
Trait Implementations
impl<Itype, StreamMix, MulMix, OutMix> RngCore for PcgEngine<Itype, u32, StreamMix, MulMix, OutMix> where
Itype: PcgOps + Clone,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, u32>,
[src]
impl<Itype, StreamMix, MulMix, OutMix> RngCore for PcgEngine<Itype, u32, StreamMix, MulMix, OutMix> where
Itype: PcgOps + Clone,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, u32>,
fn next_u32(&mut self) -> u32
[src]
fn next_u32(&mut self) -> u32
Return the next random u32
. Read more
fn next_u64(&mut self) -> u64
[src]
fn next_u64(&mut self) -> u64
Return the next random u64
. Read more
fn fill_bytes(&mut self, dest: &mut [u8])
[src]
fn fill_bytes(&mut self, dest: &mut [u8])
Fill dest
with random data. Read more
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
[src]
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
Fill dest
entirely with random data. Read more
impl<Itype, StreamMix, MulMix, OutMix> RngCore for PcgEngine<Itype, u64, StreamMix, MulMix, OutMix> where
Itype: PcgOps + Clone,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, u64>,
[src]
impl<Itype, StreamMix, MulMix, OutMix> RngCore for PcgEngine<Itype, u64, StreamMix, MulMix, OutMix> where
Itype: PcgOps + Clone,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, u64>,
fn next_u32(&mut self) -> u32
[src]
fn next_u32(&mut self) -> u32
Return the next random u32
. Read more
fn next_u64(&mut self) -> u64
[src]
fn next_u64(&mut self) -> u64
Return the next random u64
. Read more
fn fill_bytes(&mut self, dest: &mut [u8])
[src]
fn fill_bytes(&mut self, dest: &mut [u8])
Fill dest
with random data. Read more
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
[src]
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
Fill dest
entirely with random data. Read more
impl<Itype, Xtype, StreamMix, MulMix, OutMix> SeedableRng for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Sized + ReadByteOrder + Zero + One,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, Xtype>,
PcgSeeder<Itype>: Default,
[src]
impl<Itype, Xtype, StreamMix, MulMix, OutMix> SeedableRng for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Sized + ReadByteOrder + Zero + One,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, Xtype>,
PcgSeeder<Itype>: Default,
type Seed = PcgSeeder<Itype>
Seed type, which is restricted to types mutably-dereferencable as u8
arrays (we recommend [u8; N]
for some N
). Read more
fn from_seed(seed: Self::Seed) -> Self
[src]
fn from_seed(seed: Self::Seed) -> Self
Create a new PRNG using the given seed. Read more
fn from_rng<R>(rng: R) -> Result<Self, Error> where
R: RngCore,
[src]
fn from_rng<R>(rng: R) -> Result<Self, Error> where
R: RngCore,
Create a new PRNG seeded from another Rng
. Read more
Auto Trait Implementations
impl<Itype, Xtype, StreamMix, MulMix, OutMix> Send for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Send,
MulMix: Send,
OutMix: Send,
StreamMix: Send,
Xtype: Send,
impl<Itype, Xtype, StreamMix, MulMix, OutMix> Send for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Send,
MulMix: Send,
OutMix: Send,
StreamMix: Send,
Xtype: Send,
impl<Itype, Xtype, StreamMix, MulMix, OutMix> Sync for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Sync,
MulMix: Sync,
OutMix: Sync,
StreamMix: Sync,
Xtype: Sync,
impl<Itype, Xtype, StreamMix, MulMix, OutMix> Sync for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
Itype: Sync,
MulMix: Sync,
OutMix: Sync,
StreamMix: Sync,
Xtype: Sync,