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

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 20:46:31 CST 2010


Author: ptvirtan
Date: 2010-02-20 20:46:29 -0600 (Sat, 20 Feb 2010)
New Revision: 8200

Modified:
   trunk/numpy/random/mtrand/mtrand.c
Log:
3K: ENH: regenerate mtrand.c with a newer Cython, for better Python 3 compatibility

Modified: trunk/numpy/random/mtrand/mtrand.c
===================================================================
--- trunk/numpy/random/mtrand/mtrand.c	2010-02-21 02:46:08 UTC (rev 8199)
+++ trunk/numpy/random/mtrand/mtrand.c	2010-02-21 02:46:29 UTC (rev 8200)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.11.3 on Mon Nov 23 22:36:25 2009 */
+/* Generated by Cython 0.12.1 on Sat Feb 20 22:47:50 2010 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -6,6 +6,7 @@
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
 #else
+
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
@@ -15,7 +16,9 @@
 #if PY_VERSION_HEX < 0x02040000
   #define METH_COEXIST 0
   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
@@ -25,7 +28,9 @@
   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
   #define PyNumber_Index(o)    PyNumber_Int(o)
   #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
 #endif
+
 #if PY_VERSION_HEX < 0x02060000
   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
@@ -35,17 +40,17 @@
   #define PyType_Modified(t)
 
   typedef struct {
-       void *buf;
-       PyObject *obj;
-       Py_ssize_t len;
-       Py_ssize_t itemsize;
-       int readonly;
-       int ndim;
-       char *format;
-       Py_ssize_t *shape;
-       Py_ssize_t *strides;
-       Py_ssize_t *suboffsets;
-       void *internal;
+     void *buf;
+     PyObject *obj;
+     Py_ssize_t len;
+     Py_ssize_t itemsize;
+     int readonly;
+     int ndim;
+     char *format;
+     Py_ssize_t *shape;
+     Py_ssize_t *strides;
+     Py_ssize_t *suboffsets;
+     void *internal;
   } Py_buffer;
 
   #define PyBUF_SIMPLE 0
@@ -59,22 +64,32 @@
   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
 
 #endif
+
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
 #endif
+
 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
-  #define PyString_Type                PyBytes_Type
-  #define PyString_CheckExact          PyBytes_CheckExact
+  #define PyString_Type                PyUnicode_Type
+  #define PyString_CheckExact          PyUnicode_CheckExact
+#else
+  #define PyBytes_Type                 PyString_Type
+  #define PyBytes_CheckExact           PyString_CheckExact
+#endif
+
+#if PY_MAJOR_VERSION >= 3
   #define PyInt_Type                   PyLong_Type
   #define PyInt_Check(op)              PyLong_Check(op)
   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
@@ -89,13 +104,17 @@
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 #else
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define PyBytes_Type                 PyString_Type
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
 #endif
+
 #if !defined(WIN32) && !defined(MS_WINDOWS)
   #ifndef __stdcall
     #define __stdcall
@@ -109,6 +128,7 @@
 #else
   #define _USE_MATH_DEFINES
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
@@ -118,6 +138,7 @@
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_NAMESTR(n) ((char *)(n))
   #define __Pyx_DOCSTR(n)  ((char *)(n))
@@ -139,24 +160,20 @@
 #include "randomkit.h"
 #include "distributions.h"
 #include "initarray.h"
-#define __PYX_USE_C99_COMPLEX defined(_Complex_I)
 
-
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE 
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #else
+    #define CYTHON_INLINE 
+  #endif
 #endif
 
-typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
 
 
-
-static int __pyx_skip_dispatch = 0;
-
-
 /* Type Conversion Predeclarations */
 
 #if PY_MAJOR_VERSION < 3
@@ -173,8 +190,8 @@
 #define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
 
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
 #if !defined(T_PYSSIZET)
 #if PY_VERSION_HEX < 0x02050000
@@ -238,9 +255,9 @@
 #endif
 #endif
 
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
@@ -270,35 +287,84 @@
 static const char **__pyx_f;
 
 
-#ifdef CYTHON_REFNANNY
-typedef struct {
-  void (*INCREF)(void*, PyObject*, int);
-  void (*DECREF)(void*, PyObject*, int);
-  void (*GOTREF)(void*, PyObject*, int);
-  void (*GIVEREF)(void*, PyObject*, int);
-  void* (*NewContext)(const char*, int, const char*);
-  void (*FinishContext)(void**);
-} __Pyx_RefnannyAPIStruct;
-static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
-#define __Pyx_ImportRefcountAPI(name)   (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
-#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
-#define __Pyx_SetupRefcountContext(name)   void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
-#define __Pyx_FinishRefcountContext()   __Pyx_Refnanny->FinishContext(&__pyx_refchk)
+/* Type declarations */
+
+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_discdd)(rk_state *, double, double);
+
+typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *, long, long, long);
+
+typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *, double);
+
+/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":522
+ *     return sum
+ * 
+ * cdef class RandomState:             # <<<<<<<<<<<<<<
+ *     """
+ *     RandomState(seed=None)
+ */
+
+struct __pyx_obj_6mtrand_RandomState {
+  PyObject_HEAD
+  rk_state *internal_state;
+};
+
+#ifndef CYTHON_REFNANNY
+  #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+  typedef struct {
+    void (*INCREF)(void*, PyObject*, int);
+    void (*DECREF)(void*, PyObject*, int);
+    void (*GOTREF)(void*, PyObject*, int);
+    void (*GIVEREF)(void*, PyObject*, int);
+    void* (*SetupContext)(const char*, int, const char*);
+    void (*FinishContext)(void**);
+  } __Pyx_RefNannyAPIStruct;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
+    PyObject *m = NULL, *p = NULL;
+    void *r = NULL;
+    m = PyImport_ImportModule((char *)modname);
+    if (!m) goto end;
+    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+    if (!p) goto end;
+    r = PyLong_AsVoidPtr(p);
+  end:
+    Py_XDECREF(p);
+    Py_XDECREF(m);
+    return (__Pyx_RefNannyAPIStruct *)r;
+  }
+  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
 #else
-#define __Pyx_INCREF(r) Py_INCREF(r)
-#define __Pyx_DECREF(r) Py_DECREF(r)
-#define __Pyx_GOTREF(r)
-#define __Pyx_GIVEREF(r)
-#define __Pyx_XDECREF(r) Py_XDECREF(r)
-#define __Pyx_SetupRefcountContext(name)
-#define __Pyx_FinishRefcountContext()
+  #define __Pyx_RefNannySetupContext(name)
+  #define __Pyx_RefNannyFinishContext()
+  #define __Pyx_INCREF(r) Py_INCREF(r)
+  #define __Pyx_DECREF(r) Py_DECREF(r)
+  #define __Pyx_GOTREF(r)
+  #define __Pyx_GIVEREF(r)
+  #define __Pyx_XDECREF(r) Py_XDECREF(r)
 #endif /* CYTHON_REFNANNY */
-#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
-#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)
+#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
+#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
 
 static void __Pyx_RaiseDoubleKeywordsError(
     const char* func_name, PyObject* kw_name); /*proto*/
@@ -309,7 +375,7 @@
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
 
 
-static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
     PyObject *r;
     if (!j) return NULL;
     r = PyObject_GetItem(o, j);
@@ -322,7 +388,7 @@
                                                     __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \
                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
 
-static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
     if (likely(o != Py_None)) {
         if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
             PyObject *r = PyList_GET_ITEM(o, i);
@@ -342,7 +408,7 @@
                                                     __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
 
-static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
     if (likely(o != Py_None)) {
         if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
             PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -363,7 +429,7 @@
                                                     __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
 
-static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
     PyObject *r;
     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
         r = PyList_GET_ITEM(o, i);
@@ -382,18 +448,41 @@
     return r;
 }
 
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);
+
+static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
+static int __Pyx_EndUnpack(PyObject *); /*proto*/
+
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
-static INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
+static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
     const char* function_name, int kw_allowed); /*proto*/
 
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
 
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
+    if (likely(PyList_CheckExact(L))) {
+        if (PyList_Append(L, x) < 0) return NULL;
+        Py_INCREF(Py_None);
+        return Py_None; /* this is just to have an accurate signature */
+    }
+    else {
+        PyObject *r, *m;
+        m = __Pyx_GetAttrString(L, "append");
+        if (!m) return NULL;
+        r = PyObject_CallFunctionObjArgs(m, x, NULL);
+        Py_DECREF(m);
+        return r;
+    }
+}
+
 #define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
                                                     __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \
                                                     __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
 
-static INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
     int r;
     if (!j) return -1;
     r = PyObject_SetItem(o, j, v);
@@ -401,7 +490,7 @@
     return r;
 }
 
-static INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) {
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) {
     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
         Py_INCREF(v);
         Py_DECREF(PyList_GET_ITEM(o, i));
@@ -416,111 +505,55 @@
     }
 }
 
-static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
-static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
 
-static INLINE void __Pyx_RaiseTooManyValuesError(void);
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
 
-static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
-static int __Pyx_EndUnpack(PyObject *); /*proto*/
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
 
-static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
-    if (likely(PyList_CheckExact(L))) {
-        if (PyList_Append(L, x) < 0) return NULL;
-        Py_INCREF(Py_None);
-        return Py_None; /* this is just to have an accurate signature */
-    }
-    else {
-        PyObject *r, *m;
-        m = __Pyx_GetAttrString(L, "append");
-        if (!m) return NULL;
-        r = PyObject_CallFunctionObjArgs(m, x, NULL);
-        Py_DECREF(m);
-        return r;
-    }
-}
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
 
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
 
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
 
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
 
-static INLINE char __Pyx_PyInt_AsChar(PyObject *);
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
 
-static INLINE short __Pyx_PyInt_AsShort(PyObject *);
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
 
-static INLINE int __Pyx_PyInt_AsInt(PyObject *);
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
 
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
 
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
 
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
 
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
 
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/
 
-static INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size);  /*proto*/
-
 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
 
 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
 
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-/* Type declarations */
-
-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_discdd)(rk_state *, double, double);
-
-typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *, long, long, long);
-
-typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *, double);
-
-/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":522
- *     return sum
- * 
- * cdef class RandomState:             # <<<<<<<<<<<<<<
- *     """
- *     RandomState(seed=None)
- */
-
-struct __pyx_obj_6mtrand_RandomState {
-  PyObject_HEAD
-  rk_state *internal_state;
-};
 /* Module declarations from numpy */
 
 /* Module declarations from mtrand */
