Struct pcg_rand::PcgEngine [−][src]
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]
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]
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]
Itype: Copy + BitSize,
Xtype: BitSize,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, Xtype>,
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]
Itype: Copy + Eq + Zero + BitSize,
SpecificSeqStream<Itype>: Stream<Itype>,
Xtype: BitSize,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, Xtype>,
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]
Itype: PcgOps + Copy + One + Zero + Ord + Eq + BitAnd<Itype, Output = Itype> + ShrAssign,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, Xtype>,
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]
Itype: PcgOps + Clone,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, u32>,
fn next_u32(&mut self) -> u32
[src]
fn next_u64(&mut self) -> u64
[src]
fn fill_bytes(&mut self, dest: &mut [u8])
[src]
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
[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]
Itype: PcgOps + Clone,
StreamMix: Stream<Itype>,
MulMix: Multiplier<Itype>,
OutMix: OutputMixin<Itype, u64>,
fn next_u32(&mut self) -> u32
[src]
fn next_u64(&mut self) -> u64
[src]
fn fill_bytes(&mut self, dest: &mut [u8])
[src]
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>
[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]
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(mut seed: Self::Seed) -> Self
[src]
pub fn seed_from_u64(state: u64) -> Self
[src]
pub fn from_rng<R>(rng: R) -> Result<Self, Error> where
R: RngCore,
[src]
R: RngCore,
pub fn from_entropy() -> Self
[src]
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]
Itype: RefUnwindSafe,
MulMix: RefUnwindSafe,
OutMix: RefUnwindSafe,
StreamMix: RefUnwindSafe,
Xtype: RefUnwindSafe,
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]
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,
[src]
Itype: Sync,
MulMix: Sync,
OutMix: Sync,
StreamMix: Sync,
Xtype: Sync,
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]
Itype: Unpin,
MulMix: Unpin,
OutMix: Unpin,
StreamMix: Unpin,
Xtype: Unpin,
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]
Itype: UnwindSafe,
MulMix: UnwindSafe,
OutMix: UnwindSafe,
StreamMix: UnwindSafe,
Xtype: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<R> Rng for R where
R: RngCore + ?Sized,
[src]
R: RngCore + ?Sized,
pub fn gen<T>(&mut self) -> T where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn gen_range<T, R>(&mut self, range: R) -> T where
T: SampleUniform,
R: SampleRange<T>,
[src]
T: SampleUniform,
R: SampleRange<T>,
pub fn sample<T, D>(&mut self, distr: D) -> T where
D: Distribution<T>,
[src]
D: Distribution<T>,
pub fn sample_iter<T, D>(self, distr: D) -> DistIter<D, Self, T> where
D: Distribution<T>,
[src]
D: Distribution<T>,
pub fn fill<T>(&mut self, dest: &mut T) where
T: Fill + ?Sized,
[src]
T: Fill + ?Sized,
pub fn try_fill<T>(&mut self, dest: &mut T) -> Result<(), Error> where
T: Fill + ?Sized,
[src]
T: Fill + ?Sized,
pub fn gen_bool(&mut self, p: f64) -> bool
[src]
pub fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool
[src]
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,