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

numpy-svn@scip... numpy-svn@scip...
Tue Feb 12 15:32:00 CST 2008


Author: rkern
Date: 2008-02-12 15:31:58 -0600 (Tue, 12 Feb 2008)
New Revision: 4790

Modified:
   trunk/numpy/random/mtrand/mtrand.c
   trunk/numpy/random/mtrand/mtrand.pyx
Log:
Make sure that multivariate_normal() uses the standard_normal() method rather than the function so as to use the same consistent state.

Modified: trunk/numpy/random/mtrand/mtrand.c
===================================================================
--- trunk/numpy/random/mtrand/mtrand.c	2008-02-12 18:19:37 UTC (rev 4789)
+++ trunk/numpy/random/mtrand/mtrand.c	2008-02-12 21:31:58 UTC (rev 4790)
@@ -1,16 +1,32 @@
-/* Generated by Pyrex 0.9.5.1a on Fri Nov 23 17:16:35 2007 */
+/* Generated by Pyrex 0.9.6.4 on Tue Feb 12 15:30:45 2008 */
 
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
+#if PY_VERSION_HEX < 0x02050000
+  typedef int Py_ssize_t;
+  #define PY_SSIZE_T_MAX INT_MAX
+  #define PY_SSIZE_T_MIN INT_MIN
+  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
+  #define PyInt_AsSsize_t(o)	PyInt_AsLong(o)
+#endif
+#ifndef WIN32
+  #ifndef __stdcall
+    #define __stdcall
+  #endif
+  #ifndef __cdecl
+    #define __cdecl
+  #endif
+#endif
 #ifdef __cplusplus
 #define __PYX_EXTERN_C extern "C"
 #else
 #define __PYX_EXTERN_C extern
 #endif
-__PYX_EXTERN_C double pow(double, double);
+#include <math.h>
 #include "string.h"
 #include "math.h"
 #include "numpy/arrayobject.h"
@@ -28,7 +44,7 @@
 static char *__pyx_filename;
 static char **__pyx_f;
 
-static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[],     Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
@@ -39,7 +55,7 @@
 static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
 static int __Pyx_EndUnpack(PyObject *); /*proto*/
 
-static PyObject *__Pyx_GetExcValue(void); /*proto*/
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
 static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
 
@@ -49,16 +65,34 @@
 
 static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
 
+static PyObject *__Pyx_ImportModule(char *name); /*proto*/
+
 static void __Pyx_AddTraceback(char *funcname); /*proto*/
 
 /* Declarations from mtrand */
 
+typedef double (*__pyx_t_6mtrand_rk_cont0)(rk_state *);
 
+typedef double (*__pyx_t_6mtrand_rk_cont1)(rk_state *,double);
+
+typedef double (*__pyx_t_6mtrand_rk_cont2)(rk_state *,double,double);
+
+typedef double (*__pyx_t_6mtrand_rk_cont3)(rk_state *,double,double,double);
+
+typedef long (*__pyx_t_6mtrand_rk_disc0)(rk_state *);
+
+typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *,long,double);
+
+typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *,long,long,long);
+
+typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *,double);
+
 struct __pyx_obj_6mtrand_RandomState {
   PyObject_HEAD
-  rk_state (*internal_state);
+  rk_state *internal_state;
 };
 
+
 static PyTypeObject *__pyx_ptype_6mtrand_dtype = 0;
 static PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;
 static PyTypeObject *__pyx_ptype_6mtrand_flatiter = 0;
@@ -123,26 +157,27 @@
 static PyObject *__pyx_k58;
 static PyObject *__pyx_k59;
 static PyObject *__pyx_k60;
