Mercurial > vba-clojure
diff 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 |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/SFMT/SFMT-params.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,97 @@ 1.4 +#ifndef SFMT_PARAMS_H 1.5 +#define SFMT_PARAMS_H 1.6 + 1.7 +#if !defined(MEXP) 1.8 +#ifdef __GNUC__ 1.9 + #warning "MEXP is not defined. I assume MEXP is 19937." 1.10 +#endif 1.11 + #define MEXP 19937 1.12 +#endif 1.13 +/*----------------- 1.14 + BASIC DEFINITIONS 1.15 + -----------------*/ 1.16 +/** Mersenne Exponent. The period of the sequence 1.17 + * is a multiple of 2^MEXP-1. 1.18 + * #define MEXP 19937 */ 1.19 +/** SFMT generator has an internal state array of 128-bit integers, 1.20 + * and N is its size. */ 1.21 +#define N (MEXP / 128 + 1) 1.22 +/** N32 is the size of internal state array when regarded as an array 1.23 + * of 32-bit integers.*/ 1.24 +#define N32 (N * 4) 1.25 +/** N64 is the size of internal state array when regarded as an array 1.26 + * of 64-bit integers.*/ 1.27 +#define N64 (N * 2) 1.28 + 1.29 +/*---------------------- 1.30 + the parameters of SFMT 1.31 + following definitions are in paramsXXXX.h file. 1.32 + ----------------------*/ 1.33 +/** the pick up position of the array. 1.34 +#define POS1 122 1.35 +*/ 1.36 + 1.37 +/** the parameter of shift left as four 32-bit registers. 1.38 +#define SL1 18 1.39 + */ 1.40 + 1.41 +/** the parameter of shift left as one 128-bit register. 1.42 + * The 128-bit integer is shifted by (SL2 * 8) bits. 1.43 +#define SL2 1 1.44 +*/ 1.45 + 1.46 +/** the parameter of shift right as four 32-bit registers. 1.47 +#define SR1 11 1.48 +*/ 1.49 + 1.50 +/** the parameter of shift right as one 128-bit register. 1.51 + * The 128-bit integer is shifted by (SL2 * 8) bits. 1.52 +#define SR2 1 1.53 +*/ 1.54 + 1.55 +/** A bitmask, used in the recursion. These parameters are introduced 1.56 + * to break symmetry of SIMD. 1.57 +#define MSK1 0xdfffffefU 1.58 +#define MSK2 0xddfecb7fU 1.59 +#define MSK3 0xbffaffffU 1.60 +#define MSK4 0xbffffff6U 1.61 +*/ 1.62 + 1.63 +/** These definitions are part of a 128-bit period certification vector. 1.64 +#define PARITY1 0x00000001U 1.65 +#define PARITY2 0x00000000U 1.66 +#define PARITY3 0x00000000U 1.67 +#define PARITY4 0xc98e126aU 1.68 +*/ 1.69 + 1.70 +#if MEXP == 607 1.71 + #include "SFMT-params607.h" 1.72 +#elif MEXP == 1279 1.73 + #include "SFMT-params1279.h" 1.74 +#elif MEXP == 2281 1.75 + #include "SFMT-params2281.h" 1.76 +#elif MEXP == 4253 1.77 + #include "SFMT-params4253.h" 1.78 +#elif MEXP == 11213 1.79 + #include "SFMT-params11213.h" 1.80 +#elif MEXP == 19937 1.81 + #include "SFMT-params19937.h" 1.82 +#elif MEXP == 44497 1.83 + #include "SFMT-params44497.h" 1.84 +#elif MEXP == 86243 1.85 + #include "SFMT-params86243.h" 1.86 +#elif MEXP == 132049 1.87 + #include "SFMT-params132049.h" 1.88 +#elif MEXP == 216091 1.89 + #include "SFMT-params216091.h" 1.90 +#else 1.91 +#ifdef __GNUC__ 1.92 + #error "MEXP is not valid." 1.93 + #undef MEXP 1.94 +#else 1.95 + #undef MEXP 1.96 +#endif 1.97 + 1.98 +#endif 1.99 + 1.100 +#endif /* SFMT_PARAMS_H */