@@ -530,22 +563,6 @@
 static PyTypeObject *__pyx_ptype_6mtrand_flatiter = 0;
 static PyTypeObject *__pyx_ptype_6mtrand_broadcast = 0;
 static PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;
-static PyObject *__pyx_k_3 = 0;
-static PyObject *__pyx_k_4 = 0;
-static PyObject *__pyx_k_5 = 0;
-static PyObject *__pyx_k_6 = 0;
-static PyObject *__pyx_k_7 = 0;
-static PyObject *__pyx_k_8 = 0;
-static PyObject *__pyx_k_9 = 0;
-static PyObject *__pyx_k_10 = 0;
-static PyObject *__pyx_k_11 = 0;
-static PyObject *__pyx_k_12 = 0;
-static PyObject *__pyx_k_13 = 0;
-static PyObject *__pyx_k_14 = 0;
-static PyObject *__pyx_k_15 = 0;
-static PyObject *__pyx_k_16 = 0;
-static PyObject *__pyx_k_17 = 0;
-static PyObject *__pyx_k_18 = 0;
 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*/
@@ -567,461 +584,441 @@
 int __pyx_module_is_main_mtrand = 0;
 
 /* Implementation of mtrand */
-static PyObject *__pyx_int_624;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_TypeError;
+static char __pyx_k_1[] = "size is not compatible with inputs";
+static char __pyx_k_2[] = "algorithm must be 'MT19937'";
+static char __pyx_k_3[] = "state must be 624 longs";
+static char __pyx_k_4[] = "low >= high";
+static char __pyx_k_9[] = "scale <= 0";
+static char __pyx_k_10[] = "a <= 0";
+static char __pyx_k_11[] = "b <= 0";
+static char __pyx_k_13[] = "shape <= 0";
+static char __pyx_k_15[] = "dfnum <= 0";
+static char __pyx_k_16[] = "dfden <= 0";
+static char __pyx_k_17[] = "dfnum <= 1";
+static char __pyx_k_18[] = "nonc < 0";
+static char __pyx_k_19[] = "df <= 0";
+static char __pyx_k_20[] = "nonc <= 0";
+static char __pyx_k_21[] = "df <= 1";
+static char __pyx_k_22[] = "kappa < 0";
+static char __pyx_k_31[] = "sigma <= 0";
+static char __pyx_k_32[] = "sigma <= 0.0";
+static char __pyx_k_34[] = "scale <= 0.0";
+static char __pyx_k_35[] = "mean <= 0";
+static char __pyx_k_36[] = "mean <= 0.0";
+static char __pyx_k_37[] = "left > mode";
+static char __pyx_k_38[] = "mode > right";
+static char __pyx_k_39[] = "left == right";
+static char __pyx_k_40[] = "n <= 0";
+static char __pyx_k_41[] = "p < 0";
+static char __pyx_k_42[] = "p > 1";
+static char __pyx_k_44[] = "lam < 0";
+static char __pyx_k_45[] = "a <= 1.0";
+static char __pyx_k_46[] = "p < 0.0";
+static char __pyx_k_47[] = "p > 1.0";
+static char __pyx_k_48[] = "ngood < 1";
+static char __pyx_k_49[] = "nbad < 1";
+static char __pyx_k_50[] = "nsample < 1";
+static char __pyx_k_51[] = "ngood + nbad < nsample";
+static char __pyx_k_52[] = "p <= 0.0";
+static char __pyx_k_53[] = "p >= 1.0";
+static char __pyx_k_54[] = "mean must be 1 dimensional";
+static char __pyx_k_55[] = "cov must be 2 dimensional and square";
+static char __pyx_k_56[] = "mean and cov must have same length";
+static char __pyx_k_57[] = "numpy.dual";
+static char __pyx_k_58[] = "sum(pvals[:-1]) > 1.0";
+static char __pyx_k_59[] = "standard_exponential";
+static char __pyx_k_60[] = "noncentral_chisquare";
+static char __pyx_k_61[] = "RandomState.seed (line 567)";
+static char __pyx_k_62[] = "RandomState.get_state (line 600)";
+static char __pyx_k_63[] = "RandomState.set_state (line 637)";
+static char __pyx_k_64[] = "RandomState.random_sample (line 718)";
+static char __pyx_k_65[] = "RandomState.tomaxint (line 761)";
+static char __pyx_k_66[] = "RandomState.randint (line 789)";
+static char __pyx_k_67[] = "RandomState.bytes (line 866)";
+static char __pyx_k_68[] = "RandomState.uniform (line 893)";
+static char __pyx_k_69[] = "RandomState.rand (line 981)";
+static char __pyx_k_70[] = "RandomState.randn (line 1024)";
+static char __pyx_k_71[] = "RandomState.random_integers (line 1080)";
+static char __pyx_k_72[] = "RandomState.standard_normal (line 1158)";
+static char __pyx_k_73[] = "RandomState.normal (line 1190)";
+static char __pyx_k_74[] = "RandomState.beta (line 1290)";
+static char __pyx_k_75[] = "RandomState.exponential (line 1349)";
+static char __pyx_k_76[] = "RandomState.standard_exponential (line 1403)";
+static char __pyx_k_77[] = "RandomState.standard_gamma (line 1431)";
+static char __pyx_k_78[] = "RandomState.gamma (line 1513)";
+static char __pyx_k_79[] = "RandomState.f (line 1604)";
+static char __pyx_k_80[] = "RandomState.noncentral_f (line 1707)";
+static char __pyx_k_81[] = "RandomState.chisquare (line 1802)";
+static char __pyx_k_82[] = "RandomState.noncentral_chisquare (line 1882)";
+static char __pyx_k_83[] = "RandomState.standard_cauchy (line 1974)";
+static char __pyx_k_84[] = "RandomState.standard_t (line 2035)";
+static char __pyx_k_85[] = "RandomState.vonmises (line 2136)";
+static char __pyx_k_86[] = "RandomState.pareto (line 2231)";
+static char __pyx_k_87[] = "RandomState.weibull (line 2320)";
+static char __pyx_k_88[] = "RandomState.power (line 2420)";
+static char __pyx_k_89[] = "RandomState.laplace (line 2529)";
+static char __pyx_k_90[] = "RandomState.gumbel (line 2619)";
+static char __pyx_k_91[] = "RandomState.logistic (line 2743)";
+static char __pyx_k_92[] = "RandomState.lognormal (line 2831)";
+static char __pyx_k_93[] = "RandomState.rayleigh (line 2962)";
+static char __pyx_k_94[] = "RandomState.wald (line 3034)";
+static char __pyx_k_95[] = "RandomState.triangular (line 3120)";
+static char __pyx_k_96[] = "RandomState.binomial (line 3208)";
+static char __pyx_k_97[] = "RandomState.negative_binomial (line 3316)";
+static char __pyx_k_98[] = "RandomState.poisson (line 3411)";
+static char __pyx_k_99[] = "RandomState.zipf (line 3474)";
+static char __pyx_k__a[] = "a";
+static char __pyx_k__b[] = "b";
+static char __pyx_k__f[] = "f";
+static char __pyx_k__n[] = "n";
+static char __pyx_k__p[] = "p";
+static char __pyx_k_100[] = "RandomState.geometric (line 3566)";
+static char __pyx_k_101[] = "RandomState.hypergeometric (line 3632)";
+static char __pyx_k_102[] = "RandomState.logseries (line 3751)";
+static char __pyx_k_103[] = "RandomState.multivariate_normal (line 3846)";
+static char __pyx_k_104[] = "RandomState.multinomial (line 3979)";
+static char __pyx_k_105[] = "RandomState.dirichlet (line 4072)";
+static char __pyx_k_106[] = "RandomState.shuffle (line 4166)";
+static char __pyx_k_107[] = "RandomState.permutation (line 4202)";
+static char __pyx_k__df[] = "df";
+static char __pyx_k__mu[] = "mu";
+static char __pyx_k__nd[] = "nd";
+static char __pyx_k__np[] = "np";
+static char __pyx_k__add[] = "add";
+static char __pyx_k__any[] = "any";
+static char __pyx_k__cov[] = "cov";
+static char __pyx_k__dot[] = "dot";
+static char __pyx_k__key[] = "key";
+static char __pyx_k__lam[] = "lam";
+static char __pyx_k__loc[] = "loc";
+static char __pyx_k__low[] = "low";
+static char __pyx_k__pos[] = "pos";
+static char __pyx_k__svd[] = "svd";
+static char __pyx_k__beta[] = "beta";
+static char __pyx_k__copy[] = "copy";
+static char __pyx_k__data[] = "data";
+static char __pyx_k__high[] = "high";
+static char __pyx_k__left[] = "left";
+static char __pyx_k__less[] = "less";
+static char __pyx_k__mean[] = "mean";
+static char __pyx_k__mode[] = "mode";
+static char __pyx_k__nbad[] = "nbad";
+static char __pyx_k__nonc[] = "nonc";
+static char __pyx_k__rand[] = "rand";
+static char __pyx_k__seed[] = "seed";
+static char __pyx_k__size[] = "size";
+static char __pyx_k__sqrt[] = "sqrt";
+static char __pyx_k__uint[] = "uint";
+static char __pyx_k__wald[] = "wald";
+static char __pyx_k__zipf[] = "zipf";
+static char __pyx_k___rand[] = "_rand";
+static char __pyx_k__alpha[] = "alpha";
+static char __pyx_k__array[] = "array";
+static char __pyx_k__bytes[] = "bytes";
+static char __pyx_k__dfden[] = "dfden";
+static char __pyx_k__dfnum[] = "dfnum";
+static char __pyx_k__empty[] = "empty";
+static char __pyx_k__equal[] = "equal";
+static char __pyx_k__gamma[] = "gamma";
+static char __pyx_k__gauss[] = "gauss";
+static char __pyx_k__kappa[] = "kappa";
+static char __pyx_k__ngood[] = "ngood";
+static char __pyx_k__numpy[] = "numpy";
+static char __pyx_k__power[] = "power";
+static char __pyx_k__pvals[] = "pvals";
+static char __pyx_k__randn[] = "randn";
+static char __pyx_k__right[] = "right";
+static char __pyx_k__scale[] = "scale";
+static char __pyx_k__shape[] = "shape";
+static char __pyx_k__sigma[] = "sigma";
+static char __pyx_k__zeros[] = "zeros";
+static char __pyx_k__arange[] = "arange";
+static char __pyx_k__gumbel[] = "gumbel";
+static char __pyx_k__normal[] = "normal";
+static char __pyx_k__pareto[] = "pareto";
+static char __pyx_k__random[] = "random";
+static char __pyx_k__reduce[] = "reduce";
+static char __pyx_k__uint32[] = "uint32";
+static char __pyx_k__MT19937[] = "MT19937";
+static char __pyx_k__asarray[] = "asarray";
+static char __pyx_k__dataptr[] = "dataptr";
+static char __pyx_k__float64[] = "float64";
+static char __pyx_k__greater[] = "greater";
+static char __pyx_k__integer[] = "integer";
+static char __pyx_k__laplace[] = "laplace";
+static char __pyx_k__nsample[] = "nsample";
+static char __pyx_k__poisson[] = "poisson";
+static char __pyx_k__randint[] = "randint";
+static char __pyx_k__shuffle[] = "shuffle";
+static char __pyx_k__uniform[] = "uniform";
+static char __pyx_k__weibull[] = "weibull";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k____test__[] = "__test__";
+static char __pyx_k__binomial[] = "binomial";
+static char __pyx_k__logistic[] = "logistic";
+static char __pyx_k__multiply[] = "multiply";
+static char __pyx_k__rayleigh[] = "rayleigh";
+static char __pyx_k__subtract[] = "subtract";
+static char __pyx_k__tomaxint[] = "tomaxint";
+static char __pyx_k__vonmises[] = "vonmises";
+static char __pyx_k__TypeError[] = "TypeError";
+static char __pyx_k__chisquare[] = "chisquare";
+static char __pyx_k__dirichlet[] = "dirichlet";
+static char __pyx_k__geometric[] = "geometric";
+static char __pyx_k__get_state[] = "get_state";
+static char __pyx_k__has_gauss[] = "has_gauss";
+static char __pyx_k__lognormal[] = "lognormal";
+static char __pyx_k__logseries[] = "logseries";
+static char __pyx_k__set_state[] = "set_state";
+static char __pyx_k__ValueError[] = "ValueError";
+static char __pyx_k__dimensions[] = "dimensions";
+static char __pyx_k__less_equal[] = "less_equal";
+static char __pyx_k__standard_t[] = "standard_t";
+static char __pyx_k__triangular[] = "triangular";
+static char __pyx_k__RandomState[] = "RandomState";
+static char __pyx_k__exponential[] = "exponential";
+static char __pyx_k__multinomial[] = "multinomial";
+static char __pyx_k__permutation[] = "permutation";
+static char __pyx_k__noncentral_f[] = "noncentral_f";
+static char __pyx_k__greater_equal[] = "greater_equal";
+static char __pyx_k__random_sample[] = "random_sample";
+static char __pyx_k__hypergeometric[] = "hypergeometric";
+static char __pyx_k__internal_state[] = "internal_state";
+static char __pyx_k__standard_gamma[] = "standard_gamma";
+static char __pyx_k__random_integers[] = "random_integers";
+static char __pyx_k__standard_cauchy[] = "standard_cauchy";
+static char __pyx_k__standard_normal[] = "standard_normal";
+static char __pyx_k__negative_binomial[] = "negative_binomial";
+static char __pyx_k____RandomState_ctor[] = "__RandomState_ctor";
+static char __pyx_k__multivariate_normal[] = "multivariate_normal";
+static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_kp_s_10;
+static PyObject *__pyx_kp_u_100;
+static PyObject *__pyx_kp_u_101;
+static PyObject *__pyx_kp_u_102;
+static PyObject *__pyx_kp_u_103;
+static PyObject *__pyx_kp_u_104;
+static PyObject *__pyx_kp_u_105;
+static PyObject *__pyx_kp_u_106;
+static PyObject *__pyx_kp_u_107;
+static PyObject *__pyx_kp_s_11;
+static PyObject *__pyx_kp_s_13;
+static PyObject *__pyx_kp_s_15;
+static PyObject *__pyx_kp_s_16;
+static PyObject *__pyx_kp_s_17;
+static PyObject *__pyx_kp_s_18;
+static PyObject *__pyx_kp_s_19;
+static PyObject *__pyx_kp_s_2;
+static PyObject *__pyx_kp_s_20;
+static PyObject *__pyx_kp_s_21;
+static PyObject *__pyx_kp_s_22;
+static PyObject *__pyx_kp_s_3;
+static PyObject *__pyx_kp_s_31;
+static PyObject *__pyx_kp_s_32;
+static PyObject *__pyx_kp_s_34;
+static PyObject *__pyx_kp_s_35;
+static PyObject *__pyx_kp_s_36;
+static PyObject *__pyx_kp_s_37;
+static PyObject *__pyx_kp_s_38;
+static PyObject *__pyx_kp_s_39;
+static PyObject *__pyx_kp_s_4;
+static PyObject *__pyx_kp_s_40;
+static PyObject *__pyx_kp_s_41;
+static PyObject *__pyx_kp_s_42;
+static PyObject *__pyx_kp_s_44;
+static PyObject *__pyx_kp_s_45;
+static PyObject *__pyx_kp_s_46;
+static PyObject *__pyx_kp_s_47;
+static PyObject *__pyx_kp_s_48;
+static PyObject *__pyx_kp_s_49;
+static PyObject *__pyx_kp_s_50;
+static PyObject *__pyx_kp_s_51;
+static PyObject *__pyx_kp_s_52;
+static PyObject *__pyx_kp_s_53;
+static PyObject *__pyx_kp_s_54;
+static PyObject *__pyx_kp_s_55;
+static PyObject *__pyx_kp_s_56;
+static PyObject *__pyx_n_s_57;
+static PyObject *__pyx_kp_s_58;
+static PyObject *__pyx_n_s_59;
+static PyObject *__pyx_n_s_60;
+static PyObject *__pyx_kp_u_61;
+static PyObject *__pyx_kp_u_62;
+static PyObject *__pyx_kp_u_63;
+static PyObject *__pyx_kp_u_64;
+static PyObject *__pyx_kp_u_65;
+static PyObject *__pyx_kp_u_66;
+static PyObject *__pyx_kp_u_67;
+static PyObject *__pyx_kp_u_68;
+static PyObject *__pyx_kp_u_69;
+static PyObject *__pyx_kp_u_70;
+static PyObject *__pyx_kp_u_71;
+static PyObject *__pyx_kp_u_72;
+static PyObject *__pyx_kp_u_73;
+static PyObject *__pyx_kp_u_74;
+static PyObject *__pyx_kp_u_75;
+static PyObject *__pyx_kp_u_76;
+static PyObject *__pyx_kp_u_77;
+static PyObject *__pyx_kp_u_78;
+static PyObject *__pyx_kp_u_79;
+static PyObject *__pyx_kp_u_80;
+static PyObject *__pyx_kp_u_81;
+static PyObject *__pyx_kp_u_82;
+static PyObject *__pyx_kp_u_83;
+static PyObject *__pyx_kp_u_84;
+static PyObject *__pyx_kp_u_85;
+static PyObject *__pyx_kp_u_86;
+static PyObject *__pyx_kp_u_87;
+static PyObject *__pyx_kp_u_88;
+static PyObject *__pyx_kp_u_89;
+static PyObject *__pyx_kp_s_9;
+static PyObject *__pyx_kp_u_90;
+static PyObject *__pyx_kp_u_91;
+static PyObject *__pyx_kp_u_92;
+static PyObject *__pyx_kp_u_93;
+static PyObject *__pyx_kp_u_94;
+static PyObject *__pyx_kp_u_95;
+static PyObject *__pyx_kp_u_96;
+static PyObject *__pyx_kp_u_97;
+static PyObject *__pyx_kp_u_98;
+static PyObject *__pyx_kp_u_99;
+static PyObject *__pyx_n_s__MT19937;
+static PyObject *__pyx_n_s__RandomState;
+static PyObject *__pyx_n_s__TypeError;
+static PyObject *__pyx_n_s__ValueError;
+static PyObject *__pyx_n_s____RandomState_ctor;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s____test__;
+static PyObject *__pyx_n_s___rand;
+static PyObject *__pyx_n_s__a;
+static PyObject *__pyx_n_s__add;
+static PyObject *__pyx_n_s__alpha;
+static PyObject *__pyx_n_s__any;
+static PyObject *__pyx_n_s__arange;
+static PyObject *__pyx_n_s__array;
+static PyObject *__pyx_n_s__asarray;
+static PyObject *__pyx_n_s__b;
+static PyObject *__pyx_n_s__beta;
+static PyObject *__pyx_n_s__binomial;
+static PyObject *__pyx_n_s__bytes;
+static PyObject *__pyx_n_s__chisquare;
+static PyObject *__pyx_n_s__copy;
+static PyObject *__pyx_n_s__cov;
+static PyObject *__pyx_n_s__data;
+static PyObject *__pyx_n_s__dataptr;
+static PyObject *__pyx_n_s__df;
+static PyObject *__pyx_n_s__dfden;
+static PyObject *__pyx_n_s__dfnum;
+static PyObject *__pyx_n_s__dimensions;
+static PyObject *__pyx_n_s__dirichlet;
+static PyObject *__pyx_n_s__dot;
+static PyObject *__pyx_n_s__empty;
+static PyObject *__pyx_n_s__equal;
+static PyObject *__pyx_n_s__exponential;
+static PyObject *__pyx_n_s__f;
+static PyObject *__pyx_n_s__float64;
+static PyObject *__pyx_n_s__gamma;
+static PyObject *__pyx_n_s__gauss;
+static PyObject *__pyx_n_s__geometric;
+static PyObject *__pyx_n_s__get_state;
+static PyObject *__pyx_n_s__greater;
+static PyObject *__pyx_n_s__greater_equal;
+static PyObject *__pyx_n_s__gumbel;
+static PyObject *__pyx_n_s__has_gauss;
+static PyObject *__pyx_n_s__high;
+static PyObject *__pyx_n_s__hypergeometric;
+static PyObject *__pyx_n_s__integer;
+static PyObject *__pyx_n_s__internal_state;
+static PyObject *__pyx_n_s__kappa;
+static PyObject *__pyx_n_s__key;
+static PyObject *__pyx_n_s__lam;
+static PyObject *__pyx_n_s__laplace;
+static PyObject *__pyx_n_s__left;
+static PyObject *__pyx_n_s__less;
+static PyObject *__pyx_n_s__less_equal;
+static PyObject *__pyx_n_s__loc;
+static PyObject *__pyx_n_s__logistic;
+static PyObject *__pyx_n_s__lognormal;
+static PyObject *__pyx_n_s__logseries;
+static PyObject *__pyx_n_s__low;
+static PyObject *__pyx_n_s__mean;
+static PyObject *__pyx_n_s__mode;
+static PyObject *__pyx_n_s__mu;
+static PyObject *__pyx_n_s__multinomial;
+static PyObject *__pyx_n_s__multiply;
+static PyObject *__pyx_n_s__multivariate_normal;
+static PyObject *__pyx_n_s__n;
+static PyObject *__pyx_n_s__nbad;
+static PyObject *__pyx_n_s__nd;
+static PyObject *__pyx_n_s__negative_binomial;
+static PyObject *__pyx_n_s__ngood;
+static PyObject *__pyx_n_s__nonc;
+static PyObject *__pyx_n_s__noncentral_f;
+static PyObject *__pyx_n_s__normal;
+static PyObject *__pyx_n_s__np;
+static PyObject *__pyx_n_s__nsample;
+static PyObject *__pyx_n_s__numpy;
+static PyObject *__pyx_n_s__p;
+static PyObject *__pyx_n_s__pareto;
+static PyObject *__pyx_n_s__permutation;
+static PyObject *__pyx_n_s__poisson;
+static PyObject *__pyx_n_s__pos;
+static PyObject *__pyx_n_s__power;
+static PyObject *__pyx_n_s__pvals;
+static PyObject *__pyx_n_s__rand;
+static PyObject *__pyx_n_s__randint;
+static PyObject *__pyx_n_s__randn;
+static PyObject *__pyx_n_s__random;
+static PyObject *__pyx_n_s__random_integers;
+static PyObject *__pyx_n_s__random_sample;
+static PyObject *__pyx_n_s__rayleigh;
+static PyObject *__pyx_n_s__reduce;
+static PyObject *__pyx_n_s__right;
+static PyObject *__pyx_n_s__scale;
+static PyObject *__pyx_n_s__seed;
+static PyObject *__pyx_n_s__set_state;
+static PyObject *__pyx_n_s__shape;
+static PyObject *__pyx_n_s__shuffle;
+static PyObject *__pyx_n_s__sigma;
+static PyObject *__pyx_n_s__size;
+static PyObject *__pyx_n_s__sqrt;
+static PyObject *__pyx_n_s__standard_cauchy;
+static PyObject *__pyx_n_s__standard_gamma;
+static PyObject *__pyx_n_s__standard_normal;
+static PyObject *__pyx_n_s__standard_t;
+static PyObject *__pyx_n_s__subtract;
+static PyObject *__pyx_n_s__svd;
+static PyObject *__pyx_n_s__tomaxint;
+static PyObject *__pyx_n_s__triangular;
+static PyObject *__pyx_n_s__uint;
+static PyObject *__pyx_n_s__uint32;
+static PyObject *__pyx_n_s__uniform;
+static PyObject *__pyx_n_s__vonmises;
+static PyObject *__pyx_n_s__wald;
+static PyObject *__pyx_n_s__weibull;
+static PyObject *__pyx_n_s__zeros;
+static PyObject *__pyx_n_s__zipf;
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_1;
-static char __pyx_k___main__[] = "__main__";
-static PyObject *__pyx_kp___main__;
-static char __pyx_k___init__[] = "__init__";
-static PyObject *__pyx_kp___init__;
-static char __pyx_k___dealloc__[] = "__dealloc__";
-static PyObject *__pyx_kp___dealloc__;
-static char __pyx_k_seed[] = "seed";
-static PyObject *__pyx_kp_seed;
-static char __pyx_k_get_state[] = "get_state";
-static PyObject *__pyx_kp_get_state;
-static char __pyx_k_set_state[] = "set_state";
-static PyObject *__pyx_kp_set_state;
-static char __pyx_k___getstate__[] = "__getstate__";
-static PyObject *__pyx_kp___getstate__;
-static char __pyx_k___setstate__[] = "__setstate__";
-static PyObject *__pyx_kp___setstate__;
-static char __pyx_k___reduce__[] = "__reduce__";
-static PyObject *__pyx_kp___reduce__;
-static char __pyx_k_random_sample[] = "random_sample";
-static PyObject *__pyx_kp_random_sample;
-static char __pyx_k_tomaxint[] = "tomaxint";
-static PyObject *__pyx_kp_tomaxint;
-static char __pyx_k_randint[] = "randint";
-static PyObject *__pyx_kp_randint;
-static char __pyx_k_bytes[] = "bytes";
-static PyObject *__pyx_kp_bytes;
-static char __pyx_k_uniform[] = "uniform";
-static PyObject *__pyx_kp_uniform;
-static char __pyx_k_rand[] = "rand";
-static PyObject *__pyx_kp_rand;
-static char __pyx_k_randn[] = "randn";
-static PyObject *__pyx_kp_randn;
-static char __pyx_k_random_integers[] = "random_integers";
-static PyObject *__pyx_kp_random_integers;
-static char __pyx_k_standard_normal[] = "standard_normal";
-static PyObject *__pyx_kp_standard_normal;
-static char __pyx_k_normal[] = "normal";
-static PyObject *__pyx_kp_normal;
-static char __pyx_k_beta[] = "beta";
-static PyObject *__pyx_kp_beta;
-static char __pyx_k_exponential[] = "exponential";
-static PyObject *__pyx_kp_exponential;
-static char __pyx_k_1[] = "standard_exponential";
-static PyObject *__pyx_kp_1;
-static char __pyx_k_standard_gamma[] = "standard_gamma";
-static PyObject *__pyx_kp_standard_gamma;
-static char __pyx_k_gamma[] = "gamma";
-static PyObject *__pyx_kp_gamma;
-static char __pyx_k_f[] = "f";
-static PyObject *__pyx_kp_f;
-static char __pyx_k_noncentral_f[] = "noncentral_f";
-static PyObject *__pyx_kp_noncentral_f;
-static char __pyx_k_chisquare[] = "chisquare";
-static PyObject *__pyx_kp_chisquare;
-static char __pyx_k_2[] = "noncentral_chisquare";
-static PyObject *__pyx_kp_2;
-static char __pyx_k_standard_cauchy[] = "standard_cauchy";
-static PyObject *__pyx_kp_standard_cauchy;
-static char __pyx_k_standard_t[] = "standard_t";
-static PyObject *__pyx_kp_standard_t;
-static char __pyx_k_vonmises[] = "vonmises";
-static PyObject *__pyx_kp_vonmises;
-static char __pyx_k_pareto[] = "pareto";
-static PyObject *__pyx_kp_pareto;
-static char __pyx_k_weibull[] = "weibull";
-static PyObject *__pyx_kp_weibull;
-static char __pyx_k_power[] = "power";
-static PyObject *__pyx_kp_power;
-static char __pyx_k_laplace[] = "laplace";
-static PyObject *__pyx_kp_laplace;
-static char __pyx_k_gumbel[] = "gumbel";
-static PyObject *__pyx_kp_gumbel;
-static char __pyx_k_logistic[] = "logistic";
-static PyObject *__pyx_kp_logistic;
-static char __pyx_k_lognormal[] = "lognormal";
-static PyObject *__pyx_kp_lognormal;
-static char __pyx_k_rayleigh[] = "rayleigh";
-static PyObject *__pyx_kp_rayleigh;
-static char __pyx_k_wald[] = "wald";
-static PyObject *__pyx_kp_wald;
-static char __pyx_k_triangular[] = "triangular";
-static PyObject *__pyx_kp_triangular;
-static char __pyx_k_binomial[] = "binomial";
-static PyObject *__pyx_kp_binomial;
-static char __pyx_k_negative_binomial[] = "negative_binomial";
-static PyObject *__pyx_kp_negative_binomial;
-static char __pyx_k_poisson[] = "poisson";
-static PyObject *__pyx_kp_poisson;
-static char __pyx_k_zipf[] = "zipf";
-static PyObject *__pyx_kp_zipf;
-static char __pyx_k_geometric[] = "geometric";
-static PyObject *__pyx_kp_geometric;
-static char __pyx_k_hypergeometric[] = "hypergeometric";
-static PyObject *__pyx_kp_hypergeometric;
-static char __pyx_k_logseries[] = "logseries";
-static PyObject *__pyx_kp_logseries;
-static char __pyx_k_multivariate_normal[] = "multivariate_normal";
-static PyObject *__pyx_kp_multivariate_normal;
-static char __pyx_k_multinomial[] = "multinomial";
-static PyObject *__pyx_kp_multinomial;
-static char __pyx_k_dirichlet[] = "dirichlet";
-static PyObject *__pyx_kp_dirichlet;
-static char __pyx_k_shuffle[] = "shuffle";
-static PyObject *__pyx_kp_shuffle;
-static char __pyx_k_permutation[] = "permutation";
-static PyObject *__pyx_kp_permutation;
-static char __pyx_k_state[] = "state";
-static PyObject *__pyx_kp_state;
-static char __pyx_k_size[] = "size";
-static PyObject *__pyx_kp_size;
-static char __pyx_k_low[] = "low";
-static PyObject *__pyx_kp_low;
-static char __pyx_k_high[] = "high";
-static PyObject *__pyx_kp_high;
-static char __pyx_k_length[] = "length";
-static PyObject *__pyx_kp_length;
-static char __pyx_k_loc[] = "loc";
-static PyObject *__pyx_kp_loc;
-static char __pyx_k_scale[] = "scale";
-static PyObject *__pyx_kp_scale;
-static char __pyx_k_a[] = "a";
-static PyObject *__pyx_kp_a;
-static char __pyx_k_b[] = "b";
-static PyObject *__pyx_kp_b;
-static char __pyx_k_shape[] = "shape";
-static PyObject *__pyx_kp_shape;
-static char __pyx_k_dfnum[] = "dfnum";
-static PyObject *__pyx_kp_dfnum;
-static char __pyx_k_dfden[] = "dfden";
-static PyObject *__pyx_kp_dfden;
-static char __pyx_k_nonc[] = "nonc";
-static PyObject *__pyx_kp_nonc;
-static char __pyx_k_df[] = "df";
-static PyObject *__pyx_kp_df;
-static char __pyx_k_mu[] = "mu";
-static PyObject *__pyx_kp_mu;
-static char __pyx_k_kappa[] = "kappa";
-static PyObject *__pyx_kp_kappa;
-static char __pyx_k_mean[] = "mean";
-static PyObject *__pyx_kp_mean;
-static char __pyx_k_sigma[] = "sigma";
-static PyObject *__pyx_kp_sigma;
-static char __pyx_k_left[] = "left";
-static PyObject *__pyx_kp_left;
-static char __pyx_k_mode[] = "mode";
-static PyObject *__pyx_kp_mode;
-static char __pyx_k_right[] = "right";
-static PyObject *__pyx_kp_right;
-static char __pyx_k_n[] = "n";
-static PyObject *__pyx_kp_n;
-static char __pyx_k_p[] = "p";
-static PyObject *__pyx_kp_p;
-static char __pyx_k_lam[] = "lam";
-static PyObject *__pyx_kp_lam;
-static char __pyx_k_ngood[] = "ngood";
-static PyObject *__pyx_kp_ngood;
-static char __pyx_k_nbad[] = "nbad";
-static PyObject *__pyx_kp_nbad;
-static char __pyx_k_nsample[] = "nsample";
-static PyObject *__pyx_kp_nsample;
-static char __pyx_k_cov[] = "cov";
-static PyObject *__pyx_kp_cov;
-static char __pyx_k_pvals[] = "pvals";
-static PyObject *__pyx_kp_pvals;
-static char __pyx_k_alpha[] = "alpha";
-static PyObject *__pyx_kp_alpha;
-static char __pyx_k_x[] = "x";
-static PyObject *__pyx_kp_x;
-static char __pyx_k_numpy[] = "numpy";
-static PyObject *__pyx_kp_numpy;
-static char __pyx_k_np[] = "np";
-static PyObject *__pyx_kp_np;
-static char __pyx_k__rand[] = "_rand";
-static PyObject *__pyx_kp__rand;
-static char __pyx_k_empty[] = "empty";
-static PyObject *__pyx_kp_empty;
-static char __pyx_k_19[] = "float64";
-static PyObject *__pyx_kp_19;
-static char __pyx_k_ValueError[] = "ValueError";
-static PyObject *__pyx_kp_ValueError;
-static char __pyx_k_integer[] = "integer";
-static PyObject *__pyx_kp_integer;
-static char __pyx_k_uint[] = "uint";
-static PyObject *__pyx_kp_uint;
-static char __pyx_k_asarray[] = "asarray";
-static PyObject *__pyx_kp_asarray;
-static char __pyx_k_27[] = "uint32";
-static PyObject *__pyx_kp_27;
-static char __pyx_k_28[] = "MT19937";
-static PyObject *__pyx_kp_28;
-static char __pyx_k_29[] = "MT19937";
-static PyObject *__pyx_kp_29;
-static char __pyx_k_TypeError[] = "TypeError";
-static PyObject *__pyx_kp_TypeError;
-static char __pyx_k_random[] = "random";
-static PyObject *__pyx_kp_random;
-static char __pyx_k___RandomState_ctor[] = "__RandomState_ctor";
-static PyObject *__pyx_kp___RandomState_ctor;
-static char __pyx_k_subtract[] = "subtract";
-static PyObject *__pyx_kp_subtract;
-static char __pyx_k_any[] = "any";
-static PyObject *__pyx_kp_any;
-static char __pyx_k_less_equal[] = "less_equal";
-static PyObject *__pyx_kp_less_equal;
-static char __pyx_k_less[] = "less";
-static PyObject *__pyx_kp_less;
-static char __pyx_k_greater[] = "greater";
-static PyObject *__pyx_kp_greater;
-static char __pyx_k_equal[] = "equal";
-static PyObject *__pyx_kp_equal;
-static char __pyx_k_add[] = "add";
-static PyObject *__pyx_kp_add;
-static char __pyx_k_greater_equal[] = "greater_equal";
-static PyObject *__pyx_kp_greater_equal;
-static char __pyx_k_array[] = "array";
-static PyObject *__pyx_kp_array;
-static char __pyx_k_append[] = "append";
-static PyObject *__pyx_kp_append;
-static char __pyx_k_multiply[] = "multiply";
-static PyObject *__pyx_kp_multiply;
-static char __pyx_k_reduce[] = "reduce";
-static PyObject *__pyx_kp_reduce;
-static char __pyx_k_128[] = "numpy.dual";
-static PyObject *__pyx_kp_128;
-static char __pyx_k_svd[] = "svd";
-static PyObject *__pyx_kp_svd;
-static char __pyx_k_dot[] = "dot";
-static PyObject *__pyx_kp_dot;
-static char __pyx_k_sqrt[] = "sqrt";
-static PyObject *__pyx_kp_sqrt;
-static char __pyx_k_zeros[] = "zeros";
-static PyObject *__pyx_kp_zeros;
-static char __pyx_k_130[] = "copy";
-static PyObject *__pyx_kp_130;
-static char __pyx_k_copy[] = "copy";
-static PyObject *__pyx_kp_copy;
-static char __pyx_k_arange[] = "arange";
-static PyObject *__pyx_kp_arange;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_kp_20;
-static char __pyx_k_20[] = "size is not compatible with inputs";
-static PyObject *__pyx_kp_21;
-static char __pyx_k_21[] = "size is not compatible with inputs";
-static PyObject *__pyx_kp_22;
-static char __pyx_k_22[] = "size is not compatible with inputs";
-static PyObject *__pyx_kp_23;
-static char __pyx_k_23[] = "size is not compatible with inputs";
-static PyObject *__pyx_kp_24;
-static char __pyx_k_24[] = "size is not compatible with inputs";
-static PyObject *__pyx_kp_25;
-static char __pyx_k_25[] = "size is not compatible with inputs";
-static PyObject *__pyx_kp_26;
-static char __pyx_k_26[] = "size is not compatible with inputs";
-static PyObject *__pyx_kp_30;
-static PyObject *__pyx_kp_31;
-static char __pyx_k_30[] = "algorithm must be 'MT19937'";
-static char __pyx_k_31[] = "state must be 624 longs";
-static PyObject *__pyx_kp_32;
-static char __pyx_k_32[] = "low >= high";
-static PyObject *__pyx_kp_33;
-static PyObject *__pyx_kp_34;
-static char __pyx_k_33[] = "scale <= 0";
-static char __pyx_k_34[] = "scale <= 0";
-static PyObject *__pyx_kp_35;
-static PyObject *__pyx_kp_36;
-static PyObject *__pyx_kp_37;
-static PyObject *__pyx_kp_38;
-static char __pyx_k_35[] = "a <= 0";
-static char __pyx_k_36[] = "b <= 0";
-static char __pyx_k_37[] = "a <= 0";
-static char __pyx_k_38[] = "b <= 0";
-static PyObject *__pyx_kp_39;
-static PyObject *__pyx_kp_40;
-static char __pyx_k_39[] = "scale <= 0";
-static char __pyx_k_40[] = "scale <= 0";
-static PyObject *__pyx_kp_41;
-static PyObject *__pyx_kp_42;
-static char __pyx_k_41[] = "shape <= 0";
-static char __pyx_k_42[] = "shape <= 0";
-static PyObject *__pyx_kp_43;
-static PyObject *__pyx_kp_44;
-static PyObject *__pyx_kp_45;
-static PyObject *__pyx_kp_46;
-static char __pyx_k_43[] = "shape <= 0";
-static char __pyx_k_44[] = "scale <= 0";
-static char __pyx_k_45[] = "shape <= 0";
-static char __pyx_k_46[] = "scale <= 0";
-static PyObject *__pyx_kp_47;
-static PyObject *__pyx_kp_48;
-static PyObject *__pyx_kp_49;
-static PyObject *__pyx_kp_50;
-static char __pyx_k_47[] = "shape <= 0";
-static char __pyx_k_48[] = "scale <= 0";
-static char __pyx_k_49[] = "dfnum <= 0";
-static char __pyx_k_50[] = "dfden <= 0";
-static PyObject *__pyx_kp_51;
-static PyObject *__pyx_kp_52;
-static PyObject *__pyx_kp_53;
-static PyObject *__pyx_kp_54;
-static PyObject *__pyx_kp_55;
-static PyObject *__pyx_kp_56;
-static char __pyx_k_51[] = "dfnum <= 1";
-static char __pyx_k_52[] = "dfden <= 0";
-static char __pyx_k_53[] = "nonc < 0";
-static char __pyx_k_54[] = "dfnum <= 1";
-static char __pyx_k_55[] = "dfden <= 0";
-static char __pyx_k_56[] = "nonc < 0";
-static PyObject *__pyx_kp_57;
-static PyObject *__pyx_kp_58;
-static char __pyx_k_57[] = "df <= 0";
-static char __pyx_k_58[] = "df <= 0";
-static PyObject *__pyx_kp_59;
-static PyObject *__pyx_kp_60;
-static PyObject *__pyx_kp_61;
-static PyObject *__pyx_kp_62;
-static char __pyx_k_59[] = "df <= 0";
-static char __pyx_k_60[] = "nonc <= 0";
-static char __pyx_k_61[] = "df <= 1";
-static char __pyx_k_62[] = "nonc < 0";
-static PyObject *__pyx_kp_63;
-static PyObject *__pyx_kp_64;
-static char __pyx_k_63[] = "df <= 0";
-static char __pyx_k_64[] = "df <= 0";
-static PyObject *__pyx_kp_65;
-static PyObject *__pyx_kp_66;
-static char __pyx_k_65[] = "kappa < 0";
-static char __pyx_k_66[] = "kappa < 0";
-static PyObject *__pyx_kp_67;
-static PyObject *__pyx_kp_68;
-static char __pyx_k_67[] = "a <= 0";
-static char __pyx_k_68[] = "a <= 0";
-static PyObject *__pyx_kp_69;
-static PyObject *__pyx_kp_70;
-static char __pyx_k_69[] = "a <= 0";
-static char __pyx_k_70[] = "a <= 0";
-static PyObject *__pyx_kp_71;
-static PyObject *__pyx_kp_72;
-static char __pyx_k_71[] = "a <= 0";
-static char __pyx_k_72[] = "a <= 0";
-static PyObject *__pyx_kp_73;
-static PyObject *__pyx_kp_74;
-static char __pyx_k_73[] = "scale <= 0";
-static char __pyx_k_74[] = "scale <= 0";
-static PyObject *__pyx_kp_75;
-static PyObject *__pyx_kp_76;
-static char __pyx_k_75[] = "scale <= 0";
-static char __pyx_k_76[] = "scale <= 0";
-static PyObject *__pyx_kp_77;
-static PyObject *__pyx_kp_78;
-static char __pyx_k_77[] = "scale <= 0";
-static char __pyx_k_78[] = "scale <= 0";
-static PyObject *__pyx_kp_79;
-static PyObject *__pyx_kp_80;
-static char __pyx_k_79[] = "sigma <= 0";
-static char __pyx_k_80[] = "sigma <= 0.0";
-static PyObject *__pyx_kp_81;
-static PyObject *__pyx_kp_82;
-static char __pyx_k_81[] = "scale <= 0";
-static char __pyx_k_82[] = "scale <= 0.0";
-static PyObject *__pyx_kp_83;
-static PyObject *__pyx_kp_84;
-static PyObject *__pyx_kp_85;
-static PyObject *__pyx_kp_86;
-static char __pyx_k_83[] = "mean <= 0";
-static char __pyx_k_84[] = "scale <= 0";
-static char __pyx_k_85[] = "mean <= 0.0";
-static char __pyx_k_86[] = "scale <= 0.0";
-static PyObject *__pyx_kp_87;
-static PyObject *__pyx_kp_88;
-static PyObject *__pyx_kp_89;
-static PyObject *__pyx_kp_90;
-static PyObject *__pyx_kp_91;
-static PyObject *__pyx_kp_92;
-static char __pyx_k_87[] = "left > mode";
-static char __pyx_k_88[] = "mode > right";
-static char __pyx_k_89[] = "left == right";
-static char __pyx_k_90[] = "left > mode";
-static char __pyx_k_91[] = "mode > right";
-static char __pyx_k_92[] = "left == right";
-static PyObject *__pyx_kp_93;
-static PyObject *__pyx_kp_94;
-static PyObject *__pyx_kp_95;
-static PyObject *__pyx_kp_96;
-static PyObject *__pyx_kp_97;
-static PyObject *__pyx_kp_98;
-static char __pyx_k_93[] = "n <= 0";
-static char __pyx_k_94[] = "p < 0";
-static char __pyx_k_95[] = "p > 1";
-static char __pyx_k_96[] = "n <= 0";
-static char __pyx_k_97[] = "p < 0";
-static char __pyx_k_98[] = "p > 1";
-static PyObject *__pyx_kp_99;
-static PyObject *__pyx_kp_100;
-static PyObject *__pyx_kp_101;
-static PyObject *__pyx_kp_102;
-static PyObject *__pyx_kp_103;
-static PyObject *__pyx_kp_104;
-static char __pyx_k_99[] = "n <= 0";
-static char __pyx_k_100[] = "p < 0";
-static char __pyx_k_101[] = "p > 1";
-static char __pyx_k_102[] = "n <= 0";
-static char __pyx_k_103[] = "p < 0";
-static char __pyx_k_104[] = "p > 1";
-static PyObject *__pyx_kp_105;
-static PyObject *__pyx_kp_106;
-static char __pyx_k_105[] = "lam < 0";
-static char __pyx_k_106[] = "lam < 0";
-static PyObject *__pyx_kp_107;
-static PyObject *__pyx_kp_108;
-static char __pyx_k_107[] = "a <= 1.0";
-static char __pyx_k_108[] = "a <= 1.0";
-static PyObject *__pyx_kp_109;
-static PyObject *__pyx_kp_110;
-static PyObject *__pyx_kp_111;
-static PyObject *__pyx_kp_112;
-static char __pyx_k_109[] = "p < 0.0";
-static char __pyx_k_110[] = "p > 1.0";
-static char __pyx_k_111[] = "p < 0.0";
-static char __pyx_k_112[] = "p > 1.0";
-static PyObject *__pyx_kp_113;
-static PyObject *__pyx_kp_114;
-static PyObject *__pyx_kp_115;
-static PyObject *__pyx_kp_116;
-static PyObject *__pyx_kp_117;
-static PyObject *__pyx_kp_118;
-static PyObject *__pyx_kp_119;
-static PyObject *__pyx_kp_120;
-static char __pyx_k_113[] = "ngood < 1";
-static char __pyx_k_114[] = "nbad < 1";
-static char __pyx_k_115[] = "nsample < 1";
-static char __pyx_k_116[] = "ngood + nbad < nsample";
-static char __pyx_k_117[] = "ngood < 1";
-static char __pyx_k_118[] = "nbad < 1";
-static char __pyx_k_119[] = "nsample < 1";
-static char __pyx_k_120[] = "ngood + nbad < nsample";
-static PyObject *__pyx_kp_121;
-static PyObject *__pyx_kp_122;
-static PyObject *__pyx_kp_123;
-static PyObject *__pyx_kp_124;
-static char __pyx_k_121[] = "p <= 0.0";
-static char __pyx_k_122[] = "p >= 1.0";
-static char __pyx_k_123[] = "p <= 0.0";
-static char __pyx_k_124[] = "p >= 1.0";
-static PyObject *__pyx_kp_125;
-static PyObject *__pyx_kp_126;
-static PyObject *__pyx_kp_127;
-static char __pyx_k_125[] = "mean must be 1 dimensional";
-static char __pyx_k_126[] = "cov must be 2 dimensional and square";
-static char __pyx_k_127[] = "mean and cov must have same length";
-static PyObject *__pyx_kp_129;
-static char __pyx_k_129[] = "sum(pvals[:-1]) > 1.0";
+static PyObject *__pyx_int_624;
+static PyObject *__pyx_k_5;
+static PyObject *__pyx_k_6;
+static PyObject *__pyx_k_7;
+static PyObject *__pyx_k_8;
+static PyObject *__pyx_k_12;
+static PyObject *__pyx_k_14;
+static PyObject *__pyx_k_23;
+static PyObject *__pyx_k_24;
+static PyObject *__pyx_k_25;
+static PyObject *__pyx_k_26;
+static PyObject *__pyx_k_27;
+static PyObject *__pyx_k_28;
+static PyObject *__pyx_k_29;
+static PyObject *__pyx_k_30;
+static PyObject *__pyx_k_33;
+static PyObject *__pyx_k_43;
 
 /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":128
  * import numpy as np
@@ -1037,13 +1034,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("cont0_array");
+  __Pyx_RefNannySetupContext("cont0_array");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":134
@@ -1080,32 +1077,32 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <double *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3)));
+    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
-    arrayObject = ((PyArrayObject *)__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    arrayObject = ((PyArrayObject *)__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":138
  *     else:
@@ -1162,7 +1159,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -1170,8 +1166,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -1189,13 +1186,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("cont1_array_sc");
+  __Pyx_RefNannySetupContext("cont1_array_sc");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":151
@@ -1232,32 +1229,32 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <double *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3)));
+    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
-    arrayObject = ((PyArrayObject *)__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    arrayObject = ((PyArrayObject *)__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":155
  *     else:
@@ -1314,7 +1311,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -1322,8 +1318,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -1344,13 +1341,14 @@
   PyArrayIterObject *__pyx_v_itera;
   PyArrayMultiIterObject *__pyx_v_multi;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   npy_intp __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  __Pyx_SetupRefcountContext("cont1_array");
+  __Pyx_RefNannySetupContext("cont1_array");
+  __Pyx_INCREF(__pyx_v_size);
+  __Pyx_INCREF((PyObject *)__pyx_v_oa);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_itera = ((PyArrayIterObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None);
@@ -1450,32 +1448,32 @@
  *         array_data = <double *>array.data
  *         multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
+    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)arrayObject));
-    arrayObject = ((PyArrayObject *)__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    arrayObject = ((PyArrayObject *)__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":180
  *     else:
@@ -1493,12 +1491,12 @@
  *         if (multi.size != PyArray_SIZE(array)):
  *             raise ValueError("size is not compatible with inputs")
  */
-    __pyx_t_4 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4)));
+    __pyx_t_5 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)__pyx_v_multi));
-    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":183
  *         multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
@@ -1517,16 +1515,16 @@
  *         for i from 0 <= i < multi.size:
  *             oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
  */
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __Pyx_INCREF(__pyx_kp_20);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_20);
-      __Pyx_GIVEREF(__pyx_kp_20);
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_5, 0, 0);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
@@ -1587,7 +1585,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
@@ -1597,8 +1594,10 @@
   __Pyx_DECREF((PyObject *)arrayObject);
   __Pyx_DECREF((PyObject *)__pyx_v_itera);
   __Pyx_DECREF((PyObject *)__pyx_v_multi);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_DECREF((PyObject *)__pyx_v_oa);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -1616,13 +1615,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("cont2_array_sc");
+  __Pyx_RefNannySetupContext("cont2_array_sc");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":198
@@ -1659,32 +1658,32 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <double *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3)));
+    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
-    arrayObject = ((PyArrayObject *)__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    arrayObject = ((PyArrayObject *)__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":202
  *     else:
@@ -1741,7 +1740,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -1749,8 +1747,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -1770,13 +1769,15 @@
   npy_intp __pyx_v_i;
   PyArrayMultiIterObject *__pyx_v_multi;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   npy_intp __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  __Pyx_SetupRefcountContext("cont2_array");
+  __Pyx_RefNannySetupContext("cont2_array");
+  __Pyx_INCREF(__pyx_v_size);
+  __Pyx_INCREF((PyObject *)__pyx_v_oa);
+  __Pyx_INCREF((PyObject *)__pyx_v_ob);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None);
 
@@ -1884,32 +1885,32 @@
  *         array_data = <double *>array.data
  *         multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
+    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)arrayObject));
-    arrayObject = ((PyArrayObject *)__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    arrayObject = ((PyArrayObject *)__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":230
  *     else:
@@ -1927,12 +1928,12 @@
  *         if (multi.size != PyArray_SIZE(array)):
  *             raise ValueError("size is not compatible with inputs")
  */
-    __pyx_t_4 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4)));
+    __pyx_t_5 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)__pyx_v_multi));
-    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":232
  *         array_data = <double *>array.data
@@ -1951,16 +1952,16 @@
  *         for i from 0 <= i < multi.size:
  *             oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
  */
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __Pyx_INCREF(__pyx_kp_21);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_21);
-      __Pyx_GIVEREF(__pyx_kp_21);
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_5, 0, 0);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
@@ -2039,7 +2040,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
@@ -2048,8 +2048,11 @@
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
   __Pyx_DECREF((PyObject *)__pyx_v_multi);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_DECREF((PyObject *)__pyx_v_oa);
+  __Pyx_DECREF((PyObject *)__pyx_v_ob);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -2067,13 +2070,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("cont3_array_sc");
+  __Pyx_RefNannySetupContext("cont3_array_sc");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":250
@@ -2110,32 +2113,32 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <double *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3)));
+    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
-    arrayObject = ((PyArrayObject *)__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    arrayObject = ((PyArrayObject *)__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":254
  *     else:
@@ -2192,7 +2195,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -2200,8 +2202,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -2222,13 +2225,16 @@
   npy_intp __pyx_v_i;
   PyArrayMultiIterObject *__pyx_v_multi;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   npy_intp __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  __Pyx_SetupRefcountContext("cont3_array");
+  __Pyx_RefNannySetupContext("cont3_array");
+  __Pyx_INCREF(__pyx_v_size);
+  __Pyx_INCREF((PyObject *)__pyx_v_oa);
+  __Pyx_INCREF((PyObject *)__pyx_v_ob);
+  __Pyx_INCREF((PyObject *)__pyx_v_oc);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None);
 
@@ -2345,32 +2351,32 @@
  *         array_data = <double *>array.data
  *         multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
+    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)arrayObject));
-    arrayObject = ((PyArrayObject *)__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    arrayObject = ((PyArrayObject *)__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":284
  *     else:
@@ -2388,12 +2394,12 @@
  *         if (multi.size != PyArray_SIZE(array)):
  *             raise ValueError("size is not compatible with inputs")
  */
-    __pyx_t_4 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4)));
+    __pyx_t_5 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)__pyx_v_multi));
-    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":287
  *         multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
