summaryrefslogtreecommitdiff
path: root/numpy/random
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-03-20 10:16:03 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-03-20 10:16:03 +0000
commit8175ff79e0a94f0806dd174ebb09aec8652764ab (patch)
tree34413aac948c9ec511e56bdb495da5933d9a8d4e /numpy/random
parent70166396583cf15b75c9f0cf2a7690c3e1538eb2 (diff)
downloadnumpy-8175ff79e0a94f0806dd174ebb09aec8652764ab.tar.gz
More fixes related to #471
Diffstat (limited to 'numpy/random')
-rw-r--r--numpy/random/mtrand/mtrand.c49
-rw-r--r--numpy/random/mtrand/mtrand.pyx4
2 files changed, 23 insertions, 30 deletions
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c
index 180658854..375f9fddb 100644
--- a/numpy/random/mtrand/mtrand.c
+++ b/numpy/random/mtrand/mtrand.c
@@ -1,4 +1,4 @@
-/* Generated by Pyrex 0.9.5.1 on Tue Mar 20 04:22:44 2007 */
+/* Generated by Pyrex 0.9.5.1 on Tue Mar 20 04:24:28 2007 */
#include "Python.h"
#include "structmember.h"
@@ -1066,8 +1066,6 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_
return __pyx_r;
}
-static PyObject *__pyx_n_Int;
-
static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {
long (*__pyx_v_array_data);
PyArrayObject *arrayObject;
@@ -1098,21 +1096,19 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(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 = 317; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; 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 = 317; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; 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 = 317; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; 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 = 317; 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 = 317; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__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":318 */
__pyx_v_length = PyArray_SIZE(arrayObject);
@@ -1333,21 +1329,19 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(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 = 367; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; 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 = 367; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; 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 = 367; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; 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 = 367; 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 = 367; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__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":368 */
__pyx_v_length = PyArray_SIZE(arrayObject);
@@ -9527,7 +9521,6 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel
}
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
- {&__pyx_n_Int, "Int"},
{&__pyx_n_MT19937, "MT19937"},
{&__pyx_n_PyInt_AsLong, "PyInt_AsLong"},
{&__pyx_n_ValueError, "ValueError"},
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index 684495445..af809a815 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -314,7 +314,7 @@ cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n
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:
@@ -364,7 +364,7 @@ cdef object discnmN_array_sc(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: