pub struct Xoroshiro128Plus { /* fields omitted */ }
A xoroshiro128+ random number generator.
The xoroshiro128+ 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 xoroshiro128plus.c
reference source code by
David Blackman and Sebastiano Vigna.
Seed a Xoroshiro128Plus
from a u64
using SplitMix64
.
Jump forward, equivalently to 2^64 calls to next_u64()
.
This can be used to generate 2^64 non-overlapping subsequences for
parallel computations.
use rand::SeedableRng;
use xoshiro::Xoroshiro128Plus;
let rng1 = Xoroshiro128Plus::from_seed_u64(0);
let mut rng2 = rng1.clone();
rng2.jump();
let mut rng3 = rng2.clone();
rng3.jump();
Jump forward, equivalently to 2^96 calls to next_u64()
.
This can be used to generate 2^32 starting points, from each of which
jump()
will generate 2^32 non-overlapping subsequences for parallel
distributed computations.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Fill dest
entirely with random data. 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 Xoroshiro128Plus
. 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
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
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
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static