Xoshiro256pp

Struct Xoshiro256pp 

Source
pub struct Xoshiro256pp { /* private fields */ }
Expand description

Rust implementation of the xoshiro256++ PRNG.

This generator is very fast, high-quality, and small, but not cryptographically secure.

More information can be found at: https://prng.di.unimi.it/.

Trait Implementations§

Source§

impl Debug for Xoshiro256pp

Source§

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

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

impl Default for Xoshiro256pp

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Generator for Xoshiro256pp

Source§

fn try_new() -> Result<Self, Error>

Creates a generator using randomness provided by the OS. Read more
Source§

fn u64(&mut self) -> u64

Returns a uniformly distributed u64 in the interval [0, 264).
Source§

fn new() -> Self

Creates a generator using randomness provided by the OS. Read more
Source§

fn usize(&mut self) -> usize

Returns a uniformly distributed usize in the interval [0, usize::MAX].
Source§

fn u32(&mut self) -> u32

Returns a uniformly distributed u32 in the interval [0, 232).
Source§

fn u16(&mut self) -> u16

Returns a uniformly distributed u16 in the interval [0, 216).
Source§

fn u8(&mut self) -> u8

Returns a uniformly distributed u8 in the interval [0, 28).
Source§

fn bits(&mut self, bit_count: u32) -> u64

Returns a uniformly distributed u64 in the interval [0, 2bit_count). Read more
Source§

fn bool(&mut self) -> bool

A simple coinflip, returning a bool that has a 50% chance of being true. Read more
Source§

fn bound(&mut self, max: u64) -> u64

Returns a uniformly distributed u64 in the interval [0, max). Read more
Source§

fn bound_inclusive(&mut self, max: u64) -> u64

Returns a uniformly distributed u64 in the interval [0, max]. Read more
Source§

fn range(&mut self, min: i64, max: i64) -> i64

Returns a uniformly distributed i64 in the interval [min, max) Read more
Source§

fn range_inclusive(&mut self, min: i64, max: i64) -> i64

Returns a uniformly distributed i64 in the interval [min, max] Read more
Source§

fn f64(&mut self) -> f64

Returns a uniformly distributed f64 in the interval [0.0, 1.0).
Source§

fn f32(&mut self) -> f32

Returns a uniformly distributed f32 in the interval [0.0, 1.0).
Source§

fn f64_nonzero(&mut self) -> f64

Returns a uniformly distributed f64 in the interval (0.0, 1.0].
Source§

fn f32_nonzero(&mut self) -> f32

Returns a uniformly distributed f32 in the interval (0.0, 1.0].
Source§

fn f64_wide(&mut self) -> f64

Returns a uniformly distributed f64 in the interval (-1.0, 1.0).
Source§

fn f32_wide(&mut self) -> f32

Returns a uniformly distributed f32 in the interval (-1.0, 1.0).
Source§

fn f64_normal(&mut self) -> (f64, f64)

Returns two indepedent and normally distributed f64 values with a mean of 0.0 and a stddev of 1.0.
Source§

fn f64_normal_distribution(&mut self, mean: f64, stddev: f64) -> (f64, f64)

Returns two indepedent and normally distributed f64 values with user-defined mean and stddev. Read more
Source§

fn f64_exponential(&mut self) -> f64

Returns an exponentially distributed f64 with a lambda of 1.0.
Source§

fn f64_exponential_lambda(&mut self, lambda: f64) -> f64

Returns an exponentially distributed f64 with user-defined lambda. Read more
Source§

fn choose<C>(&mut self, collection: C) -> Option<C::Item>

Returns a randomly chosen item from the iterator of collection. Read more
Source§

fn ascii_alphabetic(&mut self) -> char

Returns a randomly selected ASCII character from the pool of: Read more
Source§

fn ascii_uppercase(&mut self) -> char

Returns a randomly selected ASCII character from the pool of: Read more
Source§

fn ascii_lowercase(&mut self) -> char

Returns a randomly selected ASCII character from the pool of: Read more
Source§

fn ascii_alphanumeric(&mut self) -> char

Returns a randomly selected ASCII character from the pool of: Read more
Source§

fn ascii_digit(&mut self) -> char

Returns a randomly selected ASCII character from the pool of: Read more
Source§

fn shuffle<T>(&mut self, slice: &mut [T])

Performs a Fisher-Yates shuffle on the contents of slice. Read more
Source§

fn shuffle_cloned<T: Clone>(&mut self, slice: &[T]) -> Vec<T>

Clones slice into a new Vec, calls Generator::shuffle on it, and returns the result.
Source§

impl PartialEq for Xoshiro256pp

Source§

fn eq(&self, other: &Xoshiro256pp) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SeedableGenerator for Xoshiro256pp

Source§

fn new_with_seed(seed: u64) -> Self

Creates a generator from the output of an internal PRNG, which is itself seeded from seed. Read more
Source§

impl Eq for Xoshiro256pp

Source§

impl StructuralPartialEq for Xoshiro256pp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.