-static PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/
-static PyObject *(__pyx_f_6mtrand_cont1_array_sc(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/
-static PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,PyArrayObject *)); /*proto*/
-static PyObject *(__pyx_f_6mtrand_cont2_array_sc(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/
-static PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,PyArrayObject *,PyArrayObject *)); /*proto*/
-static PyObject *(__pyx_f_6mtrand_cont3_array_sc(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/
-static PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *)); /*proto*/
-static PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/
-static PyObject *(__pyx_f_6mtrand_discnp_array_sc(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/
-static PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,PyArrayObject *,PyArrayObject *)); /*proto*/
-static PyObject *(__pyx_f_6mtrand_discnmN_array_sc(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/
-static PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *)); /*proto*/
-static PyObject *(__pyx_f_6mtrand_discd_array_sc(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/
-static PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,PyArrayObject *)); /*proto*/
-static double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *,__pyx_t_6mtrand_rk_cont0,PyObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *,__pyx_t_6mtrand_rk_cont1,PyObject *,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *,__pyx_t_6mtrand_rk_cont1,PyObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *,__pyx_t_6mtrand_rk_cont2,PyObject *,double,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *,__pyx_t_6mtrand_rk_cont2,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *,__pyx_t_6mtrand_rk_cont3,PyObject *,double,double,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *,__pyx_t_6mtrand_rk_cont3,PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *,__pyx_t_6mtrand_rk_disc0,PyObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,long,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,long,long,long); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *,__pyx_t_6mtrand_rk_discd,PyObject *,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_discd_array(rk_state *,__pyx_t_6mtrand_rk_discd,PyObject *,PyArrayObject *); /*proto*/
+static double __pyx_f_6mtrand_kahan_sum(double *,long); /*proto*/
 
 
 /* Implementation of mtrand */
 
 
+static PyObject *__pyx_n_numpy;
 static PyObject *__pyx_n__sp;
 static PyObject *__pyx_n__rand;
 static PyObject *__pyx_n_seed;
@@ -191,13 +226,12 @@
 static PyObject *__pyx_n_dirichlet;
 static PyObject *__pyx_n_shuffle;
 static PyObject *__pyx_n_permutation;
-static PyObject *__pyx_n_numpy;
 
 static PyObject *__pyx_n_empty;
 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);
