Mercurial > vba-clojure
comparison src/SFMT/SFMT-params.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 #ifndef SFMT_PARAMS_H | |
2 #define SFMT_PARAMS_H | |
3 | |
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) | |
25 | |
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 */ | |
33 | |
34 /** the parameter of shift left as four 32-bit registers. | |
35 #define SL1 18 | |
36 */ | |
37 | |
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 */ | |
42 | |
43 /** the parameter of shift right as four 32-bit registers. | |
44 #define SR1 11 | |
45 */ | |
46 | |
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 */ | |
51 | |
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 */ | |
59 | |
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 */ | |
66 | |
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 | |
94 | |
95 #endif | |
96 | |
97 #endif /* SFMT_PARAMS_H */ |