xoshiro256++ (or xoshiro256** if StarStar), a std::uniform_random_bit_generator of 64 bits
More...
#include <ADS/numeric/RandomGenerators.h>
|
| constexpr | Xoshiro256T (std::uint64_t seed=1) |
| | < the type of the numbers
|
| constexpr std::uint64_t | operator() (void) |
| | the next number
|
| constexpr void | jump (void) |
| | advances by \( 2^{128} \) steps, a stream of \( 2^{128} \) numbers apart
|
| bool | operator== (const Xoshiro256T &) const =default |
| | true if the two states are equal
|
|
| static constexpr std::uint64_t | min (void) |
| | the least number, 0
|
| static constexpr std::uint64_t | max (void) |
| | the largest number, \( 2^{64} - 1 \)
|
template<bool StarStar>
class ADS::Xoshiro256T< StarStar >
xoshiro256++ (or xoshiro256** if StarStar), a std::uniform_random_bit_generator of 64 bits
◆ result_type
◆ Xoshiro256T()
< the type of the numbers
the state from the seed by SplitMix64, never all zero
◆ jump()
advances by \( 2^{128} \) steps, a stream of \( 2^{128} \) numbers apart
In pseudocode (Blackman and Vigna, beyond the book), \( J \) the 256 bits of the polynomial of the jump:
\[\class{pseudocode}{\begin{array}{r@{\quad}l}
1 & \textbf{procedure}\ \mathrm{jump}() \cr
2 & \quad a \gets 0 \cr
3 & \quad \textbf{for}\ b \gets 0\ \textbf{to}\ 255\ \textbf{do} \cr
4 & \qquad \textbf{if}\ J_b = 1\ \textbf{then}\ a \gets a \oplus s \cr
5 & \qquad \mathrm{next}() \cr
6 & \quad s \gets a
\end{array}}
\]
◆ max()
the largest number, \( 2^{64} - 1 \)
◆ min()
◆ operator()()
the next number
In pseudocode (Blackman and Vigna, beyond the book), the output from the state before the step:
\[\class{pseudocode}{\begin{array}{r@{\quad}l}
1 & \textbf{function}\ \mathrm{next}() \cr
2 & \quad r \gets \mathrm{rotl}( s_0 + s_3 , 23 ) + s_0\quad
\triangleright\ \mathrm{rotl}( 5 s_1 , 7 ) \cdot 9 \text{ for **} \cr
3 & \quad t \gets s_1 \ll 17 \cr
4 & \quad s_2 \gets s_2 \oplus s_0;\ s_3 \gets s_3 \oplus s_1;\ s_1
\gets s_1 \oplus s_2;\ s_0 \gets s_0 \oplus s_3 \cr
5 & \quad s_2 \gets s_2 \oplus t;\ s_3 \gets \mathrm{rotl}( s_3 , 45 )
\cr
6 & \quad \textbf{return}\ r
\end{array}}
\]
◆ operator==()
true if the two states are equal
The documentation for this class was generated from the following file: