diff options
Diffstat (limited to 'numpy/random/src')
-rw-r--r-- | numpy/random/src/mt19937/mt19937-jump.c | 4 | ||||
-rw-r--r-- | numpy/random/src/mt19937/mt19937-poly.h | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/numpy/random/src/mt19937/mt19937-jump.c b/numpy/random/src/mt19937/mt19937-jump.c index 46b28cf96..de8969bf9 100644 --- a/numpy/random/src/mt19937/mt19937-jump.c +++ b/numpy/random/src/mt19937/mt19937-jump.c @@ -187,11 +187,9 @@ void mt19937_jump_state(mt19937_state *state, const char *jump_str) { pf = (unsigned long *)calloc(P_SIZE, sizeof(unsigned long)); for (i = MEXP - 1; i > -1; i--) { - if (jump_str[i] == '1') + if (jump_str[(MEXP - 1) - i] == '1') set_coef(pf, i, 1); } - /* TODO: Should generate the next set and start from 0, but doesn't matter ?? - */ if (state->pos >= N) { state->pos = 0; } diff --git a/numpy/random/src/mt19937/mt19937-poly.h b/numpy/random/src/mt19937/mt19937-poly.h index b03747881..016b4f626 100644 --- a/numpy/random/src/mt19937/mt19937-poly.h +++ b/numpy/random/src/mt19937/mt19937-poly.h @@ -1,3 +1,11 @@ +/* + * 2**128 step polynomial produced using the file mt19937-generate-jump-poly.c + * (randomgen) which is a modified version of minipoly_mt19937.c as distributed + * in http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/JUMP/jump_ahead_1.02.tar.gz + * + * These files are not part of NumPy. + */ + static const char * poly = "0001000111110111011100100010101111000000010100100101000001110111100010101000110100101001011001010" "1110101101100101011100101101011001110011100011110100001000001011100101100010100000010011101110011" |