tmp/tmp_nyxgevc/{from.md → to.md}
RENAMED
|
@@ -7,11 +7,11 @@ sequence X of n values of the type delivered by `x`; all subscripts
|
|
| 7 |
applied to X are to be taken modulo n.
|
| 8 |
|
| 9 |
The transition algorithm employs a twisted generalized feedback shift
|
| 10 |
register defined by shift values n and m, a twist value r, and a
|
| 11 |
conditional xor-mask a. To improve the uniformity of the result, the
|
| 12 |
-
bits of the raw shift register are additionally *tempered* (
|
| 13 |
scrambled) according to a bit-scrambling matrix defined by values
|
| 14 |
u, d, s, b, t, c, and ℓ.
|
| 15 |
|
| 16 |
The state transition is performed as follows:
|
| 17 |
|
|
@@ -24,15 +24,14 @@ z₁, z₂, z₃, z₄ as follows, then delivers z₄ as its result:
|
|
| 24 |
``` cpp
|
| 25 |
template<class UIntType, size_t w, size_t n, size_t m, size_t r,
|
| 26 |
UIntType a, size_t u, UIntType d, size_t s,
|
| 27 |
UIntType b, size_t t,
|
| 28 |
UIntType c, size_t l, UIntType f>
|
| 29 |
-
|
| 30 |
-
{
|
| 31 |
public:
|
| 32 |
// types
|
| 33 |
-
|
| 34 |
|
| 35 |
// engine characteristics
|
| 36 |
static constexpr size_t word_size = w;
|
| 37 |
static constexpr size_t state_size = n;
|
| 38 |
static constexpr size_t shift_size = m;
|
|
|
|
| 7 |
applied to X are to be taken modulo n.
|
| 8 |
|
| 9 |
The transition algorithm employs a twisted generalized feedback shift
|
| 10 |
register defined by shift values n and m, a twist value r, and a
|
| 11 |
conditional xor-mask a. To improve the uniformity of the result, the
|
| 12 |
+
bits of the raw shift register are additionally *tempered* (i.e.,
|
| 13 |
scrambled) according to a bit-scrambling matrix defined by values
|
| 14 |
u, d, s, b, t, c, and ℓ.
|
| 15 |
|
| 16 |
The state transition is performed as follows:
|
| 17 |
|
|
|
|
| 24 |
``` cpp
|
| 25 |
template<class UIntType, size_t w, size_t n, size_t m, size_t r,
|
| 26 |
UIntType a, size_t u, UIntType d, size_t s,
|
| 27 |
UIntType b, size_t t,
|
| 28 |
UIntType c, size_t l, UIntType f>
|
| 29 |
+
class mersenne_twister_engine {
|
|
|
|
| 30 |
public:
|
| 31 |
// types
|
| 32 |
+
using result_type = UIntType;
|
| 33 |
|
| 34 |
// engine characteristics
|
| 35 |
static constexpr size_t word_size = w;
|
| 36 |
static constexpr size_t state_size = n;
|
| 37 |
static constexpr size_t shift_size = m;
|