pub struct Xoshiro256Plus { /* fields omitted */ }
A xoshiro256+ random number generator.
The xoshiro256+ algorithm is not suitable for cryptographic purposes, but
is very fast and has good statistical properties, besides a low linear
complexity in the lowest bits.
The algorithm used here is translated from the xoshiro256plus.c
reference source code by
David Blackman and Sebastiano Vigna.
Seed a Xoshiro256Plus
from a u64
using SplitMix64
.
Jump forward, equivalently to 2^128 calls to next_u64()
.
This can be used to generate 2^128 non-overlapping subsequences for
parallel computations.
use rand::SeedableRng;
use xoshiro::Xoshiro256Plus;
let rng1 = Xoshiro256Plus::from_seed_u64(0);
let mut rng2 = rng1.clone();
rng2.jump();
let mut rng3 = rng2.clone();
rng3.jump();
Jump forward, equivalently to 2^192 calls to next_u64()
.
This can be used to generate 2^64 starting points, from each of which
jump()
will generate 2^64 non-overlapping subsequences for parallel
distributed computations.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Seed type, which is restricted to types mutably-dereferencable as u8
arrays (we recommend [u8; N]
for some N
). Read more
Create a new Xoshiro256Plus
. If seed
is entirely 0, it will be
mapped to a different seed.
Create a new PRNG using a u64
seed. Read more
Create a new PRNG seeded from another Rng
. Read more
Fill dest
entirely with random data. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)