[Numpy-svn] r2942 - trunk/numpy/random/mtrand

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Aug 1 15:23:19 CDT 2006


Author: oliphant
Date: 2006-08-01 15:23:15 -0500 (Tue, 01 Aug 2006)
New Revision: 2942

Modified:
   trunk/numpy/random/mtrand/mtrand.c
   trunk/numpy/random/mtrand/numpy.pxi
Log:
Add PyArray_ContiguousFromObject to numpy.pxi

Modified: trunk/numpy/random/mtrand/mtrand.c
===================================================================
--- trunk/numpy/random/mtrand/mtrand.c	2006-08-01 06:36:28 UTC (rev 2941)
+++ trunk/numpy/random/mtrand/mtrand.c	2006-08-01 20:23:15 UTC (rev 2942)
@@ -1,4 +1,4 @@
-/* Generated by Pyrex 0.9.4.1 on Wed Jul 26 11:44:23 2006 */
+/* Generated by Pyrex 0.9.4.1 on Tue Aug  1 14:19:59 2006 */
 
 #include "Python.h"
 #include "structmember.h"
@@ -1764,7 +1764,6 @@
 }
 
 static PyObject *__pyx_n_type;
-static PyObject *__pyx_n_PyArray_ContiguousFromObject;
 
 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        ";
@@ -1778,8 +1777,6 @@
   PyObject *__pyx_3 = 0;
   PyObject *__pyx_4 = 0;
   unsigned long __pyx_5;
-  PyObject *__pyx_6 = 0;
-  PyObject *__pyx_7 = 0;
   static char *__pyx_argnames[] = {"seed",0};
   __pyx_v_seed = __pyx_k3;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed)) return 0;
@@ -1816,26 +1813,11 @@
   /*else*/ {
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":502 */
-    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_PyArray_ContiguousFromObject); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
-    __pyx_4 = PyInt_FromLong(NPY_LONG); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
-    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
-    __pyx_6 = PyInt_FromLong(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
-    __pyx_7 = PyTuple_New(4); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
-    Py_INCREF(__pyx_v_seed);
-    PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_seed);
-    PyTuple_SET_ITEM(__pyx_7, 1, __pyx_4);
-    PyTuple_SET_ITEM(__pyx_7, 2, __pyx_2);
-    PyTuple_SET_ITEM(__pyx_7, 3, __pyx_6);
-    __pyx_4 = 0;
-    __pyx_2 = 0;
-    __pyx_6 = 0;
-    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
-    Py_DECREF(__pyx_7); __pyx_7 = 0;
-    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
+    __pyx_3 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
+    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
     Py_DECREF(((PyObject *)arrayObject_obj));
-    arrayObject_obj = ((PyArrayObject *)__pyx_4);
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    arrayObject_obj = ((PyArrayObject *)__pyx_3);
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":503 */
     init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));
@@ -1848,8 +1830,6 @@
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
   Py_XDECREF(__pyx_4);
-  Py_XDECREF(__pyx_6);
-  Py_XDECREF(__pyx_7);
   __Pyx_AddTraceback("mtrand.RandomState.seed");
   __pyx_r = 0;
   __pyx_L0:;
@@ -1945,8 +1925,6 @@
   PyObject *__pyx_2 = 0;
   int __pyx_3;
   PyObject *__pyx_4 = 0;
-  PyObject *__pyx_5 = 0;
-  PyObject *__pyx_6 = 0;
   static char *__pyx_argnames[] = {"state",0};
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0;
   Py_INCREF(__pyx_v_self);
