template<unsigned int internalCounterBits = 64>
class gmx::ThreeFry2x64< internalCounterBits >
ThreeFry2x64 random engine with 20 iteractions.
- Template Parameters
-
internalCounterBits,default | 64. |
This class provides very high quality random numbers that pass all BigCrush tests, it works with two 64-bit values each for keys and counters, and is most efficient when we only need a few random values before restarting the counters with new values.
|
| ThreeFry2x64 (gmx_uint64_t key0=0, RandomDomain domain=RandomDomain::Other) |
| Construct ThreeFry random engine with 2x64 key values, 20 rounds. More...
|
|
| ThreeFry2x64 (gmx_uint64_t key0, gmx_uint64_t key1) |
| Construct random engine from 2x64-bit unsigned integers, 20 rounds. More...
|
|
| ThreeFry2x64General (gmx_uint64_t key0=0, RandomDomain domain=RandomDomain::Other) |
| Construct random engine with 2x64 key values. More...
|
|
| ThreeFry2x64General (gmx_uint64_t key0, gmx_uint64_t key1) |
| Construct random engine from 2x64-bit unsigned integers. More...
|
|
void | seed (gmx_uint64_t key0=0, RandomDomain domain=RandomDomain::Other) |
| Seed 2x64 random engine with two 64-bit key values. More...
|
|
void | seed (gmx_uint64_t key0, gmx_uint64_t key1) |
| Seed random engine from 2x64-bit unsigned integers. More...
|
|
void | restart (gmx_uint64_t ctr0=0, gmx_uint64_t ctr1=0) |
| Restart 2x64 random engine counter from 2 64-bit values. More...
|
|
result_type | operator() () |
| Generate the next random number. More...
|
|
void | discard (gmx_uint64_t n) |
| Skip next n random numbers. More...
|
|
bool | operator== (const ThreeFry2x64General< rounds, internalCounterBits > &x) const |
| Return true if two ThreeFry2x64 engines are identical. More...
|
|
bool | operator!= (const ThreeFry2x64General< rounds, internalCounterBits > &x) const |
| Return true of two ThreeFry2x64 engines are not identical. More...
|
|
template<unsigned int internalCounterBits = 64>
Construct random engine from 2x64-bit unsigned integers, 20 rounds.
This constructor assigns the raw 128 bit key data from unsigned integers. It is meant for the case when you want full control over the key, for instance to compare with reference values of the ThreeFry function during testing.
- Parameters
-
key0 | First word of key/random seed. |
key1 | Second word of key/random seed. |
- Exceptions
-
InternalError | if the high bits needed to encode the number of counter bits are nonzero. To test arbitrary values, use 0 internal counter bits. |