@@ -2412,16 +2418,16 @@
  *         for i from 0 <= i < multi.size:
  *             oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
  */
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __Pyx_INCREF(__pyx_kp_22);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_22);
-      __Pyx_GIVEREF(__pyx_kp_22);
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_5, 0, 0);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
@@ -2500,7 +2506,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
@@ -2509,8 +2514,12 @@
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
   __Pyx_DECREF((PyObject *)__pyx_v_multi);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_DECREF((PyObject *)__pyx_v_oa);
+  __Pyx_DECREF((PyObject *)__pyx_v_ob);
+  __Pyx_DECREF((PyObject *)__pyx_v_oc);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -2528,13 +2537,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("disc0_array");
+  __Pyx_RefNannySetupContext("disc0_array");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":303
@@ -2571,23 +2580,23 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <long *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_4);
@@ -2648,7 +2657,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -2656,8 +2664,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -2675,13 +2684,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("discnp_array_sc");
+  __Pyx_RefNannySetupContext("discnp_array_sc");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":319
@@ -2718,23 +2727,23 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <long *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_4);
@@ -2795,7 +2804,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -2803,8 +2811,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -2824,13 +2833,15 @@
   long *__pyx_v_on_data;
   PyArrayMultiIterObject *__pyx_v_multi;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   npy_intp __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  __Pyx_SetupRefcountContext("discnp_array");
