diff options
author | cookedm <cookedm@localhost> | 2006-05-19 22:13:19 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2006-05-19 22:13:19 +0000 |
commit | 267228a6d819c857a5c1fe6dcea85b90781ea7cc (patch) | |
tree | 6c0d9a26b86d4a29c469f852083395d40aabde41 /numpy | |
parent | dc9088641bb96139279bf06b5a4672da3c466960 (diff) | |
download | numpy-267228a6d819c857a5c1fe6dcea85b90781ea7cc.tar.gz |
Intialize the has_binomial field of the mtrand state.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/random/mtrand/mtrand.pyx | 1 | ||||
-rw-r--r-- | numpy/random/mtrand/randomkit.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx index 17432a1dc..26a6b37f6 100644 --- a/numpy/random/mtrand/mtrand.pyx +++ b/numpy/random/mtrand/mtrand.pyx @@ -291,6 +291,7 @@ cdef class RandomState: def __dealloc__(self): if self.internal_state != NULL: PyMem_Free(self.internal_state) + self.internal_state = NULL def seed(self, seed=None): """Seed the generator. diff --git a/numpy/random/mtrand/randomkit.c b/numpy/random/mtrand/randomkit.c index 6a58f2dba..eddef16af 100644 --- a/numpy/random/mtrand/randomkit.c +++ b/numpy/random/mtrand/randomkit.c @@ -123,6 +123,7 @@ void rk_seed(unsigned long seed, rk_state *state) state->pos = RK_STATE_LEN; state->has_gauss = 0; + state->has_binomial = 0; } /* Thomas Wang 32 bits integer hash function */ @@ -151,6 +152,7 @@ rk_error rk_randomseed(rk_state *state) state->key[0] |= 0x80000000UL; /* ensures non-zero key */ state->pos = RK_STATE_LEN; state->has_gauss = 0; + state->has_binomial = 0; for (i=0; i<624; i++) { |