+static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont0 __pyx_v_func,PyObject *__pyx_v_size) {
+  double *__pyx_v_array_data;
   PyArrayObject *arrayObject;
   long __pyx_v_length;
   long __pyx_v_i;
@@ -209,11 +243,9 @@
   Py_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":129 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":129 */
   __pyx_1 = __pyx_v_size == Py_None;
   if (__pyx_1) {
-
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":130 */
     __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
     __pyx_r = __pyx_2;
     __pyx_2 = 0;
@@ -222,7 +254,7 @@
   }
   /*else*/ {
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":132 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":132 */
     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
@@ -242,20 +274,18 @@
     arrayObject = ((PyArrayObject *)__pyx_4);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":133 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":133 */
     __pyx_v_length = PyArray_SIZE(arrayObject);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":134 */
-    __pyx_v_array_data = ((double (*))arrayObject->data);
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":134 */
+    __pyx_v_array_data = ((double *)arrayObject->data);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":135 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
-
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":136 */
       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
     }
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":137 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":137 */
     Py_INCREF(((PyObject *)arrayObject));
     __pyx_r = ((PyObject *)arrayObject);
     goto __pyx_L0;
@@ -276,8 +306,8 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {
-  double (*__pyx_v_array_data);
+static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont1 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a) {
+  double *__pyx_v_array_data;
   PyArrayObject *arrayObject;
   long __pyx_v_length;
   long __pyx_v_i;
@@ -289,11 +319,9 @@
   Py_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":146 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":146 */
   __pyx_1 = __pyx_v_size == Py_None;
   if (__pyx_1) {
-
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":147 */
     __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
     __pyx_r = __pyx_2;
     __pyx_2 = 0;
@@ -302,7 +330,7 @@
   }
   /*else*/ {
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":149 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":149 */
     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
@@ -322,20 +350,18 @@
     arrayObject = ((PyArrayObject *)__pyx_4);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":150 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":150 */
     __pyx_v_length = PyArray_SIZE(arrayObject);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":151 */
-    __pyx_v_array_data = ((double (*))arrayObject->data);
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":151 */
+    __pyx_v_array_data = ((double *)arrayObject->data);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":152 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":152 */
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
-
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":153 */
       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);
     }
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":154 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":154 */
     Py_INCREF(((PyObject *)arrayObject));
     __pyx_r = ((PyObject *)arrayObject);
     goto __pyx_L0;
@@ -360,11 +386,11 @@
 
 static PyObject *__pyx_k61p;
 
-static char (__pyx_k61[]) = "size is not compatible with inputs";
+static char __pyx_k61[] = "size is not compatible with inputs";
 
-static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa) {
-  double (*__pyx_v_array_data);
-  double (*__pyx_v_oa_data);
+static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont1 __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa) {
+  double *__pyx_v_array_data;
+  double *__pyx_v_oa_data;
   PyArrayObject *arrayObject;
   npy_intp __pyx_v_length;
   npy_intp __pyx_v_i;
@@ -382,44 +408,44 @@
   __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":165 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":165 */
   __pyx_1 = __pyx_v_size == Py_None;
   if (__pyx_1) {
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":166 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":166 */
     __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
     Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
     Py_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_2);
     Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":167 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":167 */
     __pyx_v_length = PyArray_SIZE(arrayObject);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":168 */
-    __pyx_v_array_data = ((double (*))arrayObject->data);
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":168 */
+    __pyx_v_array_data = ((double *)arrayObject->data);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":169 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */
     __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
     Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2)));
     Py_DECREF(((PyObject *)__pyx_v_itera));
     __pyx_v_itera = ((PyArrayIterObject *)__pyx_2);
     Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":170 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":170 */
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":171 */
-      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double (*))__pyx_v_itera->dataptr)[0]));
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":171 */
+      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0]));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":172 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":172 */
       PyArray_ITER_NEXT(__pyx_v_itera);
     }
     goto __pyx_L2;
   }
   /*else*/ {
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":174 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":174 */
     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
@@ -439,21 +465,19 @@
     arrayObject = ((PyArrayObject *)__pyx_4);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":175 */
-    __pyx_v_array_data = ((double (*))arrayObject->data);
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":175 */
+    __pyx_v_array_data = ((double *)arrayObject->data);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":176 */
-    __pyx_3 = PyArray_MultiIterNew(2,((void (*))arrayObject),((void (*))__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":176 */
+    __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
     Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3)));
     Py_DECREF(((PyObject *)__pyx_v_multi));
     __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3);
     Py_DECREF(__pyx_3); __pyx_3 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":178 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":178 */
     __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
     if (__pyx_1) {
-
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":179 */
       __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
       __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
       Py_INCREF(__pyx_k61p);
@@ -468,23 +492,23 @@
     }
     __pyx_L5:;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":180 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":180 */
     __pyx_5 = __pyx_v_multi->size;
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":181 */
-      __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1));
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":181 */
+      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":182 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":182 */
       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":183 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":183 */
       PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
     }
   }
   __pyx_L2:;
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":184 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":184 */
   Py_INCREF(((PyObject *)arrayObject));
   __pyx_r = ((PyObject *)arrayObject);
   goto __pyx_L0;