+  __Pyx_RefNannySetupContext("discnp_array");
+  __Pyx_INCREF(__pyx_v_size);
+  __Pyx_INCREF((PyObject *)__pyx_v_on);
+  __Pyx_INCREF((PyObject *)__pyx_v_op);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None);
 
@@ -2938,23 +2949,23 @@
  *         array_data = <long *>array.data
  *         multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_5);
@@ -3001,15 +3012,15 @@
  *             on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
  */
       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-      __Pyx_INCREF(__pyx_kp_23);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_23);
-      __Pyx_GIVEREF(__pyx_kp_23);
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
@@ -3088,7 +3099,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
@@ -3097,8 +3107,11 @@
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
   __Pyx_DECREF((PyObject *)__pyx_v_multi);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_DECREF((PyObject *)__pyx_v_on);
+  __Pyx_DECREF((PyObject *)__pyx_v_op);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -3116,13 +3129,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("discdd_array_sc");
+  __Pyx_RefNannySetupContext("discdd_array_sc");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":368
@@ -3159,23 +3172,23 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <long *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_4);
@@ -3236,7 +3249,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -3244,8 +3256,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -3265,13 +3278,15 @@
   double *__pyx_v_on_data;
   PyArrayMultiIterObject *__pyx_v_multi;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   npy_intp __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  __Pyx_SetupRefcountContext("discdd_array");