@@ -1997,39 +1975,24 @@
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":529 */
-  __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_PyArray_ContiguousFromObject); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
-  __pyx_2 = PyInt_FromLong(NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
-  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
-  __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
-  __pyx_6 = PyTuple_New(4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
-  Py_INCREF(__pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_2);
-  PyTuple_SET_ITEM(__pyx_6, 2, __pyx_1);
-  PyTuple_SET_ITEM(__pyx_6, 3, __pyx_5);
-  __pyx_2 = 0;
-  __pyx_1 = 0;
-  __pyx_5 = 0;
-  __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
-  Py_DECREF(__pyx_4); __pyx_4 = 0;
-  Py_DECREF(__pyx_6); __pyx_6 = 0;
-  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+  __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
   Py_DECREF(((PyObject *)arrayObject_obj));
-  arrayObject_obj = ((PyArrayObject *)__pyx_2);
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  arrayObject_obj = ((PyArrayObject *)__pyx_4);
+  Py_DECREF(__pyx_4); __pyx_4 = 0;
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":530 */
   __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);
   if (__pyx_3) {
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":531 */
-    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
-    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
     Py_INCREF(__pyx_k69p);
-    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k69p);
-    __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k69p);
+    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
     Py_DECREF(__pyx_1); __pyx_1 = 0;
-    Py_DECREF(__pyx_5); __pyx_5 = 0;
     __Pyx_Raise(__pyx_4, 0, 0);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
@@ -2049,8 +2012,6 @@
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_4);
-  Py_XDECREF(__pyx_5);
-  Py_XDECREF(__pyx_6);
   __Pyx_AddTraceback("mtrand.RandomState.set_state");
   __pyx_r = 0;
   __pyx_L0:;
@@ -7045,9 +7006,7 @@
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
   long __pyx_4;
-  PyObject *__pyx_5 = 0;
-  PyObject *__pyx_6 = 0;
-  int __pyx_7;
+  int __pyx_5;
   static char *__pyx_argnames[] = {"n","pvals","size",0};
   __pyx_v_size = __pyx_k59;
   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lO|O", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;
@@ -7072,42 +7031,27 @@
   __pyx_v_d = __pyx_4;
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1169 */
-  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_PyArray_ContiguousFromObject); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;}
-  __pyx_2 = PyInt_FromLong(NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;}
-  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;}
-  __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;}
-  __pyx_6 = PyTuple_New(4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;}
-  Py_INCREF(__pyx_v_pvals);
-  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_pvals);
-  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_2);
-  PyTuple_SET_ITEM(__pyx_6, 2, __pyx_3);
-  PyTuple_SET_ITEM(__pyx_6, 3, __pyx_5);
-  __pyx_2 = 0;
-  __pyx_3 = 0;
-  __pyx_5 = 0;
-  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;}
-  Py_DECREF(__pyx_1); __pyx_1 = 0;
-  Py_DECREF(__pyx_6); __pyx_6 = 0;
-  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+  __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;}
+  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
   Py_DECREF(((PyObject *)arrayObject_parr));
-  arrayObject_parr = ((PyArrayObject *)__pyx_2);
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  arrayObject_parr = ((PyArrayObject *)__pyx_1);
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1170 */
   __pyx_v_pix = ((double (*))arrayObject_parr->data);
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1172 */
-  __pyx_7 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);
-  if (__pyx_7) {
+  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);
+  if (__pyx_5) {
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1173 */
-    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
-    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
+    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
+    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
     Py_INCREF(__pyx_k123p);
-    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k123p);
-    __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k123p);
+    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
     Py_DECREF(__pyx_3); __pyx_3 = 0;
-    Py_DECREF(__pyx_5); __pyx_5 = 0;
     __Pyx_Raise(__pyx_1, 0, 0);
     Py_DECREF(__pyx_1); __pyx_1 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
@@ -7116,31 +7060,31 @@
   __pyx_L2:;
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1175 */
-  __pyx_7 = __pyx_v_size == Py_None;
-  if (__pyx_7) {
+  __pyx_5 = __pyx_v_size == Py_None;
+  if (__pyx_5) {
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1176 */
-    __pyx_6 = PyInt_FromLong(__pyx_v_d); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;}
-    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;}
-    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
-    __pyx_6 = 0;
-    Py_DECREF(__pyx_v_shape);
-    __pyx_v_shape = __pyx_2;
+    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;}
+    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
     __pyx_2 = 0;
+    Py_DECREF(__pyx_v_shape);
+    __pyx_v_shape = __pyx_3;
+    __pyx_3 = 0;
     goto __pyx_L3;
   }
