summaryrefslogtreecommitdiff
path: root/numpy/random
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-06-12 20:24:52 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-06-12 20:24:52 +0000
commitc0d32936d1991a2cd8a75b21b805777c18be66e9 (patch)
treeecc4dd875730f526c8c4eddd22d7bb71eadabd3a /numpy/random
parent844fd39844d3930ffa9c98c7d569b1f9829671ff (diff)
downloadnumpy-c0d32936d1991a2cd8a75b21b805777c18be66e9.tar.gz
Apply patch #137
Diffstat (limited to 'numpy/random')
-rw-r--r--numpy/random/mtrand/mtrand.c434
-rw-r--r--numpy/random/mtrand/mtrand.pyx22
2 files changed, 242 insertions, 214 deletions
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c
index 00b591d1d..d0507ec23 100644
--- a/numpy/random/mtrand/mtrand.c
+++ b/numpy/random/mtrand/mtrand.c
@@ -1,10 +1,16 @@
-/* Generated by Pyrex 0.9.3.1 on Fri Jun 9 13:55:06 2006 */
+/* Generated by Pyrex 0.9.4.1 on Mon Jun 12 14:22:41 2006 */
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+__PYX_EXTERN_C double pow(double, double);
#include "string.h"
#include "math.h"
#include "numpy/arrayobject.h"
@@ -31,11 +37,10 @@ static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
-staticforward char **__pyx_f;
+static char **__pyx_f;
/* Declarations from mtrand */
-staticforward PyTypeObject __pyx_type_6mtrand_RandomState;
struct __pyx_obj_6mtrand_RandomState {
PyObject_HEAD
@@ -166,7 +171,7 @@ static PyObject *__pyx_n_permutation;
static PyObject *__pyx_n_numpy;
static PyObject *__pyx_n_empty;
-static PyObject *__pyx_n_Float64;
+static PyObject *__pyx_n_float64;
static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {
double (*__pyx_v_array_data);
@@ -179,7 +184,7 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":128 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -199,7 +204,7 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
@@ -209,7 +214,7 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
@@ -225,7 +230,9 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":135 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":136 */
Py_INCREF(((PyObject *)arrayObject));
@@ -234,7 +241,7 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -259,7 +266,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":144 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -279,7 +286,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
@@ -289,7 +296,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
@@ -305,7 +312,9 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":151 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":152 */
Py_INCREF(((PyObject *)arrayObject));
@@ -314,7 +323,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -339,7 +348,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":161 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -359,7 +368,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
@@ -369,7 +378,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
@@ -385,7 +394,9 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":168 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":169 */
Py_INCREF(((PyObject *)arrayObject));
@@ -394,7 +405,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -419,7 +430,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":179 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -439,7 +450,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
@@ -449,7 +460,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
@@ -465,7 +476,9 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":186 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":187 */
Py_INCREF(((PyObject *)arrayObject));
@@ -474,7 +487,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -488,7 +501,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((
return __pyx_r;
}
-static PyObject *__pyx_n_Int;
+static PyObject *__pyx_n_int;
static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {
long (*__pyx_v_array_data);
@@ -501,7 +514,7 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":195 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -520,21 +533,19 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":199 */
__pyx_v_length = PyArray_SIZE(arrayObject);
@@ -547,7 +558,9 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":202 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":203 */
Py_INCREF(((PyObject *)arrayObject));
@@ -556,7 +569,7 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -581,7 +594,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":211 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -600,21 +613,19 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":215 */
__pyx_v_length = PyArray_SIZE(arrayObject);
@@ -627,7 +638,9 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":218 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":219 */
Py_INCREF(((PyObject *)arrayObject));
@@ -636,7 +649,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -661,7 +674,7 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":228 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -680,21 +693,19 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":232 */
__pyx_v_length = PyArray_SIZE(arrayObject);
@@ -707,7 +718,9 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":235 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":236 */
Py_INCREF(((PyObject *)arrayObject));
@@ -716,7 +729,7 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -741,7 +754,7 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":244 */
__pyx_1 = __pyx_v_size == Py_None;
@@ -760,21 +773,19 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":248 */
__pyx_v_length = PyArray_SIZE(arrayObject);
@@ -787,7 +798,9 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":251 */
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);
+ __pyx_L3:;
}
+ __pyx_L4:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":252 */
Py_INCREF(((PyObject *)arrayObject));
@@ -796,7 +809,7 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -838,7 +851,9 @@ static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":263 */
__pyx_v_sum = __pyx_v_t;
+ __pyx_L2:;
}
+ __pyx_L3:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":264 */
__pyx_r = __pyx_v_sum;
@@ -846,6 +861,7 @@ static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {
__pyx_r = 0;
goto __pyx_L0;
+ __pyx_L1:;
__Pyx_WriteUnraisable("mtrand.kahan_sum");
__pyx_L0:;
return __pyx_r;
@@ -910,13 +926,13 @@ static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {
__pyx_L2:;
goto __pyx_L0;
+ __pyx_L1:;
__Pyx_AddTraceback("mtrand.RandomState.__dealloc__");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}
static PyObject *__pyx_n_type;
-static PyObject *__pyx_n_int;
static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_seed[] = "Seed the generator.\n\n seed(seed=None)\n\n seed can be an integer, an array (or other sequence) of integers of any\n length, or None. If seed is None, then RandomState will try to read data\n from /dev/urandom (or the Windows analogue) if available or seed from\n the clock otherwise.\n ";
@@ -935,7 +951,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_seed);
- arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);
+ arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":308 */
__pyx_1 = __pyx_v_seed == Py_None;
@@ -959,7 +975,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb
if (__pyx_1) {
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":311 */
- __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;}
+ __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;}
rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
goto __pyx_L2;
}
@@ -967,7 +983,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":313 */
__pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;}
- Py_INCREF(((PyObject *)__pyx_3));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
Py_DECREF(((PyObject *)arrayObject_obj));
arrayObject_obj = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
@@ -977,7 +993,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -1007,25 +1023,23 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
- arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);
+ arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":323 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
__pyx_1 = 0;
- __pyx_4 = 0;
- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
+ __pyx_3 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_INCREF(((PyObject *)__pyx_1));
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
Py_DECREF(((PyObject *)arrayObject_state));
arrayObject_state = ((PyArrayObject *)__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
@@ -1034,19 +1048,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,
memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":325 */
- __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
__pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
Py_INCREF(__pyx_n_MT19937);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);
Py_INCREF(((PyObject *)arrayObject_state));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));
- PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);
- __pyx_4 = 0;
+ PyTuple_SET_ITEM(__pyx_2, 2, __pyx_3);
+ __pyx_3 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1086,9 +1100,9 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_state);
- arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);
- __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);
- __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);
+ arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_algorithm_name = Py_None; Py_INCREF(Py_None);
+ __pyx_v_key = Py_None; Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":336 */
__pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}
@@ -1133,7 +1147,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":340 */
__pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; goto __pyx_L1;}
- Py_INCREF(((PyObject *)__pyx_4));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
Py_DECREF(((PyObject *)arrayObject_obj));
arrayObject_obj = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
@@ -1163,7 +1177,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":344 */
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1200,7 +1214,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_se
__pyx_3 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1235,7 +1249,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_se
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1287,7 +1301,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self
__pyx_3 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1320,7 +1334,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_s
__pyx_1 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1350,7 +1364,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self,
__pyx_1 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1393,7 +1407,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P
Py_INCREF(__pyx_v_low);
Py_INCREF(__pyx_v_high);
Py_INCREF(__pyx_v_size);
- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);
+ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":384 */
__pyx_1 = __pyx_v_high == Py_None;
@@ -1458,21 +1472,19 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
__pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_INCREF(((PyObject *)__pyx_4));
- Py_DECREF(((PyObject *)arrayObject));
- arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
+ Py_DECREF(((PyObject *)arrayObject));
+ arrayObject = ((PyArrayObject *)__pyx_3);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":399 */
__pyx_v_length = PyArray_SIZE(arrayObject);
@@ -1485,7 +1497,9 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":402 */
(__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));
+ __pyx_L5:;
}
+ __pyx_L6:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":403 */
Py_INCREF(((PyObject *)arrayObject));
@@ -1494,7 +1508,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P
}
__pyx_L4:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
@@ -1520,9 +1534,9 @@ static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyO
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"length",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_length)) return 0;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "I", __pyx_argnames, &__pyx_v_length)) return 0;
Py_INCREF(__pyx_v_self);
- __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);
+ __pyx_v_bytestring = Py_None; Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":411 */
__pyx_v_bytes = PyMem_Malloc(__pyx_v_length);
@@ -1544,7 +1558,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyO
__pyx_r = __pyx_v_bytestring;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1578,7 +1592,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, P
__pyx_1 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1657,7 +1671,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1735,7 +1749,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO
}
__pyx_L2:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1808,7 +1822,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v
__pyx_4 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -1842,7 +1856,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v
__pyx_1 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -1902,7 +1916,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -1980,7 +1994,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2040,7 +2054,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_sel
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2072,7 +2086,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__
__pyx_1 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -2129,7 +2143,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2208,7 +2222,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2286,7 +2300,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2383,7 +2397,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2442,7 +2456,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2520,7 +2534,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2552,7 +2566,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v
__pyx_1 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -2609,7 +2623,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2669,7 +2683,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2728,7 +2742,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2787,7 +2801,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2846,7 +2860,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2908,7 +2922,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -2970,7 +2984,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3032,7 +3046,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3094,7 +3108,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3154,7 +3168,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3232,7 +3246,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3329,7 +3343,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3425,7 +3439,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3521,7 +3535,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3581,7 +3595,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3640,7 +3654,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3717,7 +3731,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3832,7 +3846,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3909,7 +3923,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,
__pyx_2 = 0;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
@@ -3972,13 +3986,13 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p
Py_INCREF(__pyx_v_mean);
Py_INCREF(__pyx_v_cov);
Py_INCREF(__pyx_v_size);
- __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);
- __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);
- __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);
- __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);
- __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);
- __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);
- __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);
+ __pyx_v_shape = Py_None; Py_INCREF(Py_None);
+ __pyx_v_final_shape = Py_None; Py_INCREF(Py_None);
+ __pyx_v_x = Py_None; Py_INCREF(Py_None);
+ __pyx_v_svd = Py_None; Py_INCREF(Py_None);
+ __pyx_v_u = Py_None; Py_INCREF(Py_None);
+ __pyx_v_s = Py_None; Py_INCREF(Py_None);
+ __pyx_v_v = Py_None; Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":816 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}
@@ -4346,7 +4360,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p
__pyx_r = __pyx_v_x;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -4405,10 +4419,10 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_pvals);
Py_INCREF(__pyx_v_size);
- arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);
- arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);
- __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);
- __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);
+ arrayObject_parr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ arrayObject_mnarr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_shape = Py_None; Py_INCREF(Py_None);
+ __pyx_v_multin = Py_None; Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":872 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}
@@ -4424,7 +4438,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":873 */
__pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; goto __pyx_L1;}
- Py_INCREF(((PyObject *)__pyx_1));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
Py_DECREF(((PyObject *)arrayObject_parr));
arrayObject_parr = ((PyArrayObject *)__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
@@ -4509,23 +4523,21 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
Py_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);
- __pyx_1 = 0;
- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_1, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_multin);
- __pyx_v_multin = __pyx_1;
- __pyx_1 = 0;
+ __pyx_v_multin = __pyx_3;
+ __pyx_3 = 0;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":887 */
- Py_INCREF(((PyObject *)__pyx_v_multin));
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin)));
Py_DECREF(((PyObject *)arrayObject_mnarr));
arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);
@@ -4537,6 +4549,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":890 */
while (1) {
+ __pyx_L4:;
__pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));
if (!__pyx_5) break;
@@ -4568,6 +4581,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":898 */
__pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));
+ __pyx_L6:;
}
__pyx_L7:;
@@ -4584,13 +4598,14 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":902 */
__pyx_v_i = (__pyx_v_i + __pyx_v_d);
}
+ __pyx_L5:;
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":904 */
Py_INCREF(__pyx_v_multin);
__pyx_r = __pyx_v_multin;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -4644,6 +4659,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":916 */
while (1) {
+ __pyx_L2:;
__pyx_5 = (__pyx_v_i > 0);
if (!__pyx_5) break;
@@ -4669,8 +4685,9 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":919 */
__pyx_v_i = (__pyx_v_i - 1);
}
+ __pyx_L3:;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -4700,7 +4717,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);
- __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);
+ __pyx_v_arr = Py_None; Py_INCREF(Py_None);
/* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":927 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}
@@ -4764,7 +4781,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel
__pyx_r = __pyx_v_arr;
goto __pyx_L0;
- __pyx_r = Py_None; Py_INCREF(__pyx_r);
+ __pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
@@ -4780,8 +4797,6 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel
}
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
- {&__pyx_n_Float64, "Float64"},
- {&__pyx_n_Int, "Int"},
{&__pyx_n_MT19937, "MT19937"},
{&__pyx_n_ValueError, "ValueError"},
{&__pyx_n___RandomState_ctor, "__RandomState_ctor"},
@@ -4799,6 +4814,7 @@ static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_empty, "empty"},
{&__pyx_n_exponential, "exponential"},
{&__pyx_n_f, "f"},
+ {&__pyx_n_float64, "float64"},
{&__pyx_n_gamma, "gamma"},
{&__pyx_n_geometric, "geometric"},
{&__pyx_n_get_state, "get_state"},
@@ -4921,6 +4937,7 @@ static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a,
}
static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {
+ struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;
{
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
@@ -4934,10 +4951,13 @@ static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {
}
static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;
return 0;
}
static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {
+ struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;
return 0;
}
@@ -5061,7 +5081,7 @@ static PyBufferProcs __pyx_tp_as_buffer_RandomState = {
0, /*bf_getcharbuffer*/
};
-statichere PyTypeObject __pyx_type_6mtrand_RandomState = {
+PyTypeObject __pyx_type_6mtrand_RandomState = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"mtrand.RandomState", /*tp_name*/
@@ -5082,7 +5102,7 @@ statichere PyTypeObject __pyx_type_6mtrand_RandomState = {
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Container for the Mersenne Twister PRNG.\n\n Constructor\n -----------\n RandomState(seed=None): initializes the PRNG with the given seed. See the\n seed() method for details.\n\n Distribution Methods\n -----------------\n RandomState exposes a number of methods for generating random numbers drawn\n from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n size=None. If size is None, then a single value is generated and returned.\n If size is an integer, then a 1-D numpy array filled with generated values\n is returned. If size is a tuple, then a numpy array with that shape is\n filled and returned.\n ", /*tp_doc*/
__pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/
__pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/
@@ -5114,10 +5134,13 @@ static struct PyMethodDef __pyx_methods[] = {
{0, 0, 0, 0}
};
-DL_EXPORT(void) initmtrand(void); /*proto*/
-DL_EXPORT(void) initmtrand(void) {
+static void __pyx_init_filenames(void); /*proto*/
+
+PyMODINIT_FUNC initmtrand(void); /*proto*/
+PyMODINIT_FUNC initmtrand(void) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
+ __pyx_init_filenames();
__pyx_m = Py_InitModule4("mtrand", __pyx_methods, 0, 0, PYTHON_API_VERSION);
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};
__pyx_b = PyImport_AddModule("__builtin__");
@@ -5651,10 +5674,13 @@ static char *__pyx_filenames[] = {
"mtrand.pyx",
"numpy.pxi",
};
-statichere char **__pyx_f = __pyx_filenames;
/* Runtime support code */
+static void __pyx_init_filenames(void) {
+ __pyx_f = __pyx_filenames;
+}
+
static int __Pyx_GetStarArgs(
PyObject **args,
PyObject **kwds,
@@ -5719,8 +5745,10 @@ static int __Pyx_GetStarArgs(
bad:
Py_XDECREF(args1);
Py_XDECREF(kwds1);
- Py_XDECREF(*args2);
- Py_XDECREF(*kwds2);
+ if (*args2)
+ Py_XDECREF(*args2);
+ if (*kwds2)
+ Py_XDECREF(*kwds2);
return -1;
}
@@ -5843,23 +5871,23 @@ static void __Pyx_UnpackError(void) {
}
static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {
- PyObject *item = PySequence_GetItem(seq, i);
- if (!item) {
+ PyObject *item;
+ if (!(item = PySequence_GetItem(seq, i))) {
if (PyErr_ExceptionMatches(PyExc_IndexError))
- __Pyx_UnpackError();
+ __Pyx_UnpackError();
}
return item;
}
static int __Pyx_EndUnpack(PyObject *seq, int i) {
- PyObject *item = PySequence_GetItem(seq, i);
- if (item) {
+ PyObject *item;
+ if (item = PySequence_GetItem(seq, i)) {
Py_DECREF(item);
__Pyx_UnpackError();
return -1;
}
PyErr_Clear();
- return 0;
+ return 0;
}
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index 600cd9321..623c87d14 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -128,7 +128,7 @@ cdef object cont0_array(rk_state *state, rk_cont0 func, object size):
if size is None:
return func(state)
else:
- array = <ndarray>_sp.empty(size, _sp.Float64)
+ array = <ndarray>_sp.empty(size, _sp.float64)
length = PyArray_SIZE(array)
array_data = <double *>array.data
for i from 0 <= i < length:
@@ -144,7 +144,7 @@ cdef object cont1_array(rk_state *state, rk_cont1 func, object size, double a):
if size is None:
return func(state, a)
else:
- array = <ndarray>_sp.empty(size, _sp.Float64)
+ array = <ndarray>_sp.empty(size, _sp.float64)
length = PyArray_SIZE(array)
array_data = <double *>array.data
for i from 0 <= i < length:
@@ -161,7 +161,7 @@ cdef object cont2_array(rk_state *state, rk_cont2 func, object size, double a,
if size is None:
return func(state, a, b)
else:
- array = <ndarray>_sp.empty(size, _sp.Float64)
+ array = <ndarray>_sp.empty(size, _sp.float64)
length = PyArray_SIZE(array)
array_data = <double *>array.data
for i from 0 <= i < length:
@@ -179,7 +179,7 @@ cdef object cont3_array(rk_state *state, rk_cont3 func, object size, double a,
if size is None:
return func(state, a, b, c)
else:
- array = <ndarray>_sp.empty(size, _sp.Float64)
+ array = <ndarray>_sp.empty(size, _sp.float64)
length = PyArray_SIZE(array)
array_data = <double *>array.data
for i from 0 <= i < length:
@@ -195,7 +195,7 @@ cdef object disc0_array(rk_state *state, rk_disc0 func, object size):
if size is None:
return func(state)
else:
- array = <ndarray>_sp.empty(size, _sp.Int)
+ array = <ndarray>_sp.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>array.data
for i from 0 <= i < length:
@@ -211,7 +211,7 @@ cdef object discnp_array(rk_state *state, rk_discnp func, object size, long n, d
if size is None:
return func(state, n, p)
else:
- array = <ndarray>_sp.empty(size, _sp.Int)
+ array = <ndarray>_sp.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>array.data
for i from 0 <= i < length:
@@ -228,7 +228,7 @@ cdef object discnmN_array(rk_state *state, rk_discnmN func, object size,
if size is None:
return func(state, n, m, N)
else:
- array = <ndarray>_sp.empty(size, _sp.Int)
+ array = <ndarray>_sp.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>array.data
for i from 0 <= i < length:
@@ -244,7 +244,7 @@ cdef object discd_array(rk_state *state, rk_discd func, object size, double a):
if size is None:
return func(state, a)
else:
- array = <ndarray>_sp.empty(size, _sp.Int)
+ array = <ndarray>_sp.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>array.data
for i from 0 <= i < length:
@@ -320,7 +320,7 @@ cdef class RandomState:
get_state() -> ('MT19937', int key[624], int pos)
"""
cdef ndarray state "arrayObject_state"
- state = <ndarray>_sp.empty(624, _sp.Int)
+ state = <ndarray>_sp.empty(624, int)
memcpy(<void*>(state.data), self.internal_state.key, 624*sizeof(long))
return ('MT19937', state, self.internal_state.pos)
@@ -395,7 +395,7 @@ cdef class RandomState:
if size is None:
return rk_interval(diff, self.internal_state) + lo
else:
- array = <ndarray>_sp.empty(size, _sp.Int)
+ array = <ndarray>_sp.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>array.data
for i from 0 <= i < length:
@@ -883,7 +883,7 @@ cdef class RandomState:
else:
shape = size + (d,)
- multin = _sp.zeros(shape, _sp.Int)
+ multin = _sp.zeros(shape, int)
mnarr = <ndarray>multin
mnix = <long*>mnarr.data
i = 0