+  __Pyx_RefNannySetupContext("discdd_array");
+  __Pyx_INCREF(__pyx_v_size);
+  __Pyx_INCREF((PyObject *)__pyx_v_on);
+  __Pyx_INCREF((PyObject *)__pyx_v_op);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None);
 
@@ -3379,23 +3394,23 @@
  *         array_data = <long *>array.data
  *         multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_5);
@@ -3442,15 +3457,15 @@
  *             on_data = <double *>PyArray_MultiIter_DATA(multi, 1)
  */
       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-      __Pyx_INCREF(__pyx_kp_24);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_24);
-      __Pyx_GIVEREF(__pyx_kp_24);
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
@@ -3529,7 +3544,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
@@ -3538,8 +3552,11 @@
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
   __Pyx_DECREF((PyObject *)__pyx_v_multi);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_DECREF((PyObject *)__pyx_v_on);
+  __Pyx_DECREF((PyObject *)__pyx_v_op);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -3557,13 +3574,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("discnmN_array_sc");
+  __Pyx_RefNannySetupContext("discnmN_array_sc");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":418
@@ -3600,23 +3617,23 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <long *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_4);
@@ -3677,7 +3694,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -3685,8 +3701,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -3707,13 +3724,16 @@
   npy_intp __pyx_v_i;
   PyArrayMultiIterObject *__pyx_v_multi;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   npy_intp __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  __Pyx_SetupRefcountContext("discnmN_array");
+  __Pyx_RefNannySetupContext("discnmN_array");
+  __Pyx_INCREF(__pyx_v_size);
+  __Pyx_INCREF((PyObject *)__pyx_v_on);
+  __Pyx_INCREF((PyObject *)__pyx_v_om);
+  __Pyx_INCREF((PyObject *)__pyx_v_oN);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None);
 
@@ -3830,23 +3850,23 @@
  *         array_data = <long *>array.data
  *         multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_5);
@@ -3893,15 +3913,15 @@
  *             on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
  */
       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-      __Pyx_INCREF(__pyx_kp_25);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_25);
-      __Pyx_GIVEREF(__pyx_kp_25);
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
@@ -3980,7 +4000,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
@@ -3989,8 +4008,12 @@
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
   __Pyx_DECREF((PyObject *)__pyx_v_multi);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_DECREF((PyObject *)__pyx_v_on);
+  __Pyx_DECREF((PyObject *)__pyx_v_om);
+  __Pyx_DECREF((PyObject *)__pyx_v_oN);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -4008,13 +4031,13 @@
   long __pyx_v_length;
   long __pyx_v_i;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   long __pyx_t_5;
-  __Pyx_SetupRefcountContext("discd_array_sc");
+  __Pyx_RefNannySetupContext("discd_array_sc");
+  __Pyx_INCREF(__pyx_v_size);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":471
@@ -4051,23 +4074,23 @@
  *         length = PyArray_SIZE(array)
  *         array_data = <long *>array.data
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_4);
@@ -4128,7 +4151,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -4136,8 +4158,9 @@
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_DECREF((PyObject *)arrayObject);
+  __Pyx_DECREF(__pyx_v_size);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -4158,13 +4181,14 @@
   PyArrayMultiIterObject *__pyx_v_multi;
   PyArrayIterObject *__pyx_v_itera;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   npy_intp __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  __Pyx_SetupRefcountContext("discd_array");
+  __Pyx_RefNannySetupContext("discd_array");
+  __Pyx_INCREF(__pyx_v_size);
+  __Pyx_INCREF((PyObject *)__pyx_v_oa);
   arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_itera = ((PyArrayIterObject *)Py_None); __Pyx_INCREF(Py_None);
@@ -4264,23 +4288,23 @@
  *         array_data = <long *>array.data
  *         multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_size);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
     __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type)));
-    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
     __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5)));
     __Pyx_DECREF(((PyObject *)arrayObject));
     arrayObject = ((PyArrayObject *)__pyx_t_5);
@@ -4327,15 +4351,15 @@
  *             oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
  */
       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-      __Pyx_INCREF(__pyx_kp_26);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_26);
-      __Pyx_GIVEREF(__pyx_kp_26);
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
@@ -4396,7 +4420,6 @@
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
@@ -4406,8 +4429,10 @@
   __Pyx_DECREF((PyObject *)arrayObject);
   __Pyx_DECREF((PyObject *)__pyx_v_multi);
   __Pyx_DECREF((PyObject *)__pyx_v_itera);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_DECREF((PyObject *)__pyx_v_oa);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -4427,7 +4452,7 @@
   long __pyx_v_i;
   double __pyx_r;
   long __pyx_t_1;
-  __Pyx_SetupRefcountContext("kahan_sum");
+  __Pyx_RefNannySetupContext("kahan_sum");
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":513
  *     cdef double c, y, t, sum
@@ -4506,7 +4531,7 @@
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -4525,12 +4550,12 @@
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_seed,0};
-  __Pyx_SetupRefcountContext("__init__");
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seed,0};
+  __Pyx_RefNannySetupContext("__init__");
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
     PyObject* values[1] = {0};
-    values[0] = Py_None;
+    values[0] = ((PyObject *)Py_None);
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       case  0: break;
@@ -4539,7 +4564,7 @@
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_seed);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed);
         if (unlikely(value)) { values[0] = value; kw_args--; }
       }
     }
@@ -4548,7 +4573,7 @@
     }
     __pyx_v_seed = values[0];
   } else {
-    __pyx_v_seed = Py_None;
+    __pyx_v_seed = ((PyObject *)Py_None);
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  1: __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0);
       case  0: break;
@@ -4579,17 +4604,17 @@
  * 
  *     def __dealloc__(self):
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_seed);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seed);
   __Pyx_GIVEREF(__pyx_v_seed);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
   __pyx_r = 0;
@@ -4601,7 +4626,7 @@
   __Pyx_AddTraceback("mtrand.RandomState.__init__");
   __pyx_r = -1;
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -4616,7 +4641,8 @@
 static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/
 static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {
   int __pyx_t_1;
-  __Pyx_SetupRefcountContext("__dealloc__");
+  __Pyx_RefNannySetupContext("__dealloc__");
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
 
   /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":563
  * 
@@ -4649,7 +4675,8 @@
   }
   __pyx_L5:;
 
-  __Pyx_FinishRefcountContext();
+  __Pyx_DECREF((PyObject *)__pyx_v_self);
+  __Pyx_RefNannyFinishContext();
 }
 
 /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":567
@@ -4668,17 +4695,16 @@
   PyArrayObject *arrayObject_obj;
   PyObject *__pyx_v_iseed;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
+  unsigned long __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
-  unsigned long __pyx_t_4;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_seed,0};
-  __Pyx_SetupRefcountContext("seed");
+  PyObject *__pyx_t_4 = NULL;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seed,0};
+  __Pyx_RefNannySetupContext("seed");
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
     PyObject* values[1] = {0};
-    values[0] = Py_None;
+    values[0] = ((PyObject *)Py_None);
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       case  0: break;
@@ -4687,7 +4713,7 @@
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_seed);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed);
         if (unlikely(value)) { values[0] = value; kw_args--; }
       }
     }
@@ -4696,7 +4722,7 @@
     }
     __pyx_v_seed = values[0];
   } else {
-    __pyx_v_seed = Py_None;
+    __pyx_v_seed = ((PyObject *)Py_None);
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  1: __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0);
       case  0: break;
@@ -4710,6 +4736,8 @@
   __Pyx_AddTraceback("mtrand.RandomState.seed");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
+  __Pyx_INCREF(__pyx_v_seed);
   arrayObject_obj = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_iseed = Py_None; __Pyx_INCREF(Py_None);
 
@@ -4741,16 +4769,7 @@
  *             rk_seed(seed, self.internal_state)
  *         elif isinstance(seed, np.integer):
  */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __Pyx_INCREF(__pyx_v_seed);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seed);
-  __Pyx_GIVEREF(__pyx_v_seed);
-  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_t_1 = (__pyx_t_3 == ((PyObject *)((PyObject*)&PyInt_Type)));
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_seed)) == ((PyObject *)((PyObject*)&PyInt_Type)));
   if (__pyx_t_1) {
 
     /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":591
@@ -4760,8 +4779,8 @@
  *         elif isinstance(seed, np.integer):
  *             iseed = int(seed)
  */
-    __pyx_t_4 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_seed); if (unlikely((__pyx_t_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    rk_seed(__pyx_t_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+    __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_seed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    rk_seed(__pyx_t_2, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
     goto __pyx_L6;
   }
 
@@ -4772,13 +4791,13 @@
  *             iseed = int(seed)
  *             rk_seed(iseed, self.internal_state)
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_1 = PyObject_IsInstance(__pyx_v_seed, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3,