-  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
-  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
   Py_INCREF(__pyx_v_size);
-  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
-  __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+  __pyx_5 = __pyx_3 == __pyx_1;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
-  Py_DECREF(__pyx_5); __pyx_5 = 0;
-  __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
-  __pyx_7 = __pyx_1 == __pyx_6;
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  Py_DECREF(__pyx_6); __pyx_6 = 0;
-  if (__pyx_7) {
+  if (__pyx_5) {
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1178 */
     __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;}
@@ -7157,34 +7101,34 @@
   /*else*/ {
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1180 */
-    __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
-    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
-    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_5);
-    __pyx_5 = 0;
-    __pyx_6 = PyNumber_Add(__pyx_v_size, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
-    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
+    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
     Py_DECREF(__pyx_v_shape);
-    __pyx_v_shape = __pyx_6;
-    __pyx_6 = 0;
+    __pyx_v_shape = __pyx_3;
+    __pyx_3 = 0;
   }
   __pyx_L3:;
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1182 */
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
-  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
-  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
+  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
   __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
   Py_INCREF(__pyx_v_shape);
   PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_shape);
-  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);
-  __pyx_5 = 0;
-  __pyx_6 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  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 = 1182; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(__pyx_v_multin);
-  __pyx_v_multin = __pyx_6;
-  __pyx_6 = 0;
+  __pyx_v_multin = __pyx_3;
+  __pyx_3 = 0;
 
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1183 */
   Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin)));
@@ -7200,8 +7144,8 @@
   /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1186 */
   while (1) {
     __pyx_L4:;
-    __pyx_7 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));
-    if (!__pyx_7) break;
+    __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));
+    if (!__pyx_5) break;
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1187 */
     __pyx_v_Sum = 1.0;
@@ -7220,8 +7164,8 @@
       __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));
 
       /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1192 */
-      __pyx_7 = (__pyx_v_dn <= 0);
-      if (__pyx_7) {
+      __pyx_5 = (__pyx_v_dn <= 0);
+      if (__pyx_5) {
 
         /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1193 */
         goto __pyx_L7;
@@ -7236,8 +7180,8 @@
     __pyx_L7:;
 
     /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1195 */
-    __pyx_7 = (__pyx_v_dn > 0);
-    if (__pyx_7) {
+    __pyx_5 = (__pyx_v_dn > 0);
+    if (__pyx_5) {
 
       /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1196 */
       (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;
@@ -7261,8 +7205,6 @@
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
-  Py_XDECREF(__pyx_5);
-  Py_XDECREF(__pyx_6);
   __Pyx_AddTraceback("mtrand.RandomState.multinomial");
   __pyx_r = 0;
   __pyx_L0:;
@@ -7450,7 +7392,6 @@
 
 static __Pyx_InternTabEntry __pyx_intern_tab[] = {
   {&__pyx_n_MT19937, "MT19937"},
-  {&__pyx_n_PyArray_ContiguousFromObject, "PyArray_ContiguousFromObject"},
   {&__pyx_n_ValueError, "ValueError"},
   {&__pyx_n___RandomState_ctor, "__RandomState_ctor"},
   {&__pyx_n__rand, "_rand"},

Modified: trunk/numpy/random/mtrand/numpy.pxi
===================================================================
--- trunk/numpy/random/mtrand/numpy.pxi	2006-08-01 06:36:28 UTC (rev 2941)
+++ trunk/numpy/random/mtrand/numpy.pxi	2006-08-01 20:23:15 UTC (rev 2942)
@@ -105,6 +105,8 @@
     int PyArray_Check(object obj)
     object PyArray_ContiguousFromAny(object obj, NPY_TYPES type, 
         int mindim, int maxdim)
+    object PyArray_ContiguousFromObject(object obj, NPY_TYPES type, 
+        int mindim, int maxdim)
     npy_intp PyArray_SIZE(ndarray arr)
     npy_intp PyArray_NBYTES(ndarray arr)
     void *PyArray_DATA(ndarray arr)



More information about the Numpy-svn mailing list