macro_rules! xorshift_custom {
(bits:$bits:literal, basis:$basis:expr, triplet:$triplet:expr, seed:$seed:expr) => { ... };
}
Available on crate feature
rand
only.Expand description
Constructs a XorShift prng with custom bits, basis, triplet and seed.
It can construct custom instances of XorShift16
, XorShift32
and XorShift64
.
The given $triplet
is an index for an array of good triples with a maximum of:
- 3 for 16-bit,
- 80 for 32-bit
- 274 for 64-bit
§Usage:
xorshift_with![bits: 32, basis: 1, triplet: 40, seed: 5334];
Valid argument values:
$bits
:16
,32
or64
.$basis
: in range0..=7
.$triplet
:0..=3
for 16-bit;0..=80
for 32-bit;0..=274
for 64-bit.$seed
: any value. If0
is given the default seed will be used.
§Panics
If the $basis
is outside range 0..=7
.