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.

Implementations

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]

pub fn new_unseeded() -> Self[src]

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.

impl<Itype, Xtype, StreamMix, MulMix, OutMix> PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
    Itype: Copy + BitSize,
    Xtype: BitSize,
    StreamMix: Stream<Itype>,
    MulMix: Multiplier<Itype>,
    OutMix: OutputMixin<Itype, Xtype>, 
[src]

pub fn get_state(&self) -> PCGStateInfo<Itype>[src]

Gets the current state of the PCG Engine

pub fn restore_state_with_no_verification(state: PCGStateInfo<Itype>) -> Self[src]

impl<Itype, Xtype, MulMix, OutMix> PcgEngine<Itype, Xtype, SpecificSeqStream<Itype>, MulMix, OutMix> where
    Itype: Copy + Eq + Zero + BitSize,
    SpecificSeqStream<Itype>: Stream<Itype>,
    Xtype: BitSize,
    MulMix: Multiplier<Itype>,
    OutMix: OutputMixin<Itype, Xtype>, 
[src]

pub fn restore_state(state: PCGStateInfo<Itype>) -> Result<Self, String>[src]

impl<Itype, Xtype, StreamMix, MulMix, OutMix> PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
    Itype: PcgOps + Copy + One + Zero + Ord + Eq + BitAnd<Itype, Output = Itype> + ShrAssign,
    StreamMix: Stream<Itype>,
    MulMix: Multiplier<Itype>,
    OutMix: OutputMixin<Itype, Xtype>, 
[src]

pub fn advance(&mut self, delta: Itype)[src]

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, u64, StreamMix, MulMix, OutMix> where
    Itype: PcgOps + Clone,
    StreamMix: Stream<Itype>,
    MulMix: Multiplier<Itype>,
    OutMix: OutputMixin<Itype, u64>, 
[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
[src]

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

Auto Trait Implementations

impl<Itype, Xtype, StreamMix, MulMix, OutMix> RefUnwindSafe for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
    Itype: RefUnwindSafe,
    MulMix: RefUnwindSafe,
    OutMix: RefUnwindSafe,
    StreamMix: RefUnwindSafe,
    Xtype: RefUnwindSafe
[src]

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
[src]

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
[src]

impl<Itype, Xtype, StreamMix, MulMix, OutMix> Unpin for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
    Itype: Unpin,
    MulMix: Unpin,
    OutMix: Unpin,
    StreamMix: Unpin,
    Xtype: Unpin
[src]

impl<Itype, Xtype, StreamMix, MulMix, OutMix> UnwindSafe for PcgEngine<Itype, Xtype, StreamMix, MulMix, OutMix> where
    Itype: UnwindSafe,
    MulMix: UnwindSafe,
    OutMix: UnwindSafe,
    StreamMix: UnwindSafe,
    Xtype: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<R> Rng for R where
    R: RngCore + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,