@@ -506,8 +530,8 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {
-  double (*__pyx_v_array_data);
+static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont2 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {
+  double *__pyx_v_array_data;
   PyArrayObject *arrayObject;
   long __pyx_v_length;
   long __pyx_v_i;
@@ -519,11 +543,9 @@
   Py_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":193 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":193 */
   __pyx_1 = __pyx_v_size == Py_None;
   if (__pyx_1) {
-
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":194 */
     __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
     __pyx_r = __pyx_2;
     __pyx_2 = 0;
@@ -532,7 +554,7 @@
   }
   /*else*/ {
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":196 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":196 */
     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
@@ -552,20 +574,18 @@
     arrayObject = ((PyArrayObject *)__pyx_4);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":197 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":197 */
     __pyx_v_length = PyArray_SIZE(arrayObject);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":198 */
-    __pyx_v_array_data = ((double (*))arrayObject->data);
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":198 */
+    __pyx_v_array_data = ((double *)arrayObject->data);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":199 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
-
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":200 */
       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);
     }
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":201 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":201 */
     Py_INCREF(((PyObject *)arrayObject));
     __pyx_r = ((PyObject *)arrayObject);
     goto __pyx_L0;
@@ -588,12 +608,12 @@
 
 static PyObject *__pyx_k62p;
 
-static char (__pyx_k62[]) = "size is not compatible with inputs";
+static char __pyx_k62[] = "size is not compatible with inputs";
 
-static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa,PyArrayObject *__pyx_v_ob) {
-  double (*__pyx_v_array_data);
-  double (*__pyx_v_oa_data);
-  double (*__pyx_v_ob_data);
+static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont2 __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa,PyArrayObject *__pyx_v_ob) {
+  double *__pyx_v_array_data;
+  double *__pyx_v_oa_data;
+  double *__pyx_v_ob_data;
   PyArrayObject *arrayObject;
   npy_intp __pyx_v_i;
   PyArrayMultiIterObject *__pyx_v_multi;
@@ -609,48 +629,48 @@
   arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":214 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":214 */
   __pyx_1 = __pyx_v_size == Py_None;
   if (__pyx_1) {
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":215 */
-    __pyx_2 = PyArray_MultiIterNew(2,((void (*))__pyx_v_oa),((void (*))__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":215 */
+    __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
     Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
     Py_DECREF(((PyObject *)__pyx_v_multi));
     __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
     Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":216 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":216 */
     __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
     Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
     Py_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_2);
     Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":217 */
-    __pyx_v_array_data = ((double (*))arrayObject->data);
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":217 */
+    __pyx_v_array_data = ((double *)arrayObject->data);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":218 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":218 */
     __pyx_3 = __pyx_v_multi->size;
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":219 */
-      __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,0));
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":219 */
+      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":220 */
-      __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1));
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":220 */
+      __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":221 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":221 */
       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":222 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":222 */
       PyArray_MultiIter_NEXT(__pyx_v_multi);
     }
     goto __pyx_L2;
   }
   /*else*/ {
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":224 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":224 */
     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
     __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
@@ -670,21 +690,19 @@
     arrayObject = ((PyArrayObject *)__pyx_5);
     Py_DECREF(__pyx_5); __pyx_5 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":225 */
-    __pyx_v_array_data = ((double (*))arrayObject->data);
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":225 */
+    __pyx_v_array_data = ((double *)arrayObject->data);
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":226 */
-    __pyx_4 = PyArray_MultiIterNew(3,((void (*))arrayObject),((void (*))__pyx_v_oa),((void (*))__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":226 */
+    __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
     Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
     Py_DECREF(((PyObject *)__pyx_v_multi));
     __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
     Py_DECREF(__pyx_4); __pyx_4 = 0;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":227 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":227 */
     __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
     if (__pyx_1) {
-
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":228 */
       __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
       __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
       Py_INCREF(__pyx_k62p);
@@ -699,29 +717,29 @@
     }
     __pyx_L5:;
 
-    /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":229 */
+    /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":229 */
     __pyx_3 = __pyx_v_multi->size;
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":230 */
-      __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1));
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":230 */
+      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":231 */
-      __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2));
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":231 */
+      __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":232 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":232 */
       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":233 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":233 */
       PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
 
-      /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":234 */
+      /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":234 */
       PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
     }
   }
   __pyx_L2:;
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":235 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":235 */
   Py_INCREF(((PyObject *)arrayObject));
   __pyx_r = ((PyObject *)arrayObject);
   goto __pyx_L0;
@@ -743,8 +761,8 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {
-  double (*__pyx_v_array_data);
+static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont3 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {
+  double *__pyx_v_array_data;
   PyArrayObject *arrayObject;
   long __pyx_v_length;
   long __pyx_v_i;
@@ -756,11 +774,9 @@
   Py_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
 
-  /* "/home/stefan/work/scipy/numpy.patch/numpy/random/mtrand/mtrand.pyx":245 */
+  /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":245 */
   __pyx_1 = __pyx_v_size == Py_None;
   if (__pyx_1) {
-
-    /* &quo