view src/SFMT/SFMT-params.h @ 399:ddb3c6299619

allowed non-even initial blank inputs.
author Robert McIntyre <rlm@mit.edu>
date Fri, 13 Apr 2012 05:35:55 -0500
parents f9f4f1b99eed
children
line wrap: on
line source
1 #ifndef SFMT_PARAMS_H
2 #define SFMT_PARAMS_H
4 #if !defined(MEXP)
5 #ifdef __GNUC__
6 #warning "MEXP is not defined. I assume MEXP is 19937."
7 #endif
8 #define MEXP 19937
9 #endif
10 /*-----------------
11 BASIC DEFINITIONS
12 -----------------*/
13 /** Mersenne Exponent. The period of the sequence
14 * is a multiple of 2^MEXP-1.
15 * #define MEXP 19937 */
16 /** SFMT generator has an internal state array of 128-bit integers,
17 * and N is its size. */
18 #define N (MEXP / 128 + 1)
19 /** N32 is the size of internal state array when regarded as an array
20 * of 32-bit integers.*/
21 #define N32 (N * 4)
22 /** N64 is the size of internal state array when regarded as an array
23 * of 64-bit integers.*/
24 #define N64 (N * 2)
26 /*----------------------
27 the parameters of SFMT
28 following definitions are in paramsXXXX.h file.
29 ----------------------*/
30 /** the pick up position of the array.
31 #define POS1 122
32 */
34 /** the parameter of shift left as four 32-bit registers.
35 #define SL1 18
36 */
38 /** the parameter of shift left as one 128-bit register.
39 * The 128-bit integer is shifted by (SL2 * 8) bits.
40 #define SL2 1
41 */
43 /** the parameter of shift right as four 32-bit registers.
44 #define SR1 11
45 */
47 /** the parameter of shift right as one 128-bit register.
48 * The 128-bit integer is shifted by (SL2 * 8) bits.
49 #define SR2 1
50 */
52 /** A bitmask, used in the recursion. These parameters are introduced
53 * to break symmetry of SIMD.
54 #define MSK1 0xdfffffefU
55 #define MSK2 0xddfecb7fU
56 #define MSK3 0xbffaffffU
57 #define MSK4 0xbffffff6U
58 */
60 /** These definitions are part of a 128-bit period certification vector.
61 #define PARITY1 0x00000001U
62 #define PARITY2 0x00000000U
63 #define PARITY3 0x00000000U
64 #define PARITY4 0xc98e126aU
65 */
67 #if MEXP == 607
68 #include "SFMT-params607.h"
69 #elif MEXP == 1279
70 #include "SFMT-params1279.h"
71 #elif MEXP == 2281
72 #include "SFMT-params2281.h"
73 #elif MEXP == 4253
74 #include "SFMT-params4253.h"
75 #elif MEXP == 11213
76 #include "SFMT-params11213.h"
77 #elif MEXP == 19937
78 #include "SFMT-params19937.h"
79 #elif MEXP == 44497
80 #include "SFMT-params44497.h"
81 #elif MEXP == 86243
82 #include "SFMT-params86243.h"
83 #elif MEXP == 132049
84 #include "SFMT-params132049.h"
85 #elif MEXP == 216091
86 #include "SFMT-params216091.h"
87 #else
88 #ifdef __GNUC__
89 #error "MEXP is not valid."
90 #undef MEXP
91 #else
92 #undef MEXP
93 #endif
95 #endif
97 #endif /* SFMT_PARAMS_H */