[−][src]Struct randomize::PCG64
A permuted congruential
generator
with 64-bit output. Pick this if you want to do stuff with f64
values.
Fields
state: u128
State value. Changes with every use.
inc: u128
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 PCG64
[src]
pub const fn seed(seed: u128, inc: u128) -> 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_u64(&mut self) -> u64
[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: u128)
[src]
Advances the generator delta
steps in log(delta)
time.
Trait Implementations
impl PartialEq<PCG64> for PCG64
[src]
impl Eq for PCG64
[src]
impl Hash for PCG64
[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,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for PCG64
[src]
impl From<[u128; 2]> for PCG64
[src]
impl From<(u128, u128)> for PCG64
[src]
impl From<PCG64> for [u128; 2]
[src]
impl From<PCG64> for (u128, u128)
[src]
impl Clone for PCG64
[src]
fn clone(&self) -> PCG64
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for PCG64
[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,