- Defined in File Xoroshiro256plus.h
A random number generator using the xoroshiro.
- From the authors of the algorthim: This is xoshiro256+ 1.0, our best and fastest generator for floating-point numbers. We suggest to use its upper bits for floating-point generation, as it is slightly faster than xoshiro256**. It passes all tests we are aware of except for the lowest three bits, which might fail linearity tests (and just those), so if low linear complexity is not considered an issue (as it is usually the case) it can be used to generate 64-bit outputs, too. We suggest to use a sign test to extract a random Boolean value, and right shifts to extract subsets of bits. The state must be seeded so that it is not everywhere zero. If you have a 64-bit seed, we suggest to seed a splitmix64 generator and use its output to fill the shuffle table.
Subclassed by random_numbers::RNGController
Explicit constructor which sets the rng seed.
seed: the random seed
Generates the next random integer.
- a random integer from 0 to max of 2^64
Generates a random number in the range [0, 1)
- a random double
Jumps the generator forwards by the equivalent of 2^128 calls of next() - useful for parallel computations where different random number sequences are required.
operator<<(std::ostream &os, const Xoroshiro256plus &x)¶
Writes the random number generator to an output stream.
os: the output stream to write to
x: the random number generator to save
operator>>(std::istream &is, Xoroshiro256plus &x)¶
Inputs the NRrand object from the input stream. Used for reading the NRrand object from a file.
- the input stream.
is: the input stream.
r: the NRrand object to input to.