diff options
-rw-r--r-- | numpy/random/mtrand/mtrand.c | 17935 |
1 files changed, 11991 insertions, 5944 deletions
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c index a95e7cc70..68b5e515f 100644 --- a/numpy/random/mtrand/mtrand.c +++ b/numpy/random/mtrand/mtrand.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.8.1.1 on Wed Apr 15 19:12:00 2009 */ +/* Generated by Cython 0.11 on Wed Apr 15 20:37:19 2009 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -11,6 +11,7 @@ #endif #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 + #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) #endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; @@ -31,20 +32,20 @@ typedef struct { void *buf; + PyObject *obj; Py_ssize_t len; + Py_ssize_t itemsize; int readonly; - const char *format; int ndim; + char *format; Py_ssize_t *shape; Py_ssize_t *strides; Py_ssize_t *suboffsets; - Py_ssize_t itemsize; void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 #define PyBUF_WRITABLE 0x0001 - #define PyBUF_LOCK 0x0002 #define PyBUF_FORMAT 0x0004 #define PyBUF_ND 0x0008 #define PyBUF_STRIDES (0x0010 | PyBUF_ND) @@ -63,9 +64,13 @@ #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 PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) @@ -97,6 +102,22 @@ #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)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #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)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else @@ -130,18 +151,51 @@ static int __pyx_skip_dispatch = 0; /* Type Conversion Predeclarations */ #if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_AsString PyString_AsString +#define __Pyx_PyBytes_FromString PyString_FromString +#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize +#define __Pyx_PyBytes_AsString PyString_AsString #else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_AsString PyBytes_AsString +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +#define __Pyx_PyBytes_AsString PyBytes_AsString #endif #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* x); static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x); static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x); + +#if !defined(T_PYSSIZET) +#if PY_VERSION_HEX < 0x02050000 +#define T_PYSSIZET T_INT +#elif !defined(T_LONGLONG) +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) +#else +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ + ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) +#endif +#endif + +#if !defined(T_SIZET) +#if !defined(T_ULONGLONG) +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) +#else +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ + ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) +#endif +#endif + static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b); +static INLINE PyObject * __pyx_PyInt_FromSize_t(size_t); +static INLINE size_t __pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x)) #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) @@ -180,81 +234,188 @@ static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char **__pyx_f; -static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/ +#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) +#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() +#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) -static INLINE int __Pyx_SplitStarArg(PyObject **args, Py_ssize_t nargs, PyObject **args2); /*proto*/ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, PyObject* kw_name); /*proto*/ -static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} + + +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ + __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) { + if (likely(o != Py_None)) { + if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { + PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); + Py_INCREF(r); + return r; + } + } + return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); +} -static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) { +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ + __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) { + if (likely(o != Py_None)) { + if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { + PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); + Py_INCREF(r); + return r; + } + } + return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); +} + + +#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ + __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) { PyObject *r; - if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) { + if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); Py_INCREF(r); } - else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) { + else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned)) + else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { r = PySequence_GetItem(o, i); + } else { - PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i); - if (!j) - return 0; - r = PyObject_GetItem(o, j); - Py_DECREF(j); + r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } return r; } +static INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, + const char* function_name, int kw_allowed); /*proto*/ + +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +#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) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} + +static 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_DECREF(PyList_GET_ITEM(o, i)); + Py_INCREF(v); + PyList_SET_ITEM(o, i, v); + return 1; + } + else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0))) + return PySequence_SetItem(o, i, v); + else { + PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i); + return __Pyx_SetItemInt_Generic(o, j, v); + } +} + +static 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 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 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 int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - 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 + return Py_None; /* this is just to have an accurate signature */ } else { - return PyObject_CallMethod(L, "append", "(O)", x); + PyObject *r, *m; + m = __Pyx_GetAttrString(L, "append"); + if (!m) return NULL; + r = PyObject_CallFunctionObjArgs(m, x, NULL); + Py_DECREF(m); + return r; } } -static INLINE int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v, int is_unsigned) { - int r; - if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) { - Py_DECREF(PyList_GET_ITEM(o, i)); - Py_INCREF(v); - PyList_SET_ITEM(o, i, v); - return 1; - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0) || !is_unsigned)) - r = PySequence_SetItem(o, i, v); - else { - PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i); - if (!j) - return -1; - r = PyObject_SetItem(o, j, v); - Py_DECREF(j); - } - return r; -} +static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/ -static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ -static PyObject *__Pyx_ImportModule(char *name); /*proto*/ +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ @@ -301,22 +462,22 @@ static PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0; 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; -static PyObject *__pyx_k_4; -static PyObject *__pyx_k_5; -static PyObject *__pyx_k_6; -static PyObject *__pyx_k_7; -static PyObject *__pyx_k_8; -static PyObject *__pyx_k_9; -static PyObject *__pyx_k_10; -static PyObject *__pyx_k_11; -static PyObject *__pyx_k_12; -static PyObject *__pyx_k_13; -static PyObject *__pyx_k_14; -static PyObject *__pyx_k_15; -static PyObject *__pyx_k_16; -static PyObject *__pyx_k_17; -static PyObject *__pyx_k_18; +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*/ @@ -444,6 +605,68 @@ 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"; @@ -476,8 +699,6 @@ 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_size[] = "size"; -static PyObject *__pyx_kp_size; static char __pyx_k_any[] = "any"; static PyObject *__pyx_kp_any; static char __pyx_k_less_equal[] = "less_equal"; @@ -494,8 +715,6 @@ 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_shape[] = "shape"; -static PyObject *__pyx_kp_shape; static char __pyx_k_append[] = "append"; static PyObject *__pyx_kp_append; static char __pyx_k_multiply[] = "multiply"; @@ -746,12 +965,14 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6 PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("cont0_array"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":131 * cdef long i @@ -760,8 +981,10 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6 * return func(state) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":132 * @@ -770,9 +993,13 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6 * else: * array = <ndarray>np.empty(size, np.float64) */ - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -785,24 +1012,40 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6 * length = PyArray_SIZE(array) * array_data = <double *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_19); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __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 = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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 released */ + /* __pyx_t_3 allocated */ + __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 = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":135 * else: @@ -848,22 +1091,26 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6 * * */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.cont0_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -880,12 +1127,14 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_ PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("cont1_array_sc"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":148 * cdef long i @@ -894,8 +1143,10 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_ * return func(state, a) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":149 * @@ -904,9 +1155,13 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_ * else: * array = <ndarray>np.empty(size, np.float64) */ - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -919,24 +1174,40 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_ * length = PyArray_SIZE(array) * array_data = <double *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_19); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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 released */ + /* __pyx_t_3 allocated */ + __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":152 * else: @@ -982,22 +1253,26 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_ * * cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.cont1_array_sc"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -1017,15 +1292,17 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 npy_intp __pyx_v_i; PyArrayIterObject *__pyx_v_itera; PyArrayMultiIterObject *__pyx_v_multi; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - npy_intp __pyx_5; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); + 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; + npy_intp __pyx_t_5; + __Pyx_SetupRefcountContext("cont1_array"); + 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); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":167 * cdef broadcast multi @@ -1034,8 +1311,10 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE) * length = PyArray_SIZE(array) */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":168 * @@ -1044,11 +1323,14 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * length = PyArray_SIZE(array) * array_data = <double *>array.data */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd, __pyx_v_oa->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_SimpleNew(__pyx_v_oa->nd, __pyx_v_oa->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":169 * if size is None: @@ -1075,11 +1357,14 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * for i from 0 <= i < length: * array_data[i] = func(state, (<double *>(itera.dataptr))[0]) */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_itera)); - __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_itera)); + __pyx_v_itera = ((PyArrayIterObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":172 * array_data = <double *>array.data @@ -1119,24 +1404,40 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * array_data = <double *>array.data * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_19); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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 released */ + /* __pyx_t_3 allocated */ + __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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":177 * else: @@ -1154,11 +1455,14 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_3 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":180 * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, @@ -1167,8 +1471,10 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: */ - __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":181 * <void *>oa) @@ -1177,13 +1483,20 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * for i from 0 <= i < multi.size: * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_20); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_20); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_20); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_20); + __Pyx_GIVEREF(__pyx_kp_20); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); 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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -1196,8 +1509,9 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0]) */ - __pyx_5 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; __pyx_v_i++) { + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":183 * raise ValueError("size is not compatible with inputs") @@ -1226,6 +1540,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 1); } + /* __pyx_t_5 released */ } __pyx_L3:; @@ -1236,22 +1551,26 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6 * * cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a, */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.cont1_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); - Py_DECREF(__pyx_v_itera); - Py_DECREF(__pyx_v_multi); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_itera); + __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -1268,12 +1587,14 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_ PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("cont2_array_sc"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":195 * cdef long i @@ -1282,8 +1603,10 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_ * return func(state, a, b) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":196 * @@ -1292,9 +1615,13 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_ * else: * array = <ndarray>np.empty(size, np.float64) */ - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -1307,24 +1634,40 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_ * length = PyArray_SIZE(array) * array_data = <double *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_19); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __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 = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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 released */ + /* __pyx_t_3 allocated */ + __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 = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":199 * else: @@ -1370,22 +1713,26 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_ * * */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.cont2_array_sc"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -1404,14 +1751,16 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 PyArrayObject *arrayObject; npy_intp __pyx_v_i; PyArrayMultiIterObject *__pyx_v_multi; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - npy_intp __pyx_3; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); + 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"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":216 * cdef broadcast multi @@ -1420,8 +1769,10 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob) * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":217 * @@ -1430,11 +1781,14 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) * array_data = <double *>array.data */ - __pyx_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":218 * if size is None: @@ -1443,11 +1797,14 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * array_data = <double *>array.data * for i from 0 <= i < multi.size: */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":219 * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob) @@ -1465,8 +1822,9 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0) * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":221 * array_data = <double *>array.data @@ -1504,6 +1862,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } + /* __pyx_t_3 released */ goto __pyx_L3; } /*else*/ { @@ -1515,24 +1874,40 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * array_data = <double *>array.data * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_19); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); - __pyx_5 = 0; - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_5, 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 released */ + /* __pyx_t_4 allocated */ + __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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":227 * else: @@ -1550,11 +1925,14 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_4 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_4 allocated */ + __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 = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":229 * array_data = <double *>array.data @@ -1563,8 +1941,10 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: */ - __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":230 * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob) @@ -1573,13 +1953,20 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * for i from 0 <= i < multi.size: * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_21); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_21); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __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 allocated */ + __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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -1592,8 +1979,9 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":232 * raise ValueError("size is not compatible with inputs") @@ -1640,6 +2028,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 2); } + /* __pyx_t_3 released */ } __pyx_L3:; @@ -1650,21 +2039,25 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6 * * cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a, */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.cont2_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); - Py_DECREF(__pyx_v_multi); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -1681,12 +2074,14 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_ PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("cont3_array_sc"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":247 * cdef long i @@ -1695,8 +2090,10 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_ * return func(state, a, b, c) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":248 * @@ -1705,9 +2102,13 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_ * else: * array = <ndarray>np.empty(size, np.float64) */ - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b, __pyx_v_c)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b, __pyx_v_c)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -1720,24 +2121,40 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_ * length = PyArray_SIZE(array) * array_data = <double *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_19); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __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 = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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 released */ + /* __pyx_t_3 allocated */ + __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 = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":251 * else: @@ -1783,22 +2200,26 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_ * * cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa, */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.cont3_array_sc"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -1818,14 +2239,16 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 PyArrayObject *arrayObject; npy_intp __pyx_v_i; PyArrayMultiIterObject *__pyx_v_multi; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - npy_intp __pyx_3; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); + 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"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":269 * cdef broadcast multi @@ -1834,8 +2257,10 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc) * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":270 * @@ -1844,11 +2269,14 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) * array_data = <double *>array.data */ - __pyx_2 = PyArray_MultiIterNew(3, ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_MultiIterNew(3, ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":271 * if size is None: @@ -1857,11 +2285,14 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * array_data = <double *>array.data * for i from 0 <= i < multi.size: */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":272 * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc) @@ -1879,8 +2310,9 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0) * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":274 * array_data = <double *>array.data @@ -1927,6 +2359,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } + /* __pyx_t_3 released */ goto __pyx_L3; } /*else*/ { @@ -1938,24 +2371,40 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * array_data = <double *>array.data * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa, */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_19); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); - __pyx_5 = 0; - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __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 = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_5, 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 released */ + /* __pyx_t_4 allocated */ + __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 = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":281 * else: @@ -1973,11 +2422,14 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_4 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_4 allocated */ + __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 = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":284 * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa, @@ -1986,8 +2438,10 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: */ - __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":285 * <void *>ob, <void *>oc) @@ -1996,13 +2450,20 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * for i from 0 <= i < multi.size: * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_22); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_22); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __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 allocated */ + __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 = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -2015,8 +2476,9 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":287 * raise ValueError("size is not compatible with inputs") @@ -2063,6 +2525,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } + /* __pyx_t_3 released */ } __pyx_L3:; @@ -2073,21 +2536,25 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6 * * cdef object disc0_array(rk_state *state, rk_disc0 func, object size): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.cont3_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); - Py_DECREF(__pyx_v_multi); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -2104,12 +2571,14 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6 PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("disc0_array"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":300 * cdef long i @@ -2118,8 +2587,10 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6 * return func(state) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":301 * @@ -2128,9 +2599,13 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6 * else: * array = <ndarray>np.empty(size, int) */ - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -2143,21 +2618,33 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6 * length = PyArray_SIZE(array) * array_data = <long *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_3, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_4 allocated */ + __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 = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":304 * else: @@ -2203,22 +2690,26 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6 * * cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n, double p): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.disc0_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -2235,12 +2726,14 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("discnp_array_sc"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":316 * cdef long i @@ -2249,8 +2742,10 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx * return func(state, n, p) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":317 * @@ -2259,9 +2754,13 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx * else: * array = <ndarray>np.empty(size, int) */ - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -2274,21 +2773,33 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx * length = PyArray_SIZE(array) * array_data = <long *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_3, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_4 allocated */ + __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 = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":320 * else: @@ -2334,22 +2845,26 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx * * cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray on, ndarray op): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.discnp_array_sc"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -2368,14 +2883,16 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ double *__pyx_v_op_data; long *__pyx_v_on_data; PyArrayMultiIterObject *__pyx_v_multi; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - npy_intp __pyx_3; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); + 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"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":335 * cdef broadcast multi @@ -2384,8 +2901,10 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op) * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":336 * @@ -2394,11 +2913,14 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = <long *>array.data */ - __pyx_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":337 * if size is None: @@ -2407,11 +2929,14 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * array_data = <long *>array.data * for i from 0 <= i < multi.size: */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":338 * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op) @@ -2429,8 +2954,9 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * on_data = <long *>PyArray_MultiIter_DATA(multi, 0) * op_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":340 * array_data = <long *>array.data @@ -2468,6 +2994,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ */ PyArray_MultiIter_NEXT(__pyx_v_multi); } + /* __pyx_t_3 released */ goto __pyx_L3; } /*else*/ { @@ -2479,21 +3006,33 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * array_data = <long *>array.data * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_5 allocated */ + __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 = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":346 * else: @@ -2511,11 +3050,14 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_4 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":348 * array_data = <long *>array.data @@ -2524,8 +3066,10 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: */ - __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":349 * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op) @@ -2534,13 +3078,20 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * for i from 0 <= i < multi.size: * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_23); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_23); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __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 allocated */ + __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 = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -2553,8 +3104,9 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) * op_data = <double *>PyArray_MultiIter_DATA(multi, 2) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":351 * raise ValueError("size is not compatible with inputs") @@ -2601,6 +3153,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 2); } + /* __pyx_t_3 released */ } __pyx_L3:; @@ -2611,21 +3164,25 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_ * * cdef object discdd_array_sc(rk_state *state, rk_discdd func, object size, double n, double p): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.discnp_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); - Py_DECREF(__pyx_v_multi); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -2642,12 +3199,14 @@ static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *__pyx_v_state, __pyx PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("discdd_array_sc"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":365 * cdef long i @@ -2656,8 +3215,10 @@ static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *__pyx_v_state, __pyx * return func(state, n, p) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":366 * @@ -2666,9 +3227,13 @@ static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *__pyx_v_state, __pyx * else: * array = <ndarray>np.empty(size, int) */ - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -2681,21 +3246,33 @@ static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *__pyx_v_state, __pyx * length = PyArray_SIZE(array) * array_data = <long *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_3, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_4 allocated */ + __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 = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":369 * else: @@ -2741,22 +3318,26 @@ static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *__pyx_v_state, __pyx * * cdef object discdd_array(rk_state *state, rk_discdd func, object size, ndarray on, ndarray op): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.discdd_array_sc"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -2775,14 +3356,16 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ double *__pyx_v_op_data; double *__pyx_v_on_data; PyArrayMultiIterObject *__pyx_v_multi; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - npy_intp __pyx_3; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); + 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"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":384 * cdef broadcast multi @@ -2791,8 +3374,10 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op) * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":385 * @@ -2801,11 +3386,14 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = <long *>array.data */ - __pyx_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":386 * if size is None: @@ -2814,11 +3402,14 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * array_data = <long *>array.data * for i from 0 <= i < multi.size: */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":387 * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op) @@ -2836,8 +3427,9 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * on_data = <double *>PyArray_MultiIter_DATA(multi, 0) * op_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":389 * array_data = <long *>array.data @@ -2875,6 +3467,7 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ */ PyArray_MultiIter_NEXT(__pyx_v_multi); } + /* __pyx_t_3 released */ goto __pyx_L3; } /*else*/ { @@ -2886,21 +3479,33 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * array_data = <long *>array.data * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_5 allocated */ + __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 = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":395 * else: @@ -2918,11 +3523,14 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_4 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __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_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":397 * array_data = <long *>array.data @@ -2931,8 +3539,10 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: */ - __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":398 * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op) @@ -2941,13 +3551,20 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * for i from 0 <= i < multi.size: * on_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_24); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_24); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __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 allocated */ + __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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -2960,8 +3577,9 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * on_data = <double *>PyArray_MultiIter_DATA(multi, 1) * op_data = <double *>PyArray_MultiIter_DATA(multi, 2) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":400 * raise ValueError("size is not compatible with inputs") @@ -3008,6 +3626,7 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 2); } + /* __pyx_t_3 released */ } __pyx_L3:; @@ -3018,21 +3637,25 @@ static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state, __pyx_t_ * * cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size, */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.discdd_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); - Py_DECREF(__pyx_v_multi); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -3049,12 +3672,14 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("discnmN_array_sc"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":415 * cdef long i @@ -3063,8 +3688,10 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py * return func(state, n, m, N) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":416 * @@ -3073,9 +3700,13 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py * else: * array = <ndarray>np.empty(size, int) */ - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_m, __pyx_v_N)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_m, __pyx_v_N)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -3088,21 +3719,33 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py * length = PyArray_SIZE(array) * array_data = <long *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_3, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_4 allocated */ + __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 = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":419 * else: @@ -3148,22 +3791,26 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py * * cdef object discnmN_array(rk_state *state, rk_discnmN func, object size, */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.discnmN_array_sc"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -3183,14 +3830,16 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t PyArrayObject *arrayObject; npy_intp __pyx_v_i; PyArrayMultiIterObject *__pyx_v_multi; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - npy_intp __pyx_3; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); + 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"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":436 * cdef broadcast multi @@ -3199,8 +3848,10 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN) * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":437 * @@ -3209,11 +3860,14 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = <long *>array.data */ - __pyx_2 = PyArray_MultiIterNew(3, ((void *)__pyx_v_on), ((void *)__pyx_v_om), ((void *)__pyx_v_oN)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_MultiIterNew(3, ((void *)__pyx_v_on), ((void *)__pyx_v_om), ((void *)__pyx_v_oN)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":438 * if size is None: @@ -3222,11 +3876,14 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * array_data = <long *>array.data * for i from 0 <= i < multi.size: */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":439 * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN) @@ -3244,8 +3901,9 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * on_data = <long *>PyArray_MultiIter_DATA(multi, 0) * om_data = <long *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":441 * array_data = <long *>array.data @@ -3292,6 +3950,7 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t */ PyArray_MultiIter_NEXT(__pyx_v_multi); } + /* __pyx_t_3 released */ goto __pyx_L3; } /*else*/ { @@ -3303,21 +3962,33 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * array_data = <long *>array.data * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om, */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_5 allocated */ + __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 = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":448 * else: @@ -3335,11 +4006,14 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_4 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_om), ((void *)__pyx_v_oN)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_om), ((void *)__pyx_v_oN)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __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_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":451 * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om, @@ -3348,8 +4022,10 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: */ - __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":452 * <void *>oN) @@ -3358,13 +4034,20 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * for i from 0 <= i < multi.size: * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_25); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_25); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __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 allocated */ + __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 = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -3377,8 +4060,9 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) * om_data = <long *>PyArray_MultiIter_DATA(multi, 2) */ - __pyx_3 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":454 * raise ValueError("size is not compatible with inputs") @@ -3425,6 +4109,7 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t */ PyArray_MultiIter_NEXT(__pyx_v_multi); } + /* __pyx_t_3 released */ } __pyx_L3:; @@ -3435,21 +4120,25 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t * * cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.discnmN_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); - Py_DECREF(__pyx_v_multi); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -3466,12 +4155,14 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_ PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + 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; + __Pyx_SetupRefcountContext("discd_array_sc"); + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":468 * cdef long i @@ -3480,8 +4171,10 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_ * return func(state, a) * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":469 * @@ -3490,9 +4183,13 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_ * else: * array = <ndarray>np.empty(size, int) */ - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_a)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_a)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; goto __pyx_L3; } @@ -3505,21 +4202,33 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_ * length = PyArray_SIZE(array) * array_data = <long *>array.data */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_3, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_4 allocated */ + __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 = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":472 * else: @@ -3565,22 +4274,26 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_ * * cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.discd_array_sc"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -3600,15 +4313,17 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 npy_intp __pyx_v_i; PyArrayMultiIterObject *__pyx_v_multi; PyArrayIterObject *__pyx_v_itera; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - npy_intp __pyx_5; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); + 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; + npy_intp __pyx_t_5; + __Pyx_SetupRefcountContext("discd_array"); + 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); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":487 * cdef flatiter itera @@ -3617,8 +4332,10 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG) * length = PyArray_SIZE(array) */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":488 * @@ -3627,11 +4344,14 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * length = PyArray_SIZE(array) * array_data = <long *>array.data */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd, __pyx_v_oa->dimensions, NPY_LONG); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_SimpleNew(__pyx_v_oa->nd, __pyx_v_oa->dimensions, NPY_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":489 * if size is None: @@ -3658,11 +4378,14 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * for i from 0 <= i < length: * array_data[i] = func(state, (<double *>(itera.dataptr))[0]) */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_itera)); - __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_itera)); + __pyx_v_itera = ((PyArrayIterObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":492 * array_data = <long *>array.data @@ -3702,21 +4425,33 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * array_data = <long *>array.data * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyInt_Type)); - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_3, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_4 allocated */ + __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 = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":497 * else: @@ -3734,11 +4469,14 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_3 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":499 * array_data = <long *>array.data @@ -3747,8 +4485,10 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: */ - __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":500 * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa) @@ -3757,13 +4497,20 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * for i from 0 <= i < multi.size: * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_26); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_26); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_26); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_26); + __Pyx_GIVEREF(__pyx_kp_26); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -3776,8 +4523,9 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0]) */ - __pyx_5 = __pyx_v_multi->size; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; __pyx_v_i++) { + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":502 * raise ValueError("size is not compatible with inputs") @@ -3806,6 +4554,7 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 1); } + /* __pyx_t_5 released */ } __pyx_L3:; @@ -3816,22 +4565,26 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6 * * cdef double kahan_sum(double *darr, long n): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.discd_array"); __pyx_r = 0; __pyx_L0:; - Py_DECREF(arrayObject); - Py_DECREF(__pyx_v_multi); - Py_DECREF(__pyx_v_itera); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_DECREF((PyObject *)__pyx_v_itera); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -3850,6 +4603,7 @@ static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr, long __pyx_v_n) { double __pyx_v_sum; long __pyx_v_i; double __pyx_r; + __Pyx_SetupRefcountContext("kahan_sum"); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":510 * cdef double c, y, t, sum @@ -3927,6 +4681,7 @@ static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr, long __pyx_v_n) { __pyx_r = 0; __pyx_L0:; + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -3942,24 +4697,46 @@ static int __pyx_pf_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObj static int __pyx_pf_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seed = 0; int __pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - static char *__pyx_argnames[] = {"seed",0}; - __pyx_v_seed = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0); + 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__"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[1] = {0}; + values[0] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_seed); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_seed = values[0]; + } else { + __pyx_v_seed = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.__init__"); return -1; - __pyx_L4:; + __pyx_L4_argument_unpacking_done:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":547 * @@ -3977,24 +4754,35 @@ static int __pyx_pf_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObj * * def __dealloc__(self): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_seed); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_seed); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed); - __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __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 allocated */ + __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 = 549; __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_t_1 released */ + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("mtrand.RandomState.__init__"); __pyx_r = -1; __pyx_L0:; + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4008,7 +4796,8 @@ static int __pyx_pf_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObj 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_1; + int __pyx_t_1; + __Pyx_SetupRefcountContext("__dealloc__"); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":552 * @@ -4017,8 +4806,10 @@ static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) { * PyMem_Free(self.internal_state) * self.internal_state = NULL */ - __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":553 * def __dealloc__(self): @@ -4041,6 +4832,7 @@ static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) { } __pyx_L5:; + __Pyx_FinishRefcountContext(); } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":556 @@ -4058,28 +4850,51 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO rk_error __pyx_v_errcode; PyArrayObject *arrayObject_obj; PyObject *__pyx_v_iseed; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - unsigned long __pyx_4; - static char *__pyx_argnames[] = {"seed",0}; - __pyx_v_seed = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0); + PyObject *__pyx_r = NULL; + PyObject *__pyx_1 = 0; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + unsigned long __pyx_t_4; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_seed,0}; + __Pyx_SetupRefcountContext("seed"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[1] = {0}; + values[0] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_seed); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "seed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_seed = values[0]; + } else { + __pyx_v_seed = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("seed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.seed"); return NULL; - __pyx_L4:; - arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_iseed = Py_None; Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + arrayObject_obj = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_iseed = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":570 * cdef rk_error errcode @@ -4088,8 +4903,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * errcode = rk_randomseed(self.internal_state) * elif type(seed) is int: */ - __pyx_1 = (__pyx_v_seed == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_seed == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":571 * cdef ndarray obj "arrayObject_obj" @@ -4099,7 +4916,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * rk_seed(seed, self.internal_state) */ __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - goto __pyx_L5; + goto __pyx_L6; } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":572 @@ -4109,14 +4926,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * rk_seed(seed, self.internal_state) * elif isinstance(seed, np.integer): */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_seed); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed); - __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = (__pyx_3 == ((PyObject*)&PyInt_Type)); - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __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 allocated */ + __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 = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_t_3 == ((PyObject *)((PyObject*)&PyInt_Type))); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":573 * errcode = rk_randomseed(self.internal_state) @@ -4125,9 +4951,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * elif isinstance(seed, np.integer): * iseed = int(seed) */ - __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (unlikely((__pyx_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - rk_seed(__pyx_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - goto __pyx_L5; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (unlikely((__pyx_t_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + rk_seed(__pyx_t_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + /* __pyx_t_4 released */ + goto __pyx_L6; } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":574 @@ -4137,12 +4965,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * iseed = int(seed) * rk_seed(iseed, self.internal_state) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_integer); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsInstance(__pyx_v_seed, __pyx_3); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_IsInstance(__pyx_v_seed, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":575 * rk_seed(seed, self.internal_state) @@ -4151,14 +4985,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * rk_seed(iseed, self.internal_state) * else: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_seed); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed); - __pyx_3 = PyObject_Call(((PyObject*)&PyInt_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_DECREF(__pyx_v_iseed); - __pyx_v_iseed = __pyx_3; - __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_seed); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seed); + __Pyx_GIVEREF(__pyx_v_seed); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_DECREF(__pyx_v_iseed); + __pyx_v_iseed = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":576 * elif isinstance(seed, np.integer): @@ -4167,9 +5008,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * else: * obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) */ - __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (unlikely((__pyx_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - rk_seed(__pyx_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - goto __pyx_L5; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (unlikely((__pyx_t_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + rk_seed(__pyx_t_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + /* __pyx_t_4 released */ + goto __pyx_L6; } /*else*/ { @@ -4180,11 +5023,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO * init_by_array(self.internal_state, <unsigned long *>(obj.data), * obj.dimensions[0]) */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed, NPY_LONG, 1, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_seed, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject_obj)); + arrayObject_obj = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":580 * obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) @@ -4195,18 +5041,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO */ init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, ((unsigned long *)arrayObject_obj->data), (arrayObject_obj->dimensions[0])); } - __pyx_L5:; + __pyx_L6:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("mtrand.RandomState.seed"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(arrayObject_obj); - Py_DECREF(__pyx_v_iseed); + __Pyx_DECREF((PyObject *)arrayObject_obj); + __Pyx_DECREF(__pyx_v_iseed); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4222,12 +5071,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self static char __pyx_doc_6mtrand_11RandomState_get_state[] = "\n get_state()\n\n Return a tuple representing the internal state of the generator.\n\n Returns\n -------\n out : tuple(string, list of 624 integers, int, int, float)\n The returned tuple has the following items:\n\n 1. the string 'MT19937'\n 2. a list of 624 integer keys\n 3. an integer pos\n 4. an integer has_gauss\n 5. and a float cached_gaussian\n\n See Also\n --------\n set_state\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *unused) { PyArrayObject *arrayObject_state; - PyObject *__pyx_r; + PyObject *__pyx_r = NULL; PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_SetupRefcountContext("get_state"); + arrayObject_state = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":605 * """ @@ -4237,23 +5088,39 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self * state = <ndarray>np.asarray(state, np.uint32) */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __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 = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_uint); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_int_624); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_int_624); - PyTuple_SET_ITEM(__pyx_1, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)arrayObject_state)); - arrayObject_state = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_uint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_int_624); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_624); + __Pyx_GIVEREF(__pyx_int_624); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject_state)); + arrayObject_state = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":606 * cdef ndarray state "arrayObject_state" @@ -4271,24 +5138,40 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self * return ('MT19937', state, self.internal_state.pos, * self.internal_state.has_gauss, self.internal_state.gauss) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_asarray); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_27); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject_state)); - arrayObject_state = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_asarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __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 = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_27); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(((PyObject *)arrayObject_state)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)arrayObject_state)); + __Pyx_GIVEREF(((PyObject *)arrayObject_state)); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_1 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject_state)); + arrayObject_state = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":608 * memcpy(<void*>(state.data), <void*>(self.internal_state.key), 624*sizeof(long)) @@ -4297,7 +5180,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self * self.internal_state.has_gauss, self.internal_state.gauss) * */ - __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":609 * state = <ndarray>np.asarray(state, np.uint32) @@ -4306,34 +5192,52 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self * * def set_state(self, state): */ - __pyx_3 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_28); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_28); - Py_INCREF(((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_4, 2, __pyx_1); - PyTuple_SET_ITEM(__pyx_4, 3, __pyx_3); - PyTuple_SET_ITEM(__pyx_4, 4, __pyx_2); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_2 = 0; - __pyx_r = ((PyObject *)__pyx_4); - __pyx_4 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_28); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_28); + __Pyx_GIVEREF(__pyx_kp_28); + __Pyx_INCREF(((PyObject *)arrayObject_state)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)arrayObject_state)); + __Pyx_GIVEREF(((PyObject *)arrayObject_state)); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_2 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_1 released */ + /* __pyx_t_2 released */ + __pyx_r = ((PyObject *)__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.get_state"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(arrayObject_state); + __Pyx_DECREF((PyObject *)arrayObject_state); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4354,20 +5258,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self PyObject *__pyx_v_key; PyObject *__pyx_v_has_gauss; PyObject *__pyx_v_cached_gaussian; - PyObject *__pyx_r; + PyObject *__pyx_r = NULL; PyObject *__pyx_1 = 0; - int __pyx_2; + PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; int __pyx_5; - Py_ssize_t __pyx_6 = 0; - PyObject *__pyx_7 = 0; - double __pyx_8; - arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_algorithm_name = Py_None; Py_INCREF(Py_None); - __pyx_v_key = Py_None; Py_INCREF(Py_None); - __pyx_v_has_gauss = Py_None; Py_INCREF(Py_None); - __pyx_v_cached_gaussian = Py_None; Py_INCREF(Py_None); + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + double __pyx_t_6; + __Pyx_SetupRefcountContext("set_state"); + arrayObject_obj = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_algorithm_name = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_has_gauss = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_cached_gaussian = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":647 * cdef ndarray obj "arrayObject_obj" @@ -4376,8 +5284,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * if algorithm_name != 'MT19937': * raise ValueError("algorithm must be 'MT19937'") */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_state, 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_algorithm_name); + __pyx_1 = __Pyx_GetItemInt(__pyx_v_state, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(__pyx_v_algorithm_name); __pyx_v_algorithm_name = __pyx_1; __pyx_1 = 0; @@ -4388,10 +5297,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * raise ValueError("algorithm must be 'MT19937'") * key, pos = state[1:3] */ - __pyx_1 = PyObject_RichCompare(__pyx_v_algorithm_name, __pyx_kp_29, Py_NE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (__pyx_2) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_algorithm_name, __pyx_kp_29, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + if (__pyx_t_2) { + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":649 * algorithm_name = state[0] @@ -4400,13 +5314,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * key, pos = state[1:3] * if len(state) == 3: */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_30); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_30); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_kp_30); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_30); + __Pyx_GIVEREF(__pyx_kp_30); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } @@ -4420,33 +5341,38 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * has_gauss = 0 */ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) { PyObject* tuple = __pyx_1; - __pyx_4 = PyTuple_GET_ITEM(tuple, 0); - Py_INCREF(__pyx_4); - Py_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_4; - __pyx_4 = 0; - __pyx_4 = PyTuple_GET_ITEM(tuple, 1); - Py_INCREF(__pyx_4); - __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_v_pos = __pyx_5; - Py_DECREF(__pyx_1); __pyx_1 = 0; - } - else { - __pyx_3 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_4 = __Pyx_UnpackItem(__pyx_3, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_4; - __pyx_4 = 0; - __pyx_4 = __Pyx_UnpackItem(__pyx_3, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_v_pos = __pyx_5; - if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_3); + __pyx_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_4); + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_v_key); + __pyx_v_key = __pyx_3; + __pyx_3 = 0; + __pyx_v_pos = __pyx_t_4; + /* __pyx_t_4 released */ + } else { + __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_3); + __pyx_4 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_4); + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_4); __pyx_4 = 0; + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_DECREF(__pyx_v_key); + __pyx_v_key = __pyx_3; + __pyx_3 = 0; + __pyx_v_pos = __pyx_t_4; + /* __pyx_t_4 released */ } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":651 @@ -4456,9 +5382,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * has_gauss = 0 * cached_gaussian = 0.0 */ - __pyx_6 = PyObject_Length(__pyx_v_state); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = (__pyx_6 == 3); - if (__pyx_2) { + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Length(__pyx_v_state); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* __pyx_t_2 allocated */ + __pyx_t_2 = (__pyx_t_5 == 3); + /* __pyx_t_5 released */ + if (__pyx_t_2) { + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":652 * key, pos = state[1:3] @@ -4467,8 +5397,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * cached_gaussian = 0.0 * else: */ - Py_INCREF(__pyx_int_0); - Py_DECREF(__pyx_v_has_gauss); + __Pyx_INCREF(__pyx_int_0); + __Pyx_DECREF(__pyx_v_has_gauss); __pyx_v_has_gauss = __pyx_int_0; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":653 @@ -4478,10 +5408,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * else: * has_gauss, cached_gaussian = state[3:5] */ - __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_cached_gaussian); - __pyx_v_cached_gaussian = __pyx_4; - __pyx_4 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_v_cached_gaussian); + __pyx_v_cached_gaussian = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L6; } /*else*/ { @@ -4493,34 +5426,35 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * try: * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) */ - __pyx_1 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) { - PyObject* tuple = __pyx_1; - __pyx_4 = PyTuple_GET_ITEM(tuple, 0); - Py_INCREF(__pyx_4); - Py_DECREF(__pyx_v_has_gauss); - __pyx_v_has_gauss = __pyx_4; - __pyx_4 = 0; - __pyx_4 = PyTuple_GET_ITEM(tuple, 1); - Py_INCREF(__pyx_4); - Py_DECREF(__pyx_v_cached_gaussian); - __pyx_v_cached_gaussian = __pyx_4; - __pyx_4 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - } - else { - __pyx_3 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_4 = __Pyx_UnpackItem(__pyx_3, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_has_gauss); - __pyx_v_has_gauss = __pyx_4; - __pyx_4 = 0; - __pyx_4 = __Pyx_UnpackItem(__pyx_3, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_cached_gaussian); - __pyx_v_cached_gaussian = __pyx_4; - __pyx_4 = 0; - if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_4); + if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) { + PyObject* tuple = __pyx_4; + __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2); + __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3); + __Pyx_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_DECREF(__pyx_v_has_gauss); + __pyx_v_has_gauss = __pyx_2; + __pyx_2 = 0; + __Pyx_DECREF(__pyx_v_cached_gaussian); + __pyx_v_cached_gaussian = __pyx_3; + __pyx_3 = 0; + } else { + __pyx_1 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_3); + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_v_has_gauss); + __pyx_v_has_gauss = __pyx_2; + __pyx_2 = 0; + __Pyx_DECREF(__pyx_v_cached_gaussian); + __pyx_v_cached_gaussian = __pyx_3; + __pyx_3 = 0; } } __pyx_L6:; @@ -4532,58 +5466,89 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) * except TypeError: */ - /*try:*/ { - - /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":657 + { + PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; + __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); + __Pyx_XGOTREF(__pyx_save_exc_type); + __Pyx_XGOTREF(__pyx_save_exc_value); + __Pyx_XGOTREF(__pyx_save_exc_tb); + /*try:*/ { + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":657 * has_gauss, cached_gaussian = state[3:5] * try: * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) # <<<<<<<<<<<<<< * except TypeError: * # compatibility -- could be an older pickle */ - __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_ULONG, 1, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; - } - goto __pyx_L8; - __pyx_L7_error:; - Py_XDECREF(__pyx_1); __pyx_1 = 0; - Py_XDECREF(__pyx_3); __pyx_3 = 0; - Py_XDECREF(__pyx_4); __pyx_4 = 0; - - /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":658 + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_ULONG, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject_obj)); + arrayObject_obj = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + } + __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; + __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; + __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_4); __pyx_4 = 0; + __Pyx_XDECREF(__pyx_1); __pyx_1 = 0; + __Pyx_XDECREF(__pyx_2); __pyx_2 = 0; + __Pyx_XDECREF(__pyx_3); __pyx_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":658 * try: * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) * except TypeError: # <<<<<<<<<<<<<< * # compatibility -- could be an older pickle * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) */ - __pyx_5 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_5) { - __Pyx_AddTraceback("mtrand.set_state"); - if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_5) { + __Pyx_AddTraceback("mtrand.set_state"); + if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_4); + __Pyx_GOTREF(__pyx_1); + __Pyx_GOTREF(__pyx_2); - /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":660 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":660 * except TypeError: * # compatibility -- could be an older pickle * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) # <<<<<<<<<<<<<< * if obj.dimensions[0] != 624: * raise ValueError("state must be 624 longs") */ - __pyx_7 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_LONG, 1, 1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_7))); - Py_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_7); - Py_DECREF(__pyx_7); __pyx_7 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - goto __pyx_L8; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)arrayObject_obj)); + arrayObject_obj = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + __Pyx_XDECREF(__pyx_save_exc_type); + __Pyx_XDECREF(__pyx_save_exc_value); + __Pyx_XDECREF(__pyx_save_exc_tb); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_save_exc_type); + __Pyx_XGIVEREF(__pyx_save_exc_value); + __Pyx_XGIVEREF(__pyx_save_exc_tb); + __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); + __pyx_L14_try_end:; } - goto __pyx_L1_error; - __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":661 * # compatibility -- could be an older pickle @@ -4592,8 +5557,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * raise ValueError("state must be 624 longs") * memcpy(<void*>(self.internal_state.key), <void*>(obj.data), 624*sizeof(long)) */ - __pyx_2 = ((arrayObject_obj->dimensions[0]) != 624); - if (__pyx_2) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = ((arrayObject_obj->dimensions[0]) != 624); + if (__pyx_t_2) { + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":662 * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) @@ -4602,17 +5569,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * memcpy(<void*>(self.internal_state.key), <void*>(obj.data), 624*sizeof(long)) * self.internal_state.pos = pos */ - __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_31); - PyTuple_SET_ITEM(__pyx_7, 0, __pyx_kp_31); - __pyx_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_7), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_7)); __pyx_7 = 0; - __Pyx_Raise(__pyx_1, 0, 0); - Py_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_31); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_31); + __Pyx_GIVEREF(__pyx_kp_31); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L17; } - __pyx_L9:; + __pyx_L17:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":663 * if obj.dimensions[0] != 624: @@ -4639,8 +5613,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * self.internal_state.gauss = cached_gaussian * */ - __pyx_5 = __pyx_PyInt_int(__pyx_v_has_gauss); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_5; + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_PyInt_int(__pyx_v_has_gauss); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_t_4; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":666 * self.internal_state.pos = pos @@ -4649,24 +5625,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self * * # Pickling support: */ - __pyx_8 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_8; + /* __pyx_t_6 allocated */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_t_6; + /* __pyx_t_6 released */ - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_7); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_2); + __Pyx_XDECREF(__pyx_3); + __Pyx_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("mtrand.RandomState.set_state"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(arrayObject_obj); - Py_DECREF(__pyx_v_algorithm_name); - Py_DECREF(__pyx_v_key); - Py_DECREF(__pyx_v_has_gauss); - Py_DECREF(__pyx_v_cached_gaussian); + __Pyx_DECREF((PyObject *)arrayObject_obj); + __Pyx_DECREF(__pyx_v_algorithm_name); + __Pyx_DECREF(__pyx_v_key); + __Pyx_DECREF(__pyx_v_has_gauss); + __Pyx_DECREF(__pyx_v_cached_gaussian); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4680,9 +5662,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self static PyObject *__pyx_pf_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_SetupRefcountContext("__getstate__"); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":670 * # Pickling support: @@ -4691,21 +5674,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_s * * def __setstate__(self, state): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_state); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("mtrand.RandomState.__getstate__"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4719,10 +5711,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_s static PyObject *__pyx_pf_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/ static PyObject *__pyx_pf_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_SetupRefcountContext("__setstate__"); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":673 * @@ -4731,24 +5724,36 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_s * * def __reduce__(self): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_set_state); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state); - __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - - __pyx_r = Py_None; Py_INCREF(Py_None); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_set_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + /* __pyx_t_3 allocated */ + __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 = 673; __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_t_1 released */ + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("mtrand.RandomState.__setstate__"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4762,10 +5767,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_s static PyObject *__pyx_pf_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; + PyObject *__pyx_r = NULL; PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_SetupRefcountContext("__reduce__"); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":676 * @@ -4774,34 +5781,57 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_sel * * # Basic distributions: */ + __Pyx_XDECREF(__pyx_r); __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_random); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp___RandomState_ctor); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_state); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); - Py_INCREF(((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_2, 2, __pyx_3); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_r = ((PyObject *)__pyx_2); - __pyx_2 = 0; + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_random); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_kp___RandomState_ctor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); + __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; + /* __pyx_t_1 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("mtrand.RandomState.__reduce__"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4817,23 +5847,45 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_ static char __pyx_doc_6mtrand_11RandomState_random_sample[] = "\n random_sample(size=None)\n\n Return random floats in the half-open interval [0.0, 1.0).\n\n Parameters\n ----------\n size : shape tuple, optional\n Defines the shape of the returned array of random floats.\n\n Returns\n -------\n out : ndarray, floats\n Array of random of floats with shape of `size`.\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - static char *__pyx_argnames[] = {"size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("random_sample"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[1] = {0}; + values[0] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "random_sample") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_size = values[0]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("random_sample", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.random_sample"); return NULL; - __pyx_L4:; + __pyx_L4_argument_unpacking_done:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":696 * @@ -4842,18 +5894,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_ * * def tomaxint(self, size=None): */ - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_double, __pyx_v_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_double, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("mtrand.RandomState.random_sample"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4869,23 +5927,45 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, static char __pyx_doc_6mtrand_11RandomState_tomaxint[] = "\n tomaxint(size=None)\n\n Uniformly sample discrete random integers `x` such that\n ``0 <= x <= sys.maxint``.\n\n Parameters\n ----------\n size : tuple of ints, int, optional\n Shape of output. If the given size is, for example, (m,n,k),\n m*n*k samples are generated. If no shape is specified, a single sample\n is returned.\n\n Returns\n -------\n out : ndarray\n Drawn samples, with shape `size`.\n\n See Also\n --------\n randint : Uniform sampling over a given half-open interval of integers.\n random_integers : Uniform sampling over a given closed interval of\n integers.\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - static char *__pyx_argnames[] = {"size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("tomaxint"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[1] = {0}; + values[0] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tomaxint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_size = values[0]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tomaxint", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.tomaxint"); return NULL; - __pyx_L4:; + __pyx_L4_argument_unpacking_done:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":724 * @@ -4894,18 +5974,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, * * def randint(self, low, high=None, size=None): */ - __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_long, __pyx_v_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_long, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("mtrand.RandomState.tomaxint"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -4930,33 +6016,68 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyArrayObject *arrayObject; long __pyx_v_length; long __pyx_v_i; - PyObject *__pyx_r; - int __pyx_1; - long __pyx_2; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"low","high","size",0}; - __pyx_v_high = Py_None; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_low = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + PyObject *__pyx_r = NULL; + PyObject *__pyx_1 = 0; + int __pyx_t_1; + long __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_low,&__pyx_kp_high,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("randint"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[1] = Py_None; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_low); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_high); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "randint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_low = values[0]; + __pyx_v_high = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_high = Py_None; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_low = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("randint", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.randint"); return NULL; - __pyx_L4:; - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":741 * cdef long i @@ -4965,8 +6086,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * lo = 0 * hi = low */ - __pyx_1 = (__pyx_v_high == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_high == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":742 * @@ -4984,9 +6107,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * else: * lo = low */ - __pyx_2 = __pyx_PyInt_long(__pyx_v_low); if (unlikely((__pyx_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_hi = __pyx_2; - goto __pyx_L5; + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_PyInt_long(__pyx_v_low); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_hi = __pyx_t_2; + /* __pyx_t_2 released */ + goto __pyx_L6; } /*else*/ { @@ -4997,8 +6122,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * hi = high * */ - __pyx_2 = __pyx_PyInt_long(__pyx_v_low); if (unlikely((__pyx_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_lo = __pyx_2; + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_PyInt_long(__pyx_v_low); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lo = __pyx_t_2; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":746 * else: @@ -5007,10 +6134,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * * diff = hi - lo - 1 */ - __pyx_2 = __pyx_PyInt_long(__pyx_v_high); if (unlikely((__pyx_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_hi = __pyx_2; + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_PyInt_long(__pyx_v_high); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_hi = __pyx_t_2; + /* __pyx_t_2 released */ } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":748 * hi = high @@ -5028,8 +6157,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * raise ValueError("low >= high") * */ - __pyx_1 = (__pyx_v_diff < 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_diff < 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":750 * diff = hi - lo - 1 @@ -5038,17 +6169,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * * if size is None: */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_32); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_32); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_32); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_32); + __Pyx_GIVEREF(__pyx_kp_32); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":752 * raise ValueError("low >= high") @@ -5057,8 +6195,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * return <long>rk_interval(diff, self.internal_state) + lo * else: */ - __pyx_1 = (__pyx_v_size == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_size == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":753 * @@ -5067,11 +6207,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * else: * array = <ndarray>np.empty(size, int) */ - __pyx_3 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - goto __pyx_L7; + goto __pyx_L8; } /*else*/ { @@ -5082,21 +6226,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * length = PyArray_SIZE(array) * array_data = <long *>array.data */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject*)&PyInt_Type)); - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_3, 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))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); + __Pyx_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":756 * else: @@ -5142,22 +6298,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, * * def bytes(self, unsigned int length): */ - Py_INCREF(((PyObject *)arrayObject)); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } - __pyx_L7:; + __pyx_L8:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.randint"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(arrayObject); + __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -5175,17 +6335,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, Py unsigned int __pyx_v_length; void *__pyx_v_bytes; PyObject *__pyx_v_bytestring; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_SetupRefcountContext("bytes"); assert(__pyx_arg_length); { __pyx_v_length = PyInt_AsUnsignedLongMask(__pyx_arg_length); if (unlikely((__pyx_v_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.bytes"); return NULL; - __pyx_L4:; - __pyx_v_bytestring = Py_None; Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_bytestring = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":785 * """ @@ -5194,10 +6355,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, Py * bytes = PyString_AS_STRING(bytestring) * rk_fill(bytes, length, self.internal_state) */ - __pyx_1 = PyString_FromStringAndSize(NULL, __pyx_v_length); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_bytestring); - __pyx_v_bytestring = __pyx_1; - __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyString_FromStringAndSize(NULL, __pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_v_bytestring); + __pyx_v_bytestring = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":786 * cdef void *bytes @@ -5224,18 +6388,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, Py * * def uniform(self, low=0.0, high=1.0, size=None): */ - Py_INCREF(__pyx_v_bytestring); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_bytestring); __pyx_r = __pyx_v_bytestring; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("mtrand.RandomState.bytes"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_bytestring); + __Pyx_DECREF(__pyx_v_bytestring); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -5259,38 +6426,73 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, double __pyx_v_flow; double __pyx_v_fhigh; PyObject *__pyx_v_temp; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - static char *__pyx_argnames[] = {"low","high","size",0}; - __pyx_v_low = __pyx_k_3; - __pyx_v_high = __pyx_k_4; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_low = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); - } + 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; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_low,&__pyx_kp_high,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("uniform"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k_3; + values[1] = __pyx_k_4; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_low); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_high); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "uniform") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_low = values[0]; + __pyx_v_high = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_low = __pyx_k_3; + __pyx_v_high = __pyx_k_4; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_low = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("uniform", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.uniform"); return NULL; - __pyx_L4:; - __pyx_v_olow = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_ohigh = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_odiff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_temp = Py_None; Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_olow = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_ohigh = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_odiff = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_temp = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":865 * cdef object temp @@ -5317,8 +6519,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow) * PyErr_Clear() */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":868 * fhigh = PyFloat_AsDouble(high) @@ -5327,13 +6531,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, * PyErr_Clear() * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED) */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_uniform, __pyx_v_size, __pyx_v_flow, (__pyx_v_fhigh - __pyx_v_flow)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_uniform, __pyx_v_size, __pyx_v_flow, (__pyx_v_fhigh - __pyx_v_flow)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":869 * if not PyErr_Occurred(): @@ -5351,11 +6559,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED) * temp = np.subtract(ohigh, olow) */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_low, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_olow)); - __pyx_v_olow = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_low, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_olow)); + __pyx_v_olow = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":871 * PyErr_Clear() @@ -5364,11 +6575,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, * temp = np.subtract(ohigh, olow) * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_high, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_ohigh)); - __pyx_v_ohigh = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_high, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_ohigh)); + __pyx_v_ohigh = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":872 * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED) @@ -5377,20 +6591,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting * # rules because EnsureArray steals a reference */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_subtract); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_ohigh)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ohigh)); - Py_INCREF(((PyObject *)__pyx_v_olow)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_olow)); - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_DECREF(__pyx_v_temp); - __pyx_v_temp = __pyx_4; - __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_subtract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_ohigh)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ohigh)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ohigh)); + __Pyx_INCREF(((PyObject *)__pyx_v_olow)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_olow)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_olow)); + /* __pyx_t_4 allocated */ + __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 = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_DECREF(__pyx_v_temp); + __pyx_v_temp = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":873 * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED) @@ -5408,11 +6634,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff) * */ - __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_odiff)); - __pyx_v_odiff = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyArray_EnsureArray(__pyx_v_temp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_DECREF(((PyObject *)__pyx_v_odiff)); + __pyx_v_odiff = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":876 * # rules because EnsureArray steals a reference @@ -5421,24 +6650,31 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, * * def rand(self, *args): */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_uniform, __pyx_v_size, __pyx_v_olow, __pyx_v_odiff); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_uniform, __pyx_v_size, __pyx_v_olow, __pyx_v_odiff); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.uniform"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_olow); - Py_DECREF(__pyx_v_ohigh); - Py_DECREF(__pyx_v_odiff); - Py_DECREF(__pyx_v_temp); + __Pyx_DECREF((PyObject *)__pyx_v_olow); + __Pyx_DECREF((PyObject *)__pyx_v_ohigh); + __Pyx_DECREF((PyObject *)__pyx_v_odiff); + __Pyx_DECREF(__pyx_v_temp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -5454,16 +6690,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyO static char __pyx_doc_6mtrand_11RandomState_rand[] = "\n rand(d0, d1, ..., dn)\n\n Random values in a given shape.\n\n Create an array of the given shape and propagate it with\n random samples from a uniform distribution\n over ``[0, 1)``.\n\n Parameters\n ----------\n d0, d1, ..., dn : int\n Shape of the output.\n\n Returns\n -------\n out : ndarray, shape ``(d0, d1, ..., dn)``\n Random values.\n\n See Also\n --------\n random\n\n Notes\n -----\n This is a convenience function. If you want an interface that\n takes a shape-tuple as the first argument, refer to\n `random`.\n\n Examples\n --------\n >>> np.random.rand(3,2)\n array([[ 0.14022471, 0.96360618], #random\n [ 0.37601032, 0.25528411], #random\n [ 0.49313049, 0.94909878]]) #random\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; - PyObject *__pyx_r; - Py_ssize_t __pyx_1 = 0; - int __pyx_2; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - if (unlikely(__pyx_kwds)) { - if (unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rand", 0))) return NULL; - } - Py_INCREF(__pyx_args); + PyObject *__pyx_r = NULL; + PyObject *__pyx_1 = 0; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_SetupRefcountContext("rand"); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rand", 0))) return NULL; + __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":916 @@ -5473,9 +6708,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyO * return self.random_sample() * else: */ - __pyx_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = (__pyx_1 == 0); - if (__pyx_2) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* __pyx_t_2 allocated */ + __pyx_t_2 = (__pyx_t_1 == 0); + /* __pyx_t_1 released */ + if (__pyx_t_2) { + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":917 * """ @@ -5484,11 +6723,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyO * else: * return self.random_sample(size=args) */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_random_sample); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_random_sample); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; goto __pyx_L5; } @@ -5501,28 +6747,38 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyO * * def randn(self, *args): */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_random_sample); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_4, __pyx_kp_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_r = __pyx_5; - __pyx_5 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_random_sample); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_1)); + if (PyDict_SetItem(__pyx_1, __pyx_kp_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; + /* __pyx_t_4 released */ + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; } __pyx_L5:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.rand"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_args); + __Pyx_DECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -5538,16 +6794,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, Py static char __pyx_doc_6mtrand_11RandomState_randn[] = "\n randn(d0, d1, ..., dn)\n\n Returns zero-mean, unit-variance Gaussian random numbers in an\n array of shape (d0, d1, ..., dn).\n\n Note: This is a convenience function. If you want an\n interface that takes a tuple as the first argument\n use numpy.random.standard_normal(shape_tuple).\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; - PyObject *__pyx_r; - Py_ssize_t __pyx_1 = 0; - int __pyx_2; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - if (unlikely(__pyx_kwds)) { - if (unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "randn", 0))) return NULL; - } - Py_INCREF(__pyx_args); + PyObject *__pyx_r = NULL; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_SetupRefcountContext("randn"); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "randn", 0))) return NULL; + __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":933 @@ -5557,9 +6812,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, Py * return self.standard_normal() * else: */ - __pyx_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = (__pyx_1 == 0); - if (__pyx_2) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* __pyx_t_2 allocated */ + __pyx_t_2 = (__pyx_t_1 == 0); + /* __pyx_t_1 released */ + if (__pyx_t_2) { + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":934 * """ @@ -5568,11 +6827,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, Py * else: * return self.standard_normal(args) */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; goto __pyx_L5; } @@ -5585,29 +6851,42 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, Py * * def random_integers(self, low, high=None, size=None): */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_args); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_args); - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_r = __pyx_5; - __pyx_5 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; } __pyx_L5:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.randn"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_args); + __Pyx_DECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -5625,33 +6904,67 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_ PyObject *__pyx_v_low = 0; PyObject *__pyx_v_high = 0; PyObject *__pyx_v_size = 0; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - static char *__pyx_argnames[] = {"low","high","size",0}; - __pyx_v_high = Py_None; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_low = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + PyObject *__pyx_r = NULL; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_low,&__pyx_kp_high,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("random_integers"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[1] = Py_None; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_low); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_high); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "random_integers") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_low = values[0]; + __pyx_v_high = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_high = Py_None; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_low = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("random_integers", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.random_integers"); return NULL; - __pyx_L4:; - Py_INCREF(__pyx_v_low); - Py_INCREF(__pyx_v_high); + __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF(__pyx_v_low); + __Pyx_INCREF(__pyx_v_high); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":947 * @@ -5660,8 +6973,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_ * high = low * low = 1 */ - __pyx_1 = (__pyx_v_high == Py_None); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_high == Py_None); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":948 * """ @@ -5670,8 +6985,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_ * low = 1 * return self.randint(low, high+1, size) */ - Py_INCREF(__pyx_v_low); - Py_DECREF(__pyx_v_high); + __Pyx_INCREF(__pyx_v_low); + __Pyx_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":949 @@ -5681,12 +6996,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_ * return self.randint(low, high+1, size) * */ - Py_INCREF(__pyx_int_1); - Py_DECREF(__pyx_v_low); + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF(__pyx_v_low); __pyx_v_low = __pyx_int_1; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":950 * high = low @@ -5695,33 +7010,51 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_ * * # Complicated, continuous distributions: */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_randint); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyNumber_Add(__pyx_v_high, __pyx_int_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_low); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_low); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_size); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_r = __pyx_3; - __pyx_3 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyNumber_Add(__pyx_v_high, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_low); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_low); + __Pyx_GIVEREF(__pyx_v_low); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_size); + __Pyx_GIVEREF(__pyx_v_size); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __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 = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.random_integers"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_low); - Py_DECREF(__pyx_v_high); + __Pyx_DECREF(__pyx_v_low); + __Pyx_DECREF(__pyx_v_high); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -5737,23 +7070,45 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_normal(PyObject *__pyx_ static char __pyx_doc_6mtrand_11RandomState_standard_normal[] = "\n standard_normal(size=None)\n\n Returns samples from a Standard Normal distribution (mean=0, stdev=1).\n\n Parameters\n ----------\n size : int, shape tuple, optional\n Returns the number of samples required to satisfy the `size` parameter.\n If not given or 'None' indicates to return one sample.\n\n Returns\n -------\n out : float, ndarray\n Samples the Standard Normal distribution with a shape satisfying the\n `size` parameter.\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - static char *__pyx_argnames[] = {"size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("standard_normal"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[1] = {0}; + values[0] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "standard_normal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_size = values[0]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("standard_normal", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.standard_normal"); return NULL; - __pyx_L4:; + __pyx_L4_argument_unpacking_done:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":972 * @@ -5762,18 +7117,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_normal(PyObject *__pyx_ * * def normal(self, loc=0.0, scale=1.0, size=None): */ - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gauss, __pyx_v_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gauss, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("mtrand.RandomState.standard_normal"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -5795,37 +7156,72 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P PyArrayObject *__pyx_v_oscale; double __pyx_v_floc; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"loc","scale","size",0}; - __pyx_v_loc = __pyx_k_5; - __pyx_v_scale = __pyx_k_6; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); - } + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("normal"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k_5; + values[1] = __pyx_k_6; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "normal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_loc = values[0]; + __pyx_v_scale = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_loc = __pyx_k_5; + __pyx_v_scale = __pyx_k_6; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("normal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.normal"); return NULL; - __pyx_L4:; - __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1059 * cdef double floc, fscale @@ -5852,8 +7248,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1062 * fscale = PyFloat_AsDouble(scale) @@ -5862,8 +7260,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1063 * if not PyErr_Occurred(): @@ -5872,17 +7272,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_33); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_33); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_33); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_33); + __Pyx_GIVEREF(__pyx_kp_33); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1064 * if fscale <= 0: @@ -5891,13 +7298,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_normal, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_normal, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1066 * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale) @@ -5915,11 +7326,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oloc)); + __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1069 * @@ -5928,11 +7342,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * if np.any(np.less_equal(oscale, 0)): * raise ValueError("scale <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1070 * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) @@ -5941,29 +7358,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale) */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oscale)); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); - __pyx_5 = 0; - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_5 allocated */ + __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 = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1071 * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -5972,17 +7414,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale) * */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_34); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_34); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_34); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_34); + __Pyx_GIVEREF(__pyx_kp_34); + /* __pyx_t_4 allocated */ + __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 = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1072 * if np.any(np.less_equal(oscale, 0)): @@ -5991,23 +7440,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P * * def beta(self, a, b, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_normal, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_normal, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.normal"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oloc); - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_oloc); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -6029,31 +7485,70 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO PyArrayObject *__pyx_v_ob; double __pyx_v_fa; double __pyx_v_fb; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"a","b","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_b = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_b,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("beta"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_b); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "beta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_a = values[0]; + __pyx_v_b = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_b = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.beta"); return NULL; - __pyx_L4:; - __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_ob = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1114 * cdef double fa, fb @@ -6080,8 +7575,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * if fa <= 0: * raise ValueError("a <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1117 * fb = PyFloat_AsDouble(b) @@ -6090,8 +7587,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * raise ValueError("a <= 0") * if fb <= 0: */ - __pyx_1 = (__pyx_v_fa <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fa <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1118 * if not PyErr_Occurred(): @@ -6100,17 +7599,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * if fb <= 0: * raise ValueError("b <= 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_35); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_35); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_35); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_35); + __Pyx_GIVEREF(__pyx_kp_35); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1119 * if fa <= 0: @@ -6119,8 +7625,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * raise ValueError("b <= 0") * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb) */ - __pyx_1 = (__pyx_v_fb <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fb <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1120 * raise ValueError("a <= 0") @@ -6129,17 +7637,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_36); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_36); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_36); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_36); + __Pyx_GIVEREF(__pyx_kp_36); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1121 * if fb <= 0: @@ -6148,13 +7663,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_beta, __pyx_v_size, __pyx_v_fa, __pyx_v_fb); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_beta, __pyx_v_size, __pyx_v_fa, __pyx_v_fb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1123 * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb) @@ -6172,11 +7691,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_oa)); + __pyx_v_oa = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1126 * @@ -6185,11 +7707,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * if np.any(np.less_equal(oa, 0)): * raise ValueError("a <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_b, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_ob)); - __pyx_v_ob = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_b, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_ob)); + __pyx_v_ob = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1127 * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) @@ -6198,29 +7723,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * raise ValueError("a <= 0") * if np.any(np.less_equal(ob, 0)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oa)); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); - __pyx_5 = 0; - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __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 = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oa)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __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 = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1128 * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED) @@ -6229,17 +7779,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * if np.any(np.less_equal(ob, 0)): * raise ValueError("b <= 0") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_37); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_37); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_37); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_37); + __Pyx_GIVEREF(__pyx_kp_37); + /* __pyx_t_4 allocated */ + __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 = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1129 * if np.any(np.less_equal(oa, 0)): @@ -6248,29 +7805,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * raise ValueError("b <= 0") * return cont2_array(self.internal_state, rk_beta, size, oa, ob) */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_ob)); - PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_ob)); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); - __pyx_5 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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 = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)__pyx_v_ob)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ob)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ob)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_2 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1130 * raise ValueError("a <= 0") @@ -6279,17 +7861,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * return cont2_array(self.internal_state, rk_beta, size, oa, ob) * */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_38); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_38); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_38); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_38); + __Pyx_GIVEREF(__pyx_kp_38); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1131 * if np.any(np.less_equal(ob, 0)): @@ -6298,23 +7887,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO * * def exponential(self, scale=1.0, size=None): */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_beta, __pyx_v_size, __pyx_v_oa, __pyx_v_ob); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_beta, __pyx_v_size, __pyx_v_oa, __pyx_v_ob); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.beta"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oa); - Py_DECREF(__pyx_v_ob); + __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_ob); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -6333,32 +7929,61 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_oscale; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"scale","size",0}; - __pyx_v_scale = __pyx_k_7; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("exponential"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[0] = __pyx_k_7; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "exponential") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_scale = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_scale = __pyx_k_7; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("exponential", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.exponential"); return NULL; - __pyx_L4:; - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1174 * cdef double fscale @@ -6376,8 +8001,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1176 * fscale = PyFloat_AsDouble(scale) @@ -6386,8 +8013,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * raise ValueError("scale <= 0") * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1177 * if not PyErr_Occurred(): @@ -6396,17 +8025,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_39); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_39); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_39); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_39); + __Pyx_GIVEREF(__pyx_kp_39); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1178 * if fscale <= 0: @@ -6415,13 +8051,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_exponential, __pyx_v_size, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_exponential, __pyx_v_size, __pyx_v_fscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1180 * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale) @@ -6439,11 +8079,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1183 * @@ -6452,30 +8095,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * raise ValueError("scale <= 0") * return cont1_array(self.internal_state, rk_exponential, size, oscale) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1184 * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -6484,17 +8155,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * return cont1_array(self.internal_state, rk_exponential, size, oscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_40); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_40); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_40); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_40); + __Pyx_GIVEREF(__pyx_kp_40); + /* __pyx_t_5 allocated */ + __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 = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1185 * if np.any(np.less_equal(oscale, 0.0)): @@ -6503,22 +8181,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se * * def standard_exponential(self, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_exponential, __pyx_v_size, __pyx_v_oscale); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_exponential, __pyx_v_size, __pyx_v_oscale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.exponential"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -6534,23 +8219,45 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_exponential(PyObject *_ static char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = "\n standard_exponential(size=None)\n\n Standard exponential distribution (scale=1).\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - static char *__pyx_argnames[] = {"size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("standard_exponential"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[1] = {0}; + values[0] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "standard_exponential") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_size = values[0]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("standard_exponential", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.standard_exponential"); return NULL; - __pyx_L4:; + __pyx_L4_argument_unpacking_done:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1194 * @@ -6559,18 +8266,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_exponential(PyObject *_ * * def standard_gamma(self, shape, size=None): */ - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_exponential, __pyx_v_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_exponential, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("mtrand.RandomState.standard_exponential"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -6589,29 +8302,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_oshape; double __pyx_v_fshape; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"shape","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_shape = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_shape,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("standard_gamma"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_shape); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "standard_gamma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_shape = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_shape = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("standard_gamma", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.standard_gamma"); return NULL; - __pyx_L4:; - __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oshape = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1206 * cdef double fshape @@ -6629,8 +8371,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * if fshape <= 0: * raise ValueError("shape <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1208 * fshape = PyFloat_AsDouble(shape) @@ -6639,8 +8383,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * raise ValueError("shape <= 0") * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape) */ - __pyx_1 = (__pyx_v_fshape <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fshape <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1209 * if not PyErr_Occurred(): @@ -6649,17 +8395,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_41); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_41); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_41); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_41); + __Pyx_GIVEREF(__pyx_kp_41); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1210 * if fshape <= 0: @@ -6668,13 +8421,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_fshape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_fshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1212 * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape) @@ -6692,11 +8449,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * if np.any(np.less_equal(oshape, 0.0)): * raise ValueError("shape <= 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oshape)); - __pyx_v_oshape = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oshape)); + __pyx_v_oshape = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1214 * PyErr_Clear() @@ -6705,30 +8465,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * raise ValueError("shape <= 0") * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oshape)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oshape)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oshape)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1215 * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) @@ -6737,17 +8525,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_42); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_42); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_42); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_42); + __Pyx_GIVEREF(__pyx_kp_42); + /* __pyx_t_5 allocated */ + __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 = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1216 * if np.any(np.less_equal(oshape, 0.0)): @@ -6756,22 +8551,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v * * def gamma(self, shape, scale=1.0, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_oshape); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_oshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.standard_gamma"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oshape); + __Pyx_DECREF((PyObject *)__pyx_v_oshape); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -6793,34 +8595,69 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py PyArrayObject *__pyx_v_oscale; double __pyx_v_fshape; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"shape","scale","size",0}; - __pyx_v_scale = __pyx_k_8; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_shape = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_shape,&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("gamma"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[1] = __pyx_k_8; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_shape); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "gamma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_shape = values[0]; + __pyx_v_scale = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_scale = __pyx_k_8; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_shape = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.gamma"); return NULL; - __pyx_L4:; - __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oshape = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1291 * cdef double fshape, fscale @@ -6847,8 +8684,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * if fshape <= 0: * raise ValueError("shape <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1294 * fscale = PyFloat_AsDouble(scale) @@ -6857,8 +8696,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * raise ValueError("shape <= 0") * if fscale <= 0: */ - __pyx_1 = (__pyx_v_fshape <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fshape <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1295 * if not PyErr_Occurred(): @@ -6867,17 +8708,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_43); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_43); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_43); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_43); + __Pyx_GIVEREF(__pyx_kp_43); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1296 * if fshape <= 0: @@ -6886,8 +8734,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1297 * raise ValueError("shape <= 0") @@ -6896,17 +8746,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_44); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_44); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_44); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_44); + __Pyx_GIVEREF(__pyx_kp_44); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1298 * if fscale <= 0: @@ -6915,13 +8772,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gamma, __pyx_v_size, __pyx_v_fshape, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gamma, __pyx_v_size, __pyx_v_fshape, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1300 * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale) @@ -6939,11 +8800,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oshape, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oshape)); - __pyx_v_oshape = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_oshape)); + __pyx_v_oshape = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1302 * PyErr_Clear() @@ -6952,11 +8816,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * if np.any(np.less_equal(oshape, 0.0)): * raise ValueError("shape <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1303 * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) @@ -6965,30 +8832,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * raise ValueError("shape <= 0") * if np.any(np.less_equal(oscale, 0.0)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __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 = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oshape)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oshape)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oshape)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1304 * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -6997,17 +8892,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_45); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_45); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_45); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_45); + __Pyx_GIVEREF(__pyx_kp_45); + /* __pyx_t_5 allocated */ + __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 = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1305 * if np.any(np.less_equal(oshape, 0.0)): @@ -7016,30 +8918,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1306 * raise ValueError("shape <= 0") @@ -7048,17 +8978,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) * */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_46); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_46); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_46); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_46); + __Pyx_GIVEREF(__pyx_kp_46); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1307 * if np.any(np.less_equal(oscale, 0.0)): @@ -7067,23 +9004,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py * * def f(self, dfnum, dfden, size=None): */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_v_oscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_v_oscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.gamma"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oshape); - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_oshape); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -7105,31 +9049,70 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje PyArrayObject *__pyx_v_odfden; double __pyx_v_fdfnum; double __pyx_v_fdfden; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"dfnum","dfden","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_dfnum = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_dfden = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_dfnum,&__pyx_kp_dfden,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("f"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfnum); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfden); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "f") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_dfnum = values[0]; + __pyx_v_dfden = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_dfden = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_dfnum = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.f"); return NULL; - __pyx_L4:; - __pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_odfnum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_odfden = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1393 * cdef double fdfnum, fdfden @@ -7156,8 +9139,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * if fdfnum <= 0: * raise ValueError("shape <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1396 * fdfden = PyFloat_AsDouble(dfden) @@ -7166,8 +9151,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * raise ValueError("shape <= 0") * if fdfden <= 0: */ - __pyx_1 = (__pyx_v_fdfnum <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fdfnum <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1397 * if not PyErr_Occurred(): @@ -7176,17 +9163,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * if fdfden <= 0: * raise ValueError("scale <= 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_47); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_47); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_47); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_47); + __Pyx_GIVEREF(__pyx_kp_47); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1398 * if fdfnum <= 0: @@ -7195,8 +9189,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden) */ - __pyx_1 = (__pyx_v_fdfden <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fdfden <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1399 * raise ValueError("shape <= 0") @@ -7205,17 +9201,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_48); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_48); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_48); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_48); + __Pyx_GIVEREF(__pyx_kp_48); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1400 * if fdfden <= 0: @@ -7224,13 +9227,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1402 * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden) @@ -7248,11 +9255,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odfnum, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_odfnum)); - __pyx_v_odfnum = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_odfnum)); + __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1405 * @@ -7261,11 +9271,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * if np.any(np.less_equal(odfnum, 0.0)): * raise ValueError("dfnum <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_odfden)); + __pyx_v_odfden = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1406 * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) @@ -7274,30 +9287,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * raise ValueError("dfnum <= 0") * if np.any(np.less_equal(odfden, 0.0)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_odfnum)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odfnum)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __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 = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_odfnum)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odfnum)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_odfnum)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1407 * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) @@ -7306,17 +9347,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_49); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_49); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_49); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_49); + __Pyx_GIVEREF(__pyx_kp_49); + /* __pyx_t_5 allocated */ + __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 = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1408 * if np.any(np.less_equal(odfnum, 0.0)): @@ -7325,30 +9373,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * raise ValueError("dfden <= 0") * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_odfden)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_odfden)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_odfden)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1409 * raise ValueError("dfnum <= 0") @@ -7357,17 +9433,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) * */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_50); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_50); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_50); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_50); + __Pyx_GIVEREF(__pyx_kp_50); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1410 * if np.any(np.less_equal(odfden, 0.0)): @@ -7376,23 +9459,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje * * def noncentral_f(self, dfnum, dfden, nonc, size=None): */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.f"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_odfnum); - Py_DECREF(__pyx_v_odfden); + __Pyx_DECREF((PyObject *)__pyx_v_odfnum); + __Pyx_DECREF((PyObject *)__pyx_v_odfden); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -7417,33 +9507,80 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s double __pyx_v_fdfnum; double __pyx_v_fdfden; double __pyx_v_fnonc; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"dfnum","dfden","nonc","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(3 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 4)) { - __pyx_v_dfnum = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_dfden = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_nonc = PyTuple_GET_ITEM(__pyx_args, 2); - if (PyTuple_GET_SIZE(__pyx_args) > 3) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_dfnum,&__pyx_kp_dfden,&__pyx_kp_nonc,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("noncentral_f"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[4] = {0,0,0,0}; + values[3] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfnum); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfden); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nonc); + if (likely(values[2])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "noncentral_f") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_dfnum = values[0]; + __pyx_v_dfden = values[1]; + __pyx_v_nonc = values[2]; + __pyx_v_size = values[3]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: + __pyx_v_nonc = PyTuple_GET_ITEM(__pyx_args, 2); + __pyx_v_dfden = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_dfnum = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.noncentral_f"); return NULL; - __pyx_L4:; - __pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_odfnum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_odfden = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_ononc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1422 * cdef double fdfnum, fdfden, fnonc @@ -7479,8 +9616,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * if fdfnum <= 1: * raise ValueError("dfnum <= 1") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1426 * fnonc = PyFloat_AsDouble(nonc) @@ -7489,8 +9628,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * raise ValueError("dfnum <= 1") * if fdfden <= 0: */ - __pyx_1 = (__pyx_v_fdfnum <= 1); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fdfnum <= 1); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1427 * if not PyErr_Occurred(): @@ -7499,17 +9640,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * if fdfden <= 0: * raise ValueError("dfden <= 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_51); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_51); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_51); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_51); + __Pyx_GIVEREF(__pyx_kp_51); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1428 * if fdfnum <= 1: @@ -7518,8 +9666,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * raise ValueError("dfden <= 0") * if fnonc < 0: */ - __pyx_1 = (__pyx_v_fdfden <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fdfden <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1429 * raise ValueError("dfnum <= 1") @@ -7528,17 +9678,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * if fnonc < 0: * raise ValueError("nonc < 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_52); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_52); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_52); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_52); + __Pyx_GIVEREF(__pyx_kp_52); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1430 * if fdfden <= 0: @@ -7547,8 +9704,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * raise ValueError("nonc < 0") * return cont3_array_sc(self.internal_state, rk_noncentral_f, size, */ - __pyx_1 = (__pyx_v_fnonc < 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fnonc < 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1431 * raise ValueError("dfden <= 0") @@ -7557,17 +9716,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * return cont3_array_sc(self.internal_state, rk_noncentral_f, size, * fdfnum, fdfden, fnonc) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_53); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_53); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_53); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_53); + __Pyx_GIVEREF(__pyx_kp_53); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1432 + * if fnonc < 0: + * raise ValueError("nonc < 0") + * return cont3_array_sc(self.internal_state, rk_noncentral_f, size, # <<<<<<<<<<<<<< + * fdfnum, fdfden, fnonc) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1433 * raise ValueError("nonc < 0") @@ -7576,13 +9751,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden, __pyx_v_fnonc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden, __pyx_v_fnonc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1435 * fdfnum, fdfden, fnonc) @@ -7600,11 +9778,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_odfnum)); - __pyx_v_odfnum = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_odfnum)); + __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1438 * @@ -7613,11 +9794,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) * */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_odfden)); + __pyx_v_odfden = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1439 * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) @@ -7626,11 +9810,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * * if np.any(np.less_equal(odfnum, 1.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_ononc)); + __pyx_v_ononc = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1441 * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) @@ -7639,30 +9826,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * raise ValueError("dfnum <= 1") * if np.any(np.less_equal(odfden, 0.0)): */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_odfnum)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odfnum)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_odfnum)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odfnum)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_odfnum)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1442 * @@ -7671,17 +9886,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_54); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_54); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_54); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_54); + __Pyx_GIVEREF(__pyx_kp_54); + /* __pyx_t_5 allocated */ + __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 = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1443 * if np.any(np.less_equal(odfnum, 1.0)): @@ -7690,30 +9912,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * raise ValueError("dfden <= 0") * if np.any(np.less(ononc, 0.0)): */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); - __pyx_4 = 0; - __pyx_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)__pyx_v_odfden)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_odfden)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_odfden)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_2 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1444 * raise ValueError("dfnum <= 1") @@ -7722,17 +9972,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * if np.any(np.less(ononc, 0.0)): * raise ValueError("nonc < 0") */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_55); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_55); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_55); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_55); + __Pyx_GIVEREF(__pyx_kp_55); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + goto __pyx_L11; } - __pyx_L10:; + __pyx_L11:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1445 * if np.any(np.less_equal(odfden, 0.0)): @@ -7741,30 +9998,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * raise ValueError("nonc < 0") * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_less); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); - __pyx_3 = 0; - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __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 = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_ononc)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ononc)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ononc)); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __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 = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1446 * raise ValueError("dfden <= 0") @@ -7773,17 +10058,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, * odfden, ononc) */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_56); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_56); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_56); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_56); + __Pyx_GIVEREF(__pyx_kp_56); + /* __pyx_t_4 allocated */ + __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 = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; + goto __pyx_L12; } - __pyx_L11:; + __pyx_L12:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1447 + * if np.any(np.less(ononc, 0.0)): + * raise ValueError("nonc < 0") + * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, # <<<<<<<<<<<<<< + * odfden, ononc) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1448 * raise ValueError("nonc < 0") @@ -7792,24 +10093,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s * * def chisquare(self, df, size=None): */ - __pyx_5 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_v_ononc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_5; - __pyx_5 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_v_ononc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.noncentral_f"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_odfnum); - Py_DECREF(__pyx_v_odfden); - Py_DECREF(__pyx_v_ononc); + __Pyx_DECREF((PyObject *)__pyx_v_odfnum); + __Pyx_DECREF((PyObject *)__pyx_v_odfden); + __Pyx_DECREF((PyObject *)__pyx_v_ononc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -7828,29 +10135,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_odf; double __pyx_v_fdf; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"df","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_df,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("chisquare"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_df); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "chisquare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_df = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_df, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("chisquare", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.chisquare"); return NULL; - __pyx_L4:; - __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1517 * cdef double fdf @@ -7868,8 +10204,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * if fdf <= 0: * raise ValueError("df <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1519 * fdf = PyFloat_AsDouble(df) @@ -7878,8 +10216,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * raise ValueError("df <= 0") * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf) */ - __pyx_1 = (__pyx_v_fdf <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fdf <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1520 * if not PyErr_Occurred(): @@ -7888,17 +10228,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_57); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_57); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_57); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_57); + __Pyx_GIVEREF(__pyx_kp_57); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1521 * if fdf <= 0: @@ -7907,13 +10254,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_fdf); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_fdf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1523 * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf) @@ -7931,11 +10282,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_odf)); + __pyx_v_odf = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1526 * @@ -7944,30 +10298,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * raise ValueError("df <= 0") * return cont1_array(self.internal_state, rk_chisquare, size, odf) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_odf)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_odf)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1527 * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) @@ -7976,17 +10358,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * return cont1_array(self.internal_state, rk_chisquare, size, odf) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_58); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_58); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_58); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_58); + __Pyx_GIVEREF(__pyx_kp_58); + /* __pyx_t_5 allocated */ + __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 = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1528 * if np.any(np.less_equal(odf, 0.0)): @@ -7995,22 +10384,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self * * def noncentral_chisquare(self, df, nonc, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_odf); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_odf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.chisquare"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_odf); + __Pyx_DECREF((PyObject *)__pyx_v_odf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -8032,31 +10428,70 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ PyArrayObject *__pyx_v_ononc; double __pyx_v_fdf; double __pyx_v_fnonc; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"df","nonc","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_nonc = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_df,&__pyx_kp_nonc,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("noncentral_chisquare"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_df); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nonc); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "noncentral_chisquare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_df = values[0]; + __pyx_v_nonc = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_nonc = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare"); return NULL; - __pyx_L4:; - __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_ononc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1551 * cdef ndarray odf, ononc @@ -8083,8 +10518,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * if fdf <= 1: * raise ValueError("df <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1554 * fnonc = PyFloat_AsDouble(nonc) @@ -8093,8 +10530,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * raise ValueError("df <= 0") * if fnonc <= 0: */ - __pyx_1 = (__pyx_v_fdf <= 1); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fdf <= 1); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1555 * if not PyErr_Occurred(): @@ -8103,17 +10542,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * if fnonc <= 0: * raise ValueError("nonc <= 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_59); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_59); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_59); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_59); + __Pyx_GIVEREF(__pyx_kp_59); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1556 * if fdf <= 1: @@ -8122,8 +10568,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * raise ValueError("nonc <= 0") * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare, */ - __pyx_1 = (__pyx_v_fnonc <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fnonc <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1557 * raise ValueError("df <= 0") @@ -8132,17 +10580,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare, * size, fdf, fnonc) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_60); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_60); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_60); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_60); + __Pyx_GIVEREF(__pyx_kp_60); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1558 + * if fnonc <= 0: + * raise ValueError("nonc <= 0") + * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare, # <<<<<<<<<<<<<< + * size, fdf, fnonc) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1559 * raise ValueError("nonc <= 0") @@ -8151,13 +10615,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_fdf, __pyx_v_fnonc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_fdf, __pyx_v_fnonc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1561 * size, fdf, fnonc) @@ -8175,11 +10642,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odf, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_odf)); + __pyx_v_odf = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1564 * @@ -8188,11 +10658,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 1") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_ononc)); + __pyx_v_ononc = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1565 * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) @@ -8201,30 +10674,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * raise ValueError("df <= 1") * if np.any(np.less_equal(ononc, 0.0)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __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 = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_odf)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_odf)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1566 * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) @@ -8233,17 +10734,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * if np.any(np.less_equal(ononc, 0.0)): * raise ValueError("nonc < 0") */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_61); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_61); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_61); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_61); + __Pyx_GIVEREF(__pyx_kp_61); + /* __pyx_t_5 allocated */ + __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 = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1567 * if np.any(np.less_equal(odf, 0.0)): @@ -8252,30 +10760,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * raise ValueError("nonc < 0") * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_ononc)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ononc)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ononc)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1568 * raise ValueError("df <= 1") @@ -8284,17 +10820,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, * odf, ononc) */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_62); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_62); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_62); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_62); + __Pyx_GIVEREF(__pyx_kp_62); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1569 + * if np.any(np.less_equal(ononc, 0.0)): + * raise ValueError("nonc < 0") + * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, # <<<<<<<<<<<<<< + * odf, ononc) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1570 * raise ValueError("nonc < 0") @@ -8303,23 +10855,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_ * * def standard_cauchy(self, size=None): */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_v_ononc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_v_ononc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_odf); - Py_DECREF(__pyx_v_ononc); + __Pyx_DECREF((PyObject *)__pyx_v_odf); + __Pyx_DECREF((PyObject *)__pyx_v_ononc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -8335,23 +10893,45 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_ static char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = "\n standard_cauchy(size=None)\n\n Standard Cauchy with mode=0.\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - static char *__pyx_argnames[] = {"size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("standard_cauchy"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[1] = {0}; + values[0] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "standard_cauchy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_size = values[0]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("standard_cauchy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.standard_cauchy"); return NULL; - __pyx_L4:; + __pyx_L4_argument_unpacking_done:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1579 * @@ -8360,18 +10940,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_ * * def standard_t(self, df, size=None): */ - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_cauchy, __pyx_v_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_cauchy, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("mtrand.RandomState.standard_cauchy"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -8390,29 +10976,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_odf; double __pyx_v_fdf; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"df","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_df,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("standard_t"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_df); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "standard_t") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_df = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_df, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("standard_t", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.standard_t"); return NULL; - __pyx_L4:; - __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1591 * cdef double fdf @@ -8430,8 +11045,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * if fdf <= 0: * raise ValueError("df <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1593 * fdf = PyFloat_AsDouble(df) @@ -8440,8 +11057,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * raise ValueError("df <= 0") * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf) */ - __pyx_1 = (__pyx_v_fdf <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fdf <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1594 * if not PyErr_Occurred(): @@ -8450,17 +11069,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_63); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_63); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_63); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_63); + __Pyx_GIVEREF(__pyx_kp_63); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1595 * if fdf <= 0: @@ -8469,13 +11095,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_fdf); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_fdf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1597 * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf) @@ -8493,11 +11123,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_odf)); + __pyx_v_odf = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1600 * @@ -8506,30 +11139,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * raise ValueError("df <= 0") * return cont1_array(self.internal_state, rk_standard_t, size, odf) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_odf)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_odf)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1601 * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) @@ -8538,17 +11199,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * return cont1_array(self.internal_state, rk_standard_t, size, odf) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_64); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_64); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_64); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_64); + __Pyx_GIVEREF(__pyx_kp_64); + /* __pyx_t_5 allocated */ + __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 = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1602 * if np.any(np.less_equal(odf, 0.0)): @@ -8557,22 +11225,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel * * def vonmises(self, mu, kappa, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_odf); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_odf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.standard_t"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_odf); + __Pyx_DECREF((PyObject *)__pyx_v_odf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -8594,31 +11269,70 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyArrayObject *__pyx_v_okappa; double __pyx_v_fmu; double __pyx_v_fkappa; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"mu","kappa","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_mu = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_kappa = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mu,&__pyx_kp_kappa,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("vonmises"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mu); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_kappa); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "vonmises") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_mu = values[0]; + __pyx_v_kappa = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_kappa = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_mu = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.vonmises"); return NULL; - __pyx_L4:; - __pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_omu = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_okappa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1684 * cdef double fmu, fkappa @@ -8645,8 +11359,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * if fkappa < 0: * raise ValueError("kappa < 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1687 * fkappa = PyFloat_AsDouble(kappa) @@ -8655,8 +11371,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * raise ValueError("kappa < 0") * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa) */ - __pyx_1 = (__pyx_v_fkappa < 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fkappa < 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1688 * if not PyErr_Occurred(): @@ -8665,17 +11383,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_65); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_65); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_65); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_65); + __Pyx_GIVEREF(__pyx_kp_65); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1689 * if fkappa < 0: @@ -8684,13 +11409,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_fmu, __pyx_v_fkappa); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_fmu, __pyx_v_fkappa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1691 * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa) @@ -8708,11 +11437,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less(okappa, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_omu)); - __pyx_v_omu = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_mu, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_omu)); + __pyx_v_omu = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1694 * @@ -8721,11 +11453,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * if np.any(np.less(okappa, 0.0)): * raise ValueError("kappa < 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_kappa, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_okappa)); - __pyx_v_okappa = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_kappa, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_okappa)); + __pyx_v_okappa = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1695 * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED) @@ -8734,30 +11469,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * raise ValueError("kappa < 0") * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_okappa)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_okappa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_okappa)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_okappa)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_okappa)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1696 * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED) @@ -8766,17 +11529,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) * */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_66); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_66); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_66); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_66); + __Pyx_GIVEREF(__pyx_kp_66); + /* __pyx_t_5 allocated */ + __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 = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1697 * if np.any(np.less(okappa, 0.0)): @@ -8785,23 +11555,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, * * def pareto(self, a, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_omu, __pyx_v_okappa); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_omu, __pyx_v_okappa); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.vonmises"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_omu); - Py_DECREF(__pyx_v_okappa); + __Pyx_DECREF((PyObject *)__pyx_v_omu); + __Pyx_DECREF((PyObject *)__pyx_v_okappa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -8820,29 +11597,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_oa; double __pyx_v_fa; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"a","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("pareto"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "pareto") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_a = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pareto", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.pareto"); return NULL; - __pyx_L4:; - __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1775 * cdef double fa @@ -8860,8 +11666,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * if fa <= 0: * raise ValueError("a <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1777 * fa = PyFloat_AsDouble(a) @@ -8870,8 +11678,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * raise ValueError("a <= 0") * return cont1_array_sc(self.internal_state, rk_pareto, size, fa) */ - __pyx_1 = (__pyx_v_fa <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fa <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1778 * if not PyErr_Occurred(): @@ -8880,17 +11690,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * return cont1_array_sc(self.internal_state, rk_pareto, size, fa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_67); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_67); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_67); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_67); + __Pyx_GIVEREF(__pyx_kp_67); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1779 * if fa <= 0: @@ -8899,13 +11716,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_pareto, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_pareto, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1781 * return cont1_array_sc(self.internal_state, rk_pareto, size, fa) @@ -8923,11 +11744,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oa)); + __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1784 * @@ -8936,30 +11760,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_pareto, size, oa) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1785 * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) @@ -8968,17 +11820,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * return cont1_array(self.internal_state, rk_pareto, size, oa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_68); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_68); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_68); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_68); + __Pyx_GIVEREF(__pyx_kp_68); + /* __pyx_t_5 allocated */ + __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1786 * if np.any(np.less_equal(oa, 0.0)): @@ -8987,22 +11846,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P * * def weibull(self, a, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_pareto, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_pareto, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.pareto"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -9021,29 +11887,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_oa; double __pyx_v_fa; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"a","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("weibull"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "weibull") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_a = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("weibull", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.weibull"); return NULL; - __pyx_L4:; - __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1874 * cdef double fa @@ -9061,8 +11956,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * if fa <= 0: * raise ValueError("a <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1876 * fa = PyFloat_AsDouble(a) @@ -9071,8 +11968,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * raise ValueError("a <= 0") * return cont1_array_sc(self.internal_state, rk_weibull, size, fa) */ - __pyx_1 = (__pyx_v_fa <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fa <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1877 * if not PyErr_Occurred(): @@ -9081,17 +11980,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * return cont1_array_sc(self.internal_state, rk_weibull, size, fa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_69); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_69); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_69); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_69); + __Pyx_GIVEREF(__pyx_kp_69); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1878 * if fa <= 0: @@ -9100,13 +12006,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_weibull, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_weibull, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1880 * return cont1_array_sc(self.internal_state, rk_weibull, size, fa) @@ -9124,11 +12034,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oa)); + __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1883 * @@ -9137,30 +12050,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_weibull, size, oa) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1884 * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) @@ -9169,17 +12110,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * return cont1_array(self.internal_state, rk_weibull, size, oa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_70); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_70); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_70); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_70); + __Pyx_GIVEREF(__pyx_kp_70); + /* __pyx_t_5 allocated */ + __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 = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1885 * if np.any(np.less_equal(oa, 0.0)): @@ -9188,22 +12136,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, * * def power(self, a, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_weibull, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_weibull, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.weibull"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -9222,29 +12177,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_oa; double __pyx_v_fa; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"a","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("power"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "power") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_a = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("power", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.power"); return NULL; - __pyx_L4:; - __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1897 * cdef double fa @@ -9262,8 +12246,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * if fa <= 0: * raise ValueError("a <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1899 * fa = PyFloat_AsDouble(a) @@ -9272,8 +12258,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * raise ValueError("a <= 0") * return cont1_array_sc(self.internal_state, rk_power, size, fa) */ - __pyx_1 = (__pyx_v_fa <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fa <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1900 * if not PyErr_Occurred(): @@ -9282,17 +12270,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * return cont1_array_sc(self.internal_state, rk_power, size, fa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_71); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_71); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_71); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_71); + __Pyx_GIVEREF(__pyx_kp_71); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1901 * if fa <= 0: @@ -9301,13 +12296,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_power, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_power, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1903 * return cont1_array_sc(self.internal_state, rk_power, size, fa) @@ -9325,11 +12324,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oa)); + __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1906 * @@ -9338,30 +12340,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_power, size, oa) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1907 * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) @@ -9370,17 +12400,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * return cont1_array(self.internal_state, rk_power, size, oa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_72); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_72); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_72); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_72); + __Pyx_GIVEREF(__pyx_kp_72); + /* __pyx_t_5 allocated */ + __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 = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1908 * if np.any(np.less_equal(oa, 0.0)): @@ -9389,22 +12426,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py * * def laplace(self, loc=0.0, scale=1.0, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_power, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_power, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.power"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -9426,37 +12470,72 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyArrayObject *__pyx_v_oscale; double __pyx_v_floc; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"loc","scale","size",0}; - __pyx_v_loc = __pyx_k_9; - __pyx_v_scale = __pyx_k_10; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); - } + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("laplace"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k_9; + values[1] = __pyx_k_10; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "laplace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_loc = values[0]; + __pyx_v_scale = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_loc = __pyx_k_9; + __pyx_v_scale = __pyx_k_10; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("laplace", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.laplace"); return NULL; - __pyx_L4:; - __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1935 * cdef double floc, fscale @@ -9483,8 +12562,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1938 * fscale = PyFloat_AsDouble(scale) @@ -9493,8 +12574,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1939 * if not PyErr_Occurred(): @@ -9503,17 +12586,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_73); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_73); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_73); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_73); + __Pyx_GIVEREF(__pyx_kp_73); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1940 * if fscale <= 0: @@ -9522,13 +12612,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_laplace, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_laplace, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1942 * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale) @@ -9546,11 +12640,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_3); - __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_oloc)); + __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1944 * PyErr_Clear() @@ -9559,11 +12656,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1945 * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) @@ -9572,30 +12672,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1946 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -9604,17 +12732,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) * */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_74); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_74); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_74); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_74); + __Pyx_GIVEREF(__pyx_kp_74); + /* __pyx_t_5 allocated */ + __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 = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1947 * if np.any(np.less_equal(oscale, 0.0)): @@ -9623,23 +12758,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, * * def gumbel(self, loc=0.0, scale=1.0, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_laplace, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_laplace, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.laplace"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oloc); - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_oloc); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -9661,37 +12803,72 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P PyArrayObject *__pyx_v_oscale; double __pyx_v_floc; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"loc","scale","size",0}; - __pyx_v_loc = __pyx_k_11; - __pyx_v_scale = __pyx_k_12; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); - } + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("gumbel"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k_11; + values[1] = __pyx_k_12; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "gumbel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_loc = values[0]; + __pyx_v_scale = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_loc = __pyx_k_11; + __pyx_v_scale = __pyx_k_12; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gumbel", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.gumbel"); return NULL; - __pyx_L4:; - __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2059 * cdef double floc, fscale @@ -9718,8 +12895,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2062 * fscale = PyFloat_AsDouble(scale) @@ -9728,8 +12907,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2063 * if not PyErr_Occurred(): @@ -9738,17 +12919,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_75); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_75); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_75); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_75); + __Pyx_GIVEREF(__pyx_kp_75); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2064 * if fscale <= 0: @@ -9757,13 +12945,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2066 * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale) @@ -9781,11 +12973,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_3); - __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_oloc)); + __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2068 * PyErr_Clear() @@ -9794,11 +12989,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2069 * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) @@ -9807,30 +13005,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2070 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -9839,17 +13065,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) * */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_76); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_76); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_76); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_76); + __Pyx_GIVEREF(__pyx_kp_76); + /* __pyx_t_5 allocated */ + __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2071 * if np.any(np.less_equal(oscale, 0.0)): @@ -9858,23 +13091,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P * * def logistic(self, loc=0.0, scale=1.0, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.gumbel"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oloc); - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_oloc); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -9896,37 +13136,72 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyArrayObject *__pyx_v_oscale; double __pyx_v_floc; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"loc","scale","size",0}; - __pyx_v_loc = __pyx_k_13; - __pyx_v_scale = __pyx_k_14; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); - } + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("logistic"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k_13; + values[1] = __pyx_k_14; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "logistic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_loc = values[0]; + __pyx_v_scale = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_loc = __pyx_k_13; + __pyx_v_scale = __pyx_k_14; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_loc = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("logistic", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.logistic"); return NULL; - __pyx_L4:; - __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2147 * cdef double floc, fscale @@ -9953,8 +13228,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2150 * fscale = PyFloat_AsDouble(scale) @@ -9963,8 +13240,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2151 * if not PyErr_Occurred(): @@ -9973,17 +13252,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_77); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_77); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_77); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_77); + __Pyx_GIVEREF(__pyx_kp_77); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2152 * if fscale <= 0: @@ -9992,13 +13278,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logistic, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logistic, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2154 * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale) @@ -10016,11 +13306,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_3); - __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_oloc)); + __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2156 * PyErr_Clear() @@ -10029,11 +13322,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2157 * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) @@ -10042,30 +13338,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2158 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -10074,17 +13398,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) * */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_78); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_78); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_78); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_78); + __Pyx_GIVEREF(__pyx_kp_78); + /* __pyx_t_5 allocated */ + __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 = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2159 * if np.any(np.less_equal(oscale, 0.0)): @@ -10093,23 +13424,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, * * def lognormal(self, mean=0.0, sigma=1.0, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logistic, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logistic, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.logistic"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oloc); - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_oloc); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -10131,37 +13469,72 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self PyArrayObject *__pyx_v_osigma; double __pyx_v_fmean; double __pyx_v_fsigma; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"mean","sigma","size",0}; - __pyx_v_mean = __pyx_k_15; - __pyx_v_sigma = __pyx_k_16; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_mean = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_sigma = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); - } + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mean,&__pyx_kp_sigma,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("lognormal"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k_15; + values[1] = __pyx_k_16; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_mean); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_sigma); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lognormal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_mean = values[0]; + __pyx_v_sigma = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_mean = __pyx_k_15; + __pyx_v_sigma = __pyx_k_16; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: __pyx_v_sigma = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_mean = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lognormal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.lognormal"); return NULL; - __pyx_L4:; - __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_omean = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_osigma = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2276 * cdef double fmean, fsigma @@ -10188,8 +13561,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * if fsigma <= 0: * raise ValueError("sigma <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2280 * @@ -10198,8 +13573,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * raise ValueError("sigma <= 0") * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma) */ - __pyx_1 = (__pyx_v_fsigma <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fsigma <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2281 * if not PyErr_Occurred(): @@ -10208,17 +13585,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_79); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_79); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_79); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_79); + __Pyx_GIVEREF(__pyx_kp_79); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2282 * if fsigma <= 0: @@ -10227,13 +13611,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_fmean, __pyx_v_fsigma); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_fmean, __pyx_v_fsigma); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2284 * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma) @@ -10251,11 +13639,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(osigma, 0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_omean)); - __pyx_v_omean = ((PyArrayObject *)__pyx_3); - __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_omean)); + __pyx_v_omean = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2287 * @@ -10264,11 +13655,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * if np.any(np.less_equal(osigma, 0.0)): * raise ValueError("sigma <= 0.0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_sigma, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_osigma)); - __pyx_v_osigma = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_sigma, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_osigma)); + __pyx_v_osigma = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2288 * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) @@ -10277,30 +13671,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * raise ValueError("sigma <= 0.0") * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_osigma)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_osigma)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_osigma)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_osigma)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_osigma)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2289 * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED) @@ -10309,17 +13731,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) * */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_80); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_80); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_80); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_80); + __Pyx_GIVEREF(__pyx_kp_80); + /* __pyx_t_5 allocated */ + __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 = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2290 * if np.any(np.less_equal(osigma, 0.0)): @@ -10328,23 +13757,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self * * def rayleigh(self, scale=1.0, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_omean, __pyx_v_osigma); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_omean, __pyx_v_osigma); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.lognormal"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_omean); - Py_DECREF(__pyx_v_osigma); + __Pyx_DECREF((PyObject *)__pyx_v_omean); + __Pyx_DECREF((PyObject *)__pyx_v_osigma); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -10363,32 +13799,61 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_oscale; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"scale","size",0}; - __pyx_v_scale = __pyx_k_17; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("rayleigh"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[0] = __pyx_k_17; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "rayleigh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_scale = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_scale = __pyx_k_17; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rayleigh", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.rayleigh"); return NULL; - __pyx_L4:; - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2302 * cdef double fscale @@ -10406,8 +13871,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2305 * @@ -10416,8 +13883,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * raise ValueError("scale <= 0") * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2306 * if not PyErr_Occurred(): @@ -10426,17 +13895,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_81); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_81); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_81); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_81); + __Pyx_GIVEREF(__pyx_kp_81); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2307 * if fscale <= 0: @@ -10445,13 +13921,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_fscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2309 * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale) @@ -10469,11 +13949,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0.0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2312 * @@ -10482,30 +13965,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * raise ValueError("scale <= 0.0") * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2313 * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -10514,17 +14025,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_82); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_82); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_82); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_82); + __Pyx_GIVEREF(__pyx_kp_82); + /* __pyx_t_5 allocated */ + __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 = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2314 * if np.any(np.less_equal(oscale, 0.0)): @@ -10533,22 +14051,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, * * def wald(self, mean, scale, size=None): */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_oscale); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_oscale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.rayleigh"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -10570,31 +14095,70 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO PyArrayObject *__pyx_v_oscale; double __pyx_v_fmean; double __pyx_v_fscale; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"mean","scale","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_mean = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mean,&__pyx_kp_scale,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("wald"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mean); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "wald") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_mean = values[0]; + __pyx_v_scale = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_mean = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.wald"); return NULL; - __pyx_L4:; - __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_omean = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2326 * cdef double fmean, fscale @@ -10621,8 +14185,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * if fmean <= 0: * raise ValueError("mean <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2329 * fscale = PyFloat_AsDouble(scale) @@ -10631,8 +14197,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * raise ValueError("mean <= 0") * if fscale <= 0: */ - __pyx_1 = (__pyx_v_fmean <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fmean <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2330 * if not PyErr_Occurred(): @@ -10641,17 +14209,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * if fscale <= 0: * raise ValueError("scale <= 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_83); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_83); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_83); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_83); + __Pyx_GIVEREF(__pyx_kp_83); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2331 * if fmean <= 0: @@ -10660,8 +14235,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale) */ - __pyx_1 = (__pyx_v_fscale <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fscale <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2332 * raise ValueError("mean <= 0") @@ -10670,17 +14247,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_84); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_84); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_84); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_84); + __Pyx_GIVEREF(__pyx_kp_84); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2333 * if fscale <= 0: @@ -10689,13 +14273,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_wald, __pyx_v_size, __pyx_v_fmean, __pyx_v_fscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_wald, __pyx_v_size, __pyx_v_fmean, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2335 * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale) @@ -10713,11 +14301,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(omean,0.0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_omean)); - __pyx_v_omean = ((PyArrayObject *)__pyx_3); - __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_omean)); + __pyx_v_omean = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2337 * PyErr_Clear() @@ -10726,11 +14317,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * if np.any(np.less_equal(omean,0.0)): * raise ValueError("mean <= 0.0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); + __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2338 * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) @@ -10739,30 +14333,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * raise ValueError("mean <= 0.0") * elif np.any(np.less_equal(oscale,0.0)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_omean)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_omean)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __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 = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_omean)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_omean)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_omean)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2339 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) @@ -10771,15 +14393,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * elif np.any(np.less_equal(oscale,0.0)): * raise ValueError("scale <= 0.0") */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_85); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_85); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_85); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_85); + __Pyx_GIVEREF(__pyx_kp_85); + /* __pyx_t_5 allocated */ + __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 = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2340 @@ -10789,30 +14418,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * raise ValueError("scale <= 0.0") * return cont2_array(self.internal_state, rk_wald, size, omean, oscale) */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oscale)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2341 * raise ValueError("mean <= 0.0") @@ -10821,17 +14478,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * return cont2_array(self.internal_state, rk_wald, size, omean, oscale) * */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_86); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_86); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_86); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_86); + __Pyx_GIVEREF(__pyx_kp_86); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2342 * elif np.any(np.less_equal(oscale,0.0)): @@ -10840,23 +14504,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO * * */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_wald, __pyx_v_size, __pyx_v_omean, __pyx_v_oscale); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_wald, __pyx_v_size, __pyx_v_omean, __pyx_v_oscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.wald"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_omean); - Py_DECREF(__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_omean); + __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -10881,33 +14552,80 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel double __pyx_v_fleft; double __pyx_v_fmode; double __pyx_v_fright; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"left","mode","right","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(3 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 4)) { - __pyx_v_left = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_right = PyTuple_GET_ITEM(__pyx_args, 2); - if (PyTuple_GET_SIZE(__pyx_args) > 3) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_left,&__pyx_kp_mode,&__pyx_kp_right,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("triangular"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[4] = {0,0,0,0}; + values[3] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_left); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_right); + if (likely(values[2])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "triangular") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_left = values[0]; + __pyx_v_mode = values[1]; + __pyx_v_right = values[2]; + __pyx_v_size = values[3]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: + __pyx_v_right = PyTuple_GET_ITEM(__pyx_args, 2); + __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_left = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.triangular"); return NULL; - __pyx_L4:; - __pyx_v_oleft = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_omode = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_oright = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oleft = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_omode = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_oright = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2357 * cdef double fleft, fmode, fright @@ -10943,8 +14661,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * if fleft > fmode: * raise ValueError("left > mode") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2361 * fmode = PyFloat_AsDouble(mode) @@ -10953,8 +14673,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * raise ValueError("left > mode") * if fmode > fright: */ - __pyx_1 = (__pyx_v_fleft > __pyx_v_fmode); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fleft > __pyx_v_fmode); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2362 * if not PyErr_Occurred(): @@ -10963,17 +14685,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * if fmode > fright: * raise ValueError("mode > right") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_87); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_87); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_87); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_87); + __Pyx_GIVEREF(__pyx_kp_87); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2363 * if fleft > fmode: @@ -10982,8 +14711,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * raise ValueError("mode > right") * if fleft == fright: */ - __pyx_1 = (__pyx_v_fmode > __pyx_v_fright); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fmode > __pyx_v_fright); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2364 * raise ValueError("left > mode") @@ -10992,17 +14723,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * if fleft == fright: * raise ValueError("left == right") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_88); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_88); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_88); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_88); + __Pyx_GIVEREF(__pyx_kp_88); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2365 * if fmode > fright: @@ -11011,8 +14749,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * raise ValueError("left == right") * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft, */ - __pyx_1 = (__pyx_v_fleft == __pyx_v_fright); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fleft == __pyx_v_fright); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2366 * raise ValueError("mode > right") @@ -11021,17 +14761,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft, * fmode, fright) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_89); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_89); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_89); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_89); + __Pyx_GIVEREF(__pyx_kp_89); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2367 + * if fleft == fright: + * raise ValueError("left == right") + * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft, # <<<<<<<<<<<<<< + * fmode, fright) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2368 * raise ValueError("left == right") @@ -11040,13 +14796,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_triangular, __pyx_v_size, __pyx_v_fleft, __pyx_v_fmode, __pyx_v_fright); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_triangular, __pyx_v_size, __pyx_v_fleft, __pyx_v_fmode, __pyx_v_fright); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2370 * fmode, fright) @@ -11064,11 +14823,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ALIGNED) * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ALIGNED) */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_left, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oleft)); - __pyx_v_oleft = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_left, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oleft)); + __pyx_v_oleft = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2372 * PyErr_Clear() @@ -11077,11 +14839,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ALIGNED) * */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_mode, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_omode)); - __pyx_v_omode = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_mode, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_omode)); + __pyx_v_omode = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2373 * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED) @@ -11090,11 +14855,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * * if np.any(np.greater(oleft, omode)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_right, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oright)); - __pyx_v_oright = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_right, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oright)); + __pyx_v_oright = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2375 * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ALIGNED) @@ -11103,29 +14871,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * raise ValueError("left > mode") * if np.any(np.greater(omode, oright)): */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_greater); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oleft)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft)); - Py_INCREF(((PyObject *)__pyx_v_omode)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_omode)); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); - __pyx_5 = 0; - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_oleft)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oleft)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oleft)); + __Pyx_INCREF(((PyObject *)__pyx_v_omode)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_omode)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_omode)); + /* __pyx_t_5 allocated */ + __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 = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2376 * @@ -11134,17 +14927,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * if np.any(np.greater(omode, oright)): * raise ValueError("mode > right") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_90); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_90); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_90); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_90); + __Pyx_GIVEREF(__pyx_kp_90); + /* __pyx_t_4 allocated */ + __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 = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2377 * if np.any(np.greater(oleft, omode)): @@ -11153,29 +14953,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * raise ValueError("mode > right") * if np.any(np.equal(oleft, oright)): */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_omode)); - PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_omode)); - Py_INCREF(((PyObject *)__pyx_v_oright)); - PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)__pyx_v_oright)); - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); - __pyx_5 = 0; - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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 = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_omode)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_omode)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_omode)); + __Pyx_INCREF(((PyObject *)__pyx_v_oright)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_oright)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oright)); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2378 * raise ValueError("left > mode") @@ -11184,17 +15009,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * if np.any(np.equal(oleft, oright)): * raise ValueError("left == right") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_91); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_91); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_91); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_91); + __Pyx_GIVEREF(__pyx_kp_91); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + goto __pyx_L11; } - __pyx_L10:; + __pyx_L11:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2379 * if np.any(np.greater(omode, oright)): @@ -11203,29 +15035,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * raise ValueError("left == right") * return cont3_array(self.internal_state, rk_triangular, size, oleft, */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oleft)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oleft)); - Py_INCREF(((PyObject *)__pyx_v_oright)); - PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_oright)); - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); - __pyx_5 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_oleft)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oleft)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oleft)); + __Pyx_INCREF(((PyObject *)__pyx_v_oright)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_oright)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oright)); + /* __pyx_t_5 allocated */ + __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 = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2380 * raise ValueError("mode > right") @@ -11234,17 +15091,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * return cont3_array(self.internal_state, rk_triangular, size, oleft, * omode, oright) */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_92); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_92); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_92); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_92); + __Pyx_GIVEREF(__pyx_kp_92); + /* __pyx_t_4 allocated */ + __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 = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; + goto __pyx_L12; } - __pyx_L11:; + __pyx_L12:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2381 + * if np.any(np.equal(oleft, oright)): + * raise ValueError("left == right") + * return cont3_array(self.internal_state, rk_triangular, size, oleft, # <<<<<<<<<<<<<< + * omode, oright) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2382 * raise ValueError("left == right") @@ -11253,24 +15126,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel * * # Complicated, discrete distributions: */ - __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_triangular, __pyx_v_size, __pyx_v_oleft, __pyx_v_omode, __pyx_v_oright); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_triangular, __pyx_v_size, __pyx_v_oleft, __pyx_v_omode, __pyx_v_oright); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.triangular"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oleft); - Py_DECREF(__pyx_v_omode); - Py_DECREF(__pyx_v_oright); + __Pyx_DECREF((PyObject *)__pyx_v_oleft); + __Pyx_DECREF((PyObject *)__pyx_v_omode); + __Pyx_DECREF((PyObject *)__pyx_v_oright); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -11292,31 +15171,70 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyArrayObject *__pyx_v_op; long __pyx_v_ln; double __pyx_v_fp; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"n","p","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_n = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_n,&__pyx_kp_p,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("binomial"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_n); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "binomial") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_n = values[0]; + __pyx_v_p = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_n = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.binomial"); return NULL; - __pyx_L4:; - __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_on = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2470 * cdef double fp @@ -11343,8 +15261,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * if ln <= 0: * raise ValueError("n <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2473 * ln = PyInt_AsLong(n) @@ -11353,8 +15273,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * raise ValueError("n <= 0") * if fp < 0: */ - __pyx_1 = (__pyx_v_ln <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_ln <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2474 * if not PyErr_Occurred(): @@ -11363,17 +15285,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * if fp < 0: * raise ValueError("p < 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_93); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_93); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_93); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_93); + __Pyx_GIVEREF(__pyx_kp_93); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2475 * if ln <= 0: @@ -11382,8 +15311,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * raise ValueError("p < 0") * elif fp > 1: */ - __pyx_1 = (__pyx_v_fp < 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp < 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2476 * raise ValueError("n <= 0") @@ -11392,15 +15323,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * elif fp > 1: * raise ValueError("p > 1") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_94); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_94); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_94); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_94); + __Pyx_GIVEREF(__pyx_kp_94); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2477 @@ -11410,8 +15348,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * raise ValueError("p > 1") * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp) */ - __pyx_1 = (__pyx_v_fp > 1); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp > 1); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2478 * raise ValueError("p < 0") @@ -11420,17 +15360,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_95); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_95); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_95); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_95); + __Pyx_GIVEREF(__pyx_kp_95); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2479 * elif fp > 1: @@ -11439,13 +15386,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_binomial, __pyx_v_size, __pyx_v_ln, __pyx_v_fp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_binomial, __pyx_v_size, __pyx_v_ln, __pyx_v_fp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2481 * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp) @@ -11463,11 +15414,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(n, 0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_on)); - __pyx_v_on = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_n, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_on)); + __pyx_v_on = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2484 * @@ -11476,11 +15430,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * if np.any(np.less_equal(n, 0)): * raise ValueError("n <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_op)); + __pyx_v_op = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2485 * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED) @@ -11489,29 +15446,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_n); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); - __pyx_5 = 0; - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_5 allocated */ + __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 = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2486 * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) @@ -11520,17 +15502,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * if np.any(np.less(p, 0)): * raise ValueError("p < 0") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_96); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_96); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_96); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_96); + __Pyx_GIVEREF(__pyx_kp_96); + /* __pyx_t_4 allocated */ + __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 = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2487 * if np.any(np.less_equal(n, 0)): @@ -11539,29 +15528,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_less); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); - __pyx_5 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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 = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p); + __Pyx_GIVEREF(__pyx_v_p); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2488 * raise ValueError("n <= 0") @@ -11570,17 +15584,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_97); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_97); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_97); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_97); + __Pyx_GIVEREF(__pyx_kp_97); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2489 * if np.any(np.less(p, 0)): @@ -11589,29 +15610,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * raise ValueError("p > 1") * return discnp_array(self.internal_state, rk_binomial, size, on, op) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_p); - Py_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_int_1); - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); - __pyx_5 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p); + __Pyx_GIVEREF(__pyx_v_p); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + /* __pyx_t_5 allocated */ + __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 = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2490 * raise ValueError("p < 0") @@ -11620,17 +15666,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * return discnp_array(self.internal_state, rk_binomial, size, on, op) * */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_98); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_98); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_98); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_98); + __Pyx_GIVEREF(__pyx_kp_98); + /* __pyx_t_4 allocated */ + __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 = 2490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + goto __pyx_L11; } - __pyx_L10:; + __pyx_L11:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2491 * if np.any(np.greater(p, 1)): @@ -11639,23 +15692,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, * * def negative_binomial(self, n, p, size=None): */ - __pyx_3 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.binomial"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_on); - Py_DECREF(__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_on); + __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -11677,31 +15737,70 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py PyArrayObject *__pyx_v_op; double __pyx_v_fn; double __pyx_v_fp; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"n","p","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_n = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_n,&__pyx_kp_p,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("negative_binomial"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_n); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "negative_binomial") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_n = values[0]; + __pyx_v_p = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_n = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.negative_binomial"); return NULL; - __pyx_L4:; - __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_on = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2505 * cdef double fp @@ -11728,8 +15827,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * if fn <= 0: * raise ValueError("n <= 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2508 * fn = PyFloat_AsDouble(n) @@ -11738,8 +15839,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * raise ValueError("n <= 0") * if fp < 0: */ - __pyx_1 = (__pyx_v_fn <= 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fn <= 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2509 * if not PyErr_Occurred(): @@ -11748,17 +15851,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * if fp < 0: * raise ValueError("p < 0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_99); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_99); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_99); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_99); + __Pyx_GIVEREF(__pyx_kp_99); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2510 * if fn <= 0: @@ -11767,8 +15877,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * raise ValueError("p < 0") * elif fp > 1: */ - __pyx_1 = (__pyx_v_fp < 0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp < 0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2511 * raise ValueError("n <= 0") @@ -11777,15 +15889,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * elif fp > 1: * raise ValueError("p > 1") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_100); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_100); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_100); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_100); + __Pyx_GIVEREF(__pyx_kp_100); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2512 @@ -11795,8 +15914,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * raise ValueError("p > 1") * return discdd_array_sc(self.internal_state, rk_negative_binomial, */ - __pyx_1 = (__pyx_v_fp > 1); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp > 1); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2513 * raise ValueError("p < 0") @@ -11805,17 +15926,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * return discdd_array_sc(self.internal_state, rk_negative_binomial, * size, fn, fp) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_101); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_101); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_101); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_101); + __Pyx_GIVEREF(__pyx_kp_101); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2514 + * elif fp > 1: + * raise ValueError("p > 1") + * return discdd_array_sc(self.internal_state, rk_negative_binomial, # <<<<<<<<<<<<<< + * size, fn, fp) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2515 * raise ValueError("p > 1") @@ -11824,13 +15961,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_discdd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_fn, __pyx_v_fp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_discdd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_fn, __pyx_v_fp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2517 * size, fn, fp) @@ -11848,11 +15988,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(n, 0)): */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_on)); - __pyx_v_on = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_n, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_on)); + __pyx_v_on = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2520 * @@ -11861,11 +16004,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * if np.any(np.less_equal(n, 0)): * raise ValueError("n <= 0") */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_op)); + __pyx_v_op = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2521 * on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ALIGNED) @@ -11874,29 +16020,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_n); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); - __pyx_5 = 0; - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_5 allocated */ + __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 = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2522 * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) @@ -11905,17 +16076,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * if np.any(np.less(p, 0)): * raise ValueError("p < 0") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_102); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_102); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_102); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_102); + __Pyx_GIVEREF(__pyx_kp_102); + /* __pyx_t_4 allocated */ + __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 = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2523 * if np.any(np.less_equal(n, 0)): @@ -11924,29 +16102,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_less); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); - __pyx_5 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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 = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p); + __Pyx_GIVEREF(__pyx_v_p); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2524 * raise ValueError("n <= 0") @@ -11955,17 +16158,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_103); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_103); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_103); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_103); + __Pyx_GIVEREF(__pyx_kp_103); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2525 * if np.any(np.less(p, 0)): @@ -11974,29 +16184,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * raise ValueError("p > 1") * return discdd_array(self.internal_state, rk_negative_binomial, size, */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_p); - Py_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_int_1); - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); - __pyx_5 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p); + __Pyx_GIVEREF(__pyx_v_p); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + /* __pyx_t_5 allocated */ + __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 = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2526 * raise ValueError("p < 0") @@ -12005,17 +16240,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * return discdd_array(self.internal_state, rk_negative_binomial, size, * on, op) */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_104); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_104); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_104); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_104); + __Pyx_GIVEREF(__pyx_kp_104); + /* __pyx_t_4 allocated */ + __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 = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + goto __pyx_L11; } - __pyx_L10:; + __pyx_L11:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2527 + * if np.any(np.greater(p, 1)): + * raise ValueError("p > 1") + * return discdd_array(self.internal_state, rk_negative_binomial, size, # <<<<<<<<<<<<<< + * on, op) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2528 * raise ValueError("p > 1") @@ -12024,23 +16275,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py * * def poisson(self, lam=1.0, size=None): */ - __pyx_3 = __pyx_f_6mtrand_discdd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_f_6mtrand_discdd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.negative_binomial"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_on); - Py_DECREF(__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_on); + __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -12059,32 +16316,61 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_olam; double __pyx_v_flam; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"lam","size",0}; - __pyx_v_lam = __pyx_k_18; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - if (PyTuple_GET_SIZE(__pyx_args) > 0) { - __pyx_v_lam = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_lam,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("poisson"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[0] = __pyx_k_18; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_lam); + if (unlikely(value)) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } } } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "poisson") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_lam = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_lam = __pyx_k_18; + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_lam = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("poisson", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.poisson"); return NULL; - __pyx_L4:; - __pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_olam = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2539 * cdef ndarray olam @@ -12102,8 +16388,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * if lam < 0: * raise ValueError("lam < 0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2541 * flam = PyFloat_AsDouble(lam) @@ -12112,10 +16400,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * raise ValueError("lam < 0") * return discd_array_sc(self.internal_state, rk_poisson, size, flam) */ - __pyx_2 = PyObject_RichCompare(__pyx_v_lam, __pyx_int_0, Py_LT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_lam, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2542 * if not PyErr_Occurred(): @@ -12124,17 +16417,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * return discd_array_sc(self.internal_state, rk_poisson, size, flam) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_105); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_105); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_105); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_105); + __Pyx_GIVEREF(__pyx_kp_105); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2543 * if lam < 0: @@ -12143,13 +16443,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_poisson, __pyx_v_size, __pyx_v_flam); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_poisson, __pyx_v_size, __pyx_v_flam); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2545 * return discd_array_sc(self.internal_state, rk_poisson, size, flam) @@ -12167,11 +16471,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * if np.any(np.less(olam, 0)): * raise ValueError("lam < 0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_olam)); - __pyx_v_olam = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_lam, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_olam)); + __pyx_v_olam = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2548 * @@ -12180,29 +16487,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * raise ValueError("lam < 0") * return discd_array(self.internal_state, rk_poisson, size, olam) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_olam)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_olam)); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_int_0); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); - __pyx_5 = 0; - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_olam)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_olam)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_olam)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + /* __pyx_t_5 allocated */ + __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 = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2549 * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED) @@ -12211,17 +16543,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * return discd_array(self.internal_state, rk_poisson, size, olam) * */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_106); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_106); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_106); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_106); + __Pyx_GIVEREF(__pyx_kp_106); + /* __pyx_t_4 allocated */ + __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 = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2550 * if np.any(np.less(olam, 0)): @@ -12230,22 +16569,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, * * def zipf(self, a, size=None): */ - __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_poisson, __pyx_v_size, __pyx_v_olam); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_4 allocated */ + __pyx_t_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_poisson, __pyx_v_size, __pyx_v_olam); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.poisson"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_olam); + __Pyx_DECREF((PyObject *)__pyx_v_olam); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -12264,29 +16610,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_oa; double __pyx_v_fa; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"a","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("zipf"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "zipf") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_a = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("zipf", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.zipf"); return NULL; - __pyx_L4:; - __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2631 * cdef double fa @@ -12304,8 +16679,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * if fa <= 1.0: * raise ValueError("a <= 1.0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2633 * fa = PyFloat_AsDouble(a) @@ -12314,8 +16691,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * raise ValueError("a <= 1.0") * return discd_array_sc(self.internal_state, rk_zipf, size, fa) */ - __pyx_1 = (__pyx_v_fa <= 1.0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fa <= 1.0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2634 * if not PyErr_Occurred(): @@ -12324,17 +16703,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * return discd_array_sc(self.internal_state, rk_zipf, size, fa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_107); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_107); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_107); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_107); + __Pyx_GIVEREF(__pyx_kp_107); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2635 * if fa <= 1.0: @@ -12343,13 +16729,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_zipf, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_zipf, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2637 * return discd_array_sc(self.internal_state, rk_zipf, size, fa) @@ -12367,11 +16757,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * if np.any(np.less_equal(oa, 1.0)): * raise ValueError("a <= 1.0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_oa)); + __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2640 * @@ -12380,30 +16773,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * raise ValueError("a <= 1.0") * return discd_array(self.internal_state, rk_zipf, size, oa) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2641 * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) @@ -12412,17 +16833,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * return discd_array(self.internal_state, rk_zipf, size, oa) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_108); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_108); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_108); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_108); + __Pyx_GIVEREF(__pyx_kp_108); + /* __pyx_t_5 allocated */ + __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 = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2642 * if np.any(np.less_equal(oa, 1.0)): @@ -12431,22 +16859,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO * * def geometric(self, p, size=None): */ - __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_zipf, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_5 allocated */ + __pyx_t_5 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_zipf, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.zipf"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -12465,29 +16900,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_op; double __pyx_v_fp; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"p","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_p,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("geometric"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "geometric") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_p = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_p, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("geometric", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.geometric"); return NULL; - __pyx_L4:; - __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2692 * cdef double fp @@ -12505,8 +16969,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * if fp < 0.0: * raise ValueError("p < 0.0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2694 * fp = PyFloat_AsDouble(p) @@ -12515,8 +16981,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * raise ValueError("p < 0.0") * if fp > 1.0: */ - __pyx_1 = (__pyx_v_fp < 0.0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp < 0.0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2695 * if not PyErr_Occurred(): @@ -12525,17 +16993,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * if fp > 1.0: * raise ValueError("p > 1.0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_109); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_109); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_109); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_109); + __Pyx_GIVEREF(__pyx_kp_109); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2696 * if fp < 0.0: @@ -12544,8 +17019,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * raise ValueError("p > 1.0") * return discd_array_sc(self.internal_state, rk_geometric, size, fp) */ - __pyx_1 = (__pyx_v_fp > 1.0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp > 1.0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2697 * raise ValueError("p < 0.0") @@ -12554,17 +17031,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * return discd_array_sc(self.internal_state, rk_geometric, size, fp) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_110); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_110); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_110); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_110); + __Pyx_GIVEREF(__pyx_kp_110); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2698 * if fp > 1.0: @@ -12573,13 +17057,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_geometric, __pyx_v_size, __pyx_v_fp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_geometric, __pyx_v_size, __pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2700 * return discd_array_sc(self.internal_state, rk_geometric, size, fp) @@ -12597,11 +17085,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * if np.any(np.less(op, 0.0)): * raise ValueError("p < 0.0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_op)); + __pyx_v_op = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2704 * @@ -12610,30 +17101,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * raise ValueError("p < 0.0") * if np.any(np.greater(op, 1.0)): */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __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 = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_op)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2705 * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) @@ -12642,17 +17161,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * if np.any(np.greater(op, 1.0)): * raise ValueError("p > 1.0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_111); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_111); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_111); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_111); + __Pyx_GIVEREF(__pyx_kp_111); + /* __pyx_t_5 allocated */ + __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 = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2706 * if np.any(np.less(op, 0.0)): @@ -12661,30 +17187,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * raise ValueError("p > 1.0") * return discd_array(self.internal_state, rk_geometric, size, op) */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); - __pyx_4 = 0; - __pyx_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_op)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2707 * raise ValueError("p < 0.0") @@ -12693,17 +17247,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * return discd_array(self.internal_state, rk_geometric, size, op) * */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_112); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_112); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_112); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_112); + __Pyx_GIVEREF(__pyx_kp_112); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2708 * if np.any(np.greater(op, 1.0)): @@ -12712,22 +17273,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self * * def hypergeometric(self, ngood, nbad, nsample, size=None): */ - __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_geometric, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_geometric, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.geometric"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -12752,34 +17320,81 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v long __pyx_v_lngood; long __pyx_v_lnbad; long __pyx_v_lnsample; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; - static char *__pyx_argnames[] = {"ngood","nbad","nsample","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(3 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 4)) { - __pyx_v_ngood = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_nbad = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_nsample = PyTuple_GET_ITEM(__pyx_args, 2); - if (PyTuple_GET_SIZE(__pyx_args) > 3) { + 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; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_ngood,&__pyx_kp_nbad,&__pyx_kp_nsample,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("hypergeometric"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[4] = {0,0,0,0}; + values[3] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_ngood); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nbad); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nsample); + if (likely(values[2])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "hypergeometric") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_ngood = values[0]; + __pyx_v_nbad = values[1]; + __pyx_v_nsample = values[2]; + __pyx_v_size = values[3]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: + __pyx_v_nsample = PyTuple_GET_ITEM(__pyx_args, 2); + __pyx_v_nbad = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_ngood = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.hypergeometric"); return NULL; - __pyx_L4:; - __pyx_v_ongood = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_onbad = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_onsample = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_ongood = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_onbad = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_onsample = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2797 * cdef long lngood, lnbad, lnsample @@ -12815,8 +17430,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if ngood < 1: * raise ValueError("ngood < 1") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2801 * lnsample = PyInt_AsLong(nsample) @@ -12825,10 +17442,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("ngood < 1") * if nbad < 1: */ - __pyx_2 = PyObject_RichCompare(__pyx_v_ngood, __pyx_int_1, Py_LT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_ngood, __pyx_int_1, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2802 * if not PyErr_Occurred(): @@ -12837,17 +17459,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if nbad < 1: * raise ValueError("nbad < 1") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_113); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_113); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_113); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_113); + __Pyx_GIVEREF(__pyx_kp_113); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2803 * if ngood < 1: @@ -12856,10 +17485,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("nbad < 1") * if nsample < 1: */ - __pyx_2 = PyObject_RichCompare(__pyx_v_nbad, __pyx_int_1, Py_LT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_nbad, __pyx_int_1, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2804 * raise ValueError("ngood < 1") @@ -12868,17 +17502,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if nsample < 1: * raise ValueError("nsample < 1") */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_114); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_114); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_114); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_114); + __Pyx_GIVEREF(__pyx_kp_114); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2805 * if nbad < 1: @@ -12887,10 +17528,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("nsample < 1") * if ngood + nbad < nsample: */ - __pyx_3 = PyObject_RichCompare(__pyx_v_nsample, __pyx_int_1, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_nsample, __pyx_int_1, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2806 * raise ValueError("nbad < 1") @@ -12899,17 +17545,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if ngood + nbad < nsample: * raise ValueError("ngood + nbad < nsample") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_115); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_115); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_115); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_115); + __Pyx_GIVEREF(__pyx_kp_115); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2807 * if nsample < 1: @@ -12918,12 +17571,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("ngood + nbad < nsample") * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size, */ - __pyx_2 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_RichCompare(__pyx_2, __pyx_v_nsample, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_nsample, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2808 * raise ValueError("nsample < 1") @@ -12932,17 +17593,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size, * lngood, lnbad, lnsample) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_116); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_116); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_116); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_116); + __Pyx_GIVEREF(__pyx_kp_116); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2809 + * if ngood + nbad < nsample: + * raise ValueError("ngood + nbad < nsample") + * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size, # <<<<<<<<<<<<<< + * lngood, lnbad, lnsample) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2810 * raise ValueError("ngood + nbad < nsample") @@ -12951,13 +17628,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * * */ - __pyx_2 = __pyx_f_6mtrand_discnmN_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_lngood, __pyx_v_lnbad, __pyx_v_lnsample); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_discnmN_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_lngood, __pyx_v_lnbad, __pyx_v_lnsample); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2813 * @@ -12975,11 +17655,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED) * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED) */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_ongood)); - __pyx_v_ongood = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_ngood, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_ongood)); + __pyx_v_ongood = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2816 * @@ -12988,11 +17671,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED) * if np.any(np.less(ongood, 1)): */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nbad, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_onbad)); - __pyx_v_onbad = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_nbad, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_onbad)); + __pyx_v_onbad = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2817 * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED) @@ -13001,11 +17687,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if np.any(np.less(ongood, 1)): * raise ValueError("ngood < 1") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_nsample, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_onsample)); - __pyx_v_onsample = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_nsample, NPY_LONG, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_DECREF(((PyObject *)__pyx_v_onsample)); + __pyx_v_onsample = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2818 * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED) @@ -13014,29 +17703,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("ngood < 1") * if np.any(np.less(onbad, 1)): */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_ongood)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood)); - Py_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_int_1); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); - __pyx_5 = 0; - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_ongood)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ongood)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ongood)); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + /* __pyx_t_5 allocated */ + __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 = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2819 * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED) @@ -13045,17 +17759,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if np.any(np.less(onbad, 1)): * raise ValueError("nbad < 1") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_117); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_117); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_117); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_117); + __Pyx_GIVEREF(__pyx_kp_117); + /* __pyx_t_4 allocated */ + __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 = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + goto __pyx_L11; } - __pyx_L10:; + __pyx_L11:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2820 * if np.any(np.less(ongood, 1)): @@ -13064,29 +17785,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("nbad < 1") * if np.any(np.less(onsample, 1)): */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_less); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_onbad)); - PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_onbad)); - Py_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_int_1); - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); - __pyx_5 = 0; - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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 = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_onbad)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_onbad)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_onbad)); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2821 * raise ValueError("ngood < 1") @@ -13095,17 +17841,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if np.any(np.less(onsample, 1)): * raise ValueError("nsample < 1") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_118); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_118); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_118); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_118); + __Pyx_GIVEREF(__pyx_kp_118); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; + goto __pyx_L12; } - __pyx_L11:; + __pyx_L12:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2822 * if np.any(np.less(onbad, 1)): @@ -13114,29 +17867,54 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("nsample < 1") * if np.any(np.less(np.add(ongood, onbad),onsample)): */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_less); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_onsample)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_onsample)); - Py_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_1); - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); - __pyx_5 = 0; - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __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 = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(((PyObject *)__pyx_v_onsample)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_onsample)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_onsample)); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + /* __pyx_t_5 allocated */ + __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 = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_4 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2823 * raise ValueError("nbad < 1") @@ -13145,17 +17923,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * if np.any(np.less(np.add(ongood, onbad),onsample)): * raise ValueError("ngood + nbad < nsample") */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_119); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_119); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_kp_119); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_119); + __Pyx_GIVEREF(__pyx_kp_119); + /* __pyx_t_4 allocated */ + __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 = 2823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L12; + goto __pyx_L13; } - __pyx_L12:; + __pyx_L13:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2824 * if np.any(np.less(onsample, 1)): @@ -13164,40 +17949,77 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * raise ValueError("ngood + nbad < nsample") * return discnmN_array(self.internal_state, rk_hypergeometric, size, */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_kp_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_add); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_ongood)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood)); - Py_INCREF(((PyObject *)__pyx_v_onbad)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_onbad)); - __pyx_6 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6); - Py_INCREF(((PyObject *)__pyx_v_onsample)); - PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onsample)); - __pyx_6 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); - __pyx_2 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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 = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)__pyx_v_ongood)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ongood)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ongood)); + __Pyx_INCREF(((PyObject *)__pyx_v_onbad)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_onbad)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_onbad)); + /* __pyx_t_6 allocated */ + __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_onsample)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_onsample)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_onsample)); + __pyx_t_6 = 0; + /* __pyx_t_6 released */ + /* __pyx_t_6 allocated */ + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + /* __pyx_t_6 released */ + /* __pyx_t_6 allocated */ + __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_2 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + /* __pyx_t_6 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2825 * raise ValueError("nsample < 1") @@ -13206,17 +18028,33 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * return discnmN_array(self.internal_state, rk_hypergeometric, size, * ongood, onbad, onsample) */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_120); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_120); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_6 allocated */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_INCREF(__pyx_kp_120); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_120); + __Pyx_GIVEREF(__pyx_kp_120); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + /* __pyx_t_6 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; + goto __pyx_L14; } - __pyx_L13:; + __pyx_L14:; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2826 + * if np.any(np.less(np.add(ongood, onbad),onsample)): + * raise ValueError("ngood + nbad < nsample") + * return discnmN_array(self.internal_state, rk_hypergeometric, size, # <<<<<<<<<<<<<< + * ongood, onbad, onsample) + * + */ + __Pyx_XDECREF(__pyx_r); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2827 * raise ValueError("ngood + nbad < nsample") @@ -13225,25 +18063,31 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v * * def logseries(self, p, size=None): */ - __pyx_3 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_ongood, __pyx_v_onbad, __pyx_v_onsample); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_ongood, __pyx_v_onbad, __pyx_v_onsample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("mtrand.RandomState.hypergeometric"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_ongood); - Py_DECREF(__pyx_v_onbad); - Py_DECREF(__pyx_v_onsample); + __Pyx_DECREF((PyObject *)__pyx_v_ongood); + __Pyx_DECREF((PyObject *)__pyx_v_onbad); + __Pyx_DECREF((PyObject *)__pyx_v_onsample); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -13262,29 +18106,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_op; double __pyx_v_fp; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"p","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + 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; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_p,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("logseries"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "logseries") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_p = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_p, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("logseries", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.logseries"); return NULL; - __pyx_L4:; - __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2906 * cdef double fp @@ -13302,8 +18175,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * if fp <= 0.0: * raise ValueError("p <= 0.0") */ - __pyx_1 = (!PyErr_Occurred()); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (!PyErr_Occurred()); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2908 * fp = PyFloat_AsDouble(p) @@ -13312,8 +18187,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * raise ValueError("p <= 0.0") * if fp >= 1.0: */ - __pyx_1 = (__pyx_v_fp <= 0.0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp <= 0.0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2909 * if not PyErr_Occurred(): @@ -13322,17 +18199,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * if fp >= 1.0: * raise ValueError("p >= 1.0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_121); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_121); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_121); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_121); + __Pyx_GIVEREF(__pyx_kp_121); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2910 * if fp <= 0.0: @@ -13341,8 +18225,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * raise ValueError("p >= 1.0") * return discd_array_sc(self.internal_state, rk_logseries, size, fp) */ - __pyx_1 = (__pyx_v_fp >= 1.0); - if (__pyx_1) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = (__pyx_v_fp >= 1.0); + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2911 * raise ValueError("p <= 0.0") @@ -13351,17 +18237,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * return discd_array_sc(self.internal_state, rk_logseries, size, fp) * */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_122); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_122); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_kp_122); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_122); + __Pyx_GIVEREF(__pyx_kp_122); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2912 * if fp >= 1.0: @@ -13370,13 +18263,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * * PyErr_Clear() */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logseries, __pyx_v_size, __pyx_v_fp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_2 allocated */ + __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logseries, __pyx_v_size, __pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2914 * return discd_array_sc(self.internal_state, rk_logseries, size, fp) @@ -13394,11 +18291,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * if np.any(np.less_equal(op, 0.0)): * raise ValueError("p <= 0.0") */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_op)); + __pyx_v_op = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2917 * @@ -13407,30 +18307,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * raise ValueError("p <= 0.0") * if np.any(np.greater_equal(op, 1.0)): */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __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 = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_op)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_5 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __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 = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_5 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2918 * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) @@ -13439,17 +18367,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * if np.any(np.greater_equal(op, 1.0)): * raise ValueError("p >= 1.0") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_123); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_123); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_kp_123); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_123); + __Pyx_GIVEREF(__pyx_kp_123); + /* __pyx_t_5 allocated */ + __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 = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2919 * if np.any(np.less_equal(op, 0.0)): @@ -13458,30 +18393,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * raise ValueError("p >= 1.0") * return discd_array(self.internal_state, rk_logseries, size, op) */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_greater_equal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); - __pyx_4 = 0; - __pyx_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_1) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_op)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_5 released */ + /* __pyx_t_3 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_1) { + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2920 * raise ValueError("p <= 0.0") @@ -13490,17 +18453,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * return discd_array(self.internal_state, rk_logseries, size, op) * */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_124); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_124); - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_124); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_124); + __Pyx_GIVEREF(__pyx_kp_124); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2921 * if np.any(np.greater_equal(op, 1.0)): @@ -13509,22 +18479,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self * * # Multivariate distributions: */ - __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logseries, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + __Pyx_XDECREF(__pyx_r); + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logseries, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.logseries"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -13549,39 +18526,83 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ PyObject *__pyx_v_u; PyObject *__pyx_v_s; PyObject *__pyx_v_v; - PyObject *__pyx_r; + PyObject *__pyx_r = NULL; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - int __pyx_4; - Py_ssize_t __pyx_5 = 0; - PyObject *__pyx_6 = 0; - static char *__pyx_argnames[] = {"mean","cov","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_mean = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_cov = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + PyObject *__pyx_4 = 0; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mean,&__pyx_kp_cov,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("multivariate_normal"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mean); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_cov); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "multivariate_normal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_mean = values[0]; + __pyx_v_cov = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_cov = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_mean = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal"); return NULL; - __pyx_L4:; - Py_INCREF(__pyx_v_mean); - Py_INCREF(__pyx_v_cov); - __pyx_v_shape = Py_None; Py_INCREF(Py_None); - __pyx_v_final_shape = Py_None; Py_INCREF(Py_None); - __pyx_v_x = Py_None; Py_INCREF(Py_None); - __pyx_v_svd = Py_None; Py_INCREF(Py_None); - __pyx_v_u = Py_None; Py_INCREF(Py_None); - __pyx_v_s = Py_None; Py_INCREF(Py_None); - __pyx_v_v = Py_None; Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF(__pyx_v_mean); + __Pyx_INCREF(__pyx_v_cov); + __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_final_shape = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_x = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_svd = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_u = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_v = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3017 * """ @@ -13591,17 +18612,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * if size is None: */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_mean); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean); - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - Py_DECREF(__pyx_v_mean); - __pyx_v_mean = __pyx_3; - __pyx_3 = 0; + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + /* __pyx_t_3 allocated */ + __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 = 3017; __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_t_1 released */ + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_v_mean); + __pyx_v_mean = __pyx_t_3; + __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3018 * # Check preconditions on arguments @@ -13610,18 +18642,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * if size is None: * shape = [] */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_array); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_cov); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov); - __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - Py_DECREF(__pyx_v_cov); - __pyx_v_cov = __pyx_2; - __pyx_2 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_cov); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cov); + __Pyx_GIVEREF(__pyx_v_cov); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_v_cov); + __pyx_v_cov = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3019 * mean = np.array(mean) @@ -13630,8 +18673,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * shape = [] * else: */ - __pyx_4 = (__pyx_v_size == Py_None); - if (__pyx_4) { + /* __pyx_t_4 allocated */ + __pyx_t_4 = (__pyx_v_size == Py_None); + if (__pyx_t_4) { + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3020 * cov = np.array(cov) @@ -13640,11 +18685,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * else: * shape = size */ - __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_1); - __pyx_1 = 0; - goto __pyx_L5; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + goto __pyx_L6; } /*else*/ { @@ -13655,11 +18703,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * if len(mean.shape) != 1: * raise ValueError("mean must be 1 dimensional") */ - Py_INCREF(__pyx_v_size); - Py_DECREF(__pyx_v_shape); + __Pyx_INCREF(__pyx_v_size); + __Pyx_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_v_size; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3023 * else: @@ -13668,11 +18716,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * raise ValueError("mean must be 1 dimensional") * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): */ - __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_Length(__pyx_3); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = (__pyx_5 != 1); - if (__pyx_4) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = (__pyx_t_5 != 1); + /* __pyx_t_5 released */ + if (__pyx_t_4) { + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3024 * shape = size @@ -13681,17 +18736,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): * raise ValueError("cov must be 2 dimensional and square") */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_125); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_125); - __pyx_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_1, 0, 0); - Py_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_kp_125); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_125); + __Pyx_GIVEREF(__pyx_kp_125); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + goto __pyx_L7; } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3025 * if len(mean.shape) != 1: @@ -13700,26 +18762,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * raise ValueError("cov must be 2 dimensional and square") * if mean.shape[0] != cov.shape[0]: */ - __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_Length(__pyx_2); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = __Pyx_PyBool_FromLong((__pyx_5 != 2)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!__pyx_4) { - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetItemInt(__pyx_1, 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = __Pyx_GetItemInt(__pyx_1, 1, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = PyObject_RichCompare(__pyx_2, __pyx_6, Py_NE); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_6); __pyx_6 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = (__pyx_t_5 != 2); + /* __pyx_t_5 released */ + if (!__pyx_t_4) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_2 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_RichCompare(__pyx_1, __pyx_2, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_6 allocated */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_7 allocated */ + __pyx_t_7 = __pyx_t_6; + /* __pyx_t_6 released */ + } else { + __pyx_t_7 = __pyx_t_4; + /* __pyx_t_4 released */ } - __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_4) { + if (__pyx_t_7) { + /* __pyx_t_7 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3026 * raise ValueError("mean must be 1 dimensional") @@ -13728,17 +18813,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * if mean.shape[0] != cov.shape[0]: * raise ValueError("mean and cov must have same length") */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_126); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_126); - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_126); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_126); + __Pyx_GIVEREF(__pyx_kp_126); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + goto __pyx_L8; } - __pyx_L7:; + __pyx_L8:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3027 * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): @@ -13747,18 +18839,31 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * raise ValueError("mean and cov must have same length") * # Compute shape of output */ - __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_GetItemInt(__pyx_6, 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetItemInt(__pyx_1, 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_6 = PyObject_RichCompare(__pyx_3, __pyx_2, Py_NE); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - if (__pyx_4) { + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_1 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_RichCompare(__pyx_1, __pyx_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_7 allocated */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + if (__pyx_t_7) { + /* __pyx_t_7 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3028 * raise ValueError("cov must be 2 dimensional and square") @@ -13767,17 +18872,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * # Compute shape of output * if isinstance(shape, int): */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_127); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_127); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_kp_127); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_127); + __Pyx_GIVEREF(__pyx_kp_127); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + goto __pyx_L9; } - __pyx_L8:; + __pyx_L9:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3030 * raise ValueError("mean and cov must have same length") @@ -13786,8 +18898,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * shape = [shape] * final_shape = list(shape[:]) */ - __pyx_4 = PyObject_IsInstance(__pyx_v_shape, ((PyObject*)&PyInt_Type)); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_4) { + /* __pyx_t_7 allocated */ + __pyx_t_7 = PyObject_TypeCheck(__pyx_v_shape, ((PyTypeObject *)((PyObject*)&PyInt_Type))); + if (__pyx_t_7) { + /* __pyx_t_7 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3031 * # Compute shape of output @@ -13796,15 +18910,19 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * final_shape = list(shape[:]) * final_shape.append(mean.shape[0]) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_shape); - PyList_SET_ITEM(__pyx_2, 0, __pyx_v_shape); - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_2); - __pyx_2 = 0; - goto __pyx_L9; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_shape); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = ((PyObject *)__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3032 * if isinstance(shape, int): @@ -13813,15 +18931,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * final_shape.append(mean.shape[0]) * # Create a matrix of independent standard normally distributed random */ - __pyx_6 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6); - __pyx_6 = 0; - __pyx_3 = PyObject_Call(((PyObject*)&PyList_Type), ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - Py_DECREF(__pyx_v_final_shape); - __pyx_v_final_shape = __pyx_3; - __pyx_3 = 0; + __pyx_1 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_1); + __Pyx_GIVEREF(__pyx_1); + __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_v_final_shape); + __pyx_v_final_shape = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3033 * shape = [shape] @@ -13830,12 +18956,19 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * # Create a matrix of independent standard normally distributed random * # numbers. The matrix has rows with the same length as mean and as */ - __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = __Pyx_GetItemInt(__pyx_2, 0, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_PyObject_Append(__pyx_v_final_shape, __pyx_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_1 allocated */ + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_final_shape, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3037 * # numbers. The matrix has rows with the same length as mean and as @@ -13844,27 +18977,51 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]), * mean.shape[0]) */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyObject_GetAttr(__pyx_2, __pyx_kp_multiply); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_kp_reduce); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_final_shape); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_final_shape); - __pyx_6 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6); - __pyx_6 = 0; - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - Py_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_multiply); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_kp_reduce); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_final_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_final_shape); + __Pyx_GIVEREF(__pyx_v_final_shape); + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + /* __pyx_t_8 released */ + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_8; + __pyx_t_8 = 0; + /* __pyx_t_8 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3038 * # many rows are necessary to form a matrix of shape final_shape. @@ -13873,19 +19030,35 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * mean.shape[0]) * # Transform matrix of standard normals into matrix where each row */ - __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_kp_multiply); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_reduce); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); - __pyx_2 = 0; - __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyObject_GetAttr(__pyx_2, __pyx_kp_multiply); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_kp_reduce); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /* __pyx_t_8 released */ + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Length(__pyx_v_final_shape); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_t_5 - 1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_5 released */ + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_1); + __Pyx_GIVEREF(__pyx_1); + __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_8 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3039 * x = self.standard_normal(np.multiply.reduce(final_shape)) @@ -13894,14 +19067,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * # Transform matrix of standard normals into matrix where each row * # contains multivariate normals with the desired covariance. */ - __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_GetItemInt(__pyx_2, 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3); - PyTuple_SET_ITEM(__pyx_6, 1, __pyx_1); - __pyx_3 = 0; - __pyx_1 = 0; + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /* __pyx_t_8 released */ + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_2); + __Pyx_GIVEREF(__pyx_2); + __pyx_t_1 = 0; + __pyx_2 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3038 * # many rows are necessary to form a matrix of shape final_shape. @@ -13910,8 +19092,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * mean.shape[0]) * # Transform matrix of standard normals into matrix where each row */ - if (PyObject_SetAttr(__pyx_v_x, __pyx_kp_shape, ((PyObject *)__pyx_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; + if (PyObject_SetAttr(__pyx_v_x, __pyx_kp_shape, ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + /* __pyx_t_8 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3047 * # decomposition of cov is such an A. @@ -13920,16 +19103,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * # XXX: we really should be doing this by Cholesky decomposition * (u,s,v) = svd(cov) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_svd); - PyList_SET_ITEM(__pyx_2, 0, __pyx_kp_svd); - __pyx_3 = __Pyx_Import(__pyx_kp_128, ((PyObject *)__pyx_2)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_svd); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_svd); - __pyx_v_svd = __pyx_1; - __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_INCREF(__pyx_kp_svd); + PyList_SET_ITEM(__pyx_t_8, 0, __pyx_kp_svd); + __Pyx_GIVEREF(__pyx_kp_svd); + __pyx_1 = __Pyx_Import(__pyx_kp_128, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + /* __pyx_t_8 released */ + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_svd); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __Pyx_DECREF(__pyx_v_svd); + __pyx_v_svd = __pyx_2; + __pyx_2 = 0; + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3049 * from numpy.dual import svd @@ -13938,48 +19127,55 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * x = np.dot(x*np.sqrt(s),v) * # The rows of x now have the correct covariance but mean 0. Add */ - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_cov); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_cov); - __pyx_2 = PyObject_Call(__pyx_v_svd, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 3) { - PyObject* tuple = __pyx_2; - __pyx_1 = PyTuple_GET_ITEM(tuple, 0); - Py_INCREF(__pyx_1); - Py_DECREF(__pyx_v_u); - __pyx_v_u = __pyx_1; - __pyx_1 = 0; - __pyx_6 = PyTuple_GET_ITEM(tuple, 1); - Py_INCREF(__pyx_6); - Py_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_6; - __pyx_6 = 0; - __pyx_1 = PyTuple_GET_ITEM(tuple, 2); - Py_INCREF(__pyx_1); - Py_DECREF(__pyx_v_v); - __pyx_v_v = __pyx_1; - __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - } - else { - __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_3, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_u); - __pyx_v_u = __pyx_1; - __pyx_1 = 0; - __pyx_6 = __Pyx_UnpackItem(__pyx_3, 1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_6; - __pyx_6 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_3, 2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_v); - __pyx_v_v = __pyx_1; - __pyx_1 = 0; - if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_INCREF(__pyx_v_cov); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_cov); + __Pyx_GIVEREF(__pyx_v_cov); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(__pyx_v_svd, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + /* __pyx_t_8 released */ + if (PyTuple_CheckExact(__pyx_t_1) && PyTuple_GET_SIZE(__pyx_t_1) == 3) { + PyObject* tuple = __pyx_t_1; + __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2); + __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3); + __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_v_u); + __pyx_v_u = __pyx_2; + __pyx_2 = 0; + __Pyx_DECREF(__pyx_v_s); + __pyx_v_s = __pyx_3; + __pyx_3 = 0; + __Pyx_DECREF(__pyx_v_v); + __pyx_v_v = __pyx_4; + __pyx_4 = 0; + } else { + __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_3); + __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_4); + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_v_u); + __pyx_v_u = __pyx_2; + __pyx_2 = 0; + __Pyx_DECREF(__pyx_v_s); + __pyx_v_s = __pyx_3; + __pyx_3 = 0; + __Pyx_DECREF(__pyx_v_v); + __pyx_v_v = __pyx_4; + __pyx_4 = 0; } + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3050 * # XXX: we really should be doing this by Cholesky decomposition @@ -13988,31 +19184,57 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * # The rows of x now have the correct covariance but mean 0. Add * # mean to each row. Then each row will have mean mean. */ - __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_kp_dot); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_dot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_sqrt); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_s); - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - __pyx_3 = PyNumber_Multiply(__pyx_v_x, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3); - Py_INCREF(__pyx_v_v); - PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_v); - __pyx_3 = 0; - __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - Py_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_2; - __pyx_2 = 0; + __Pyx_GOTREF(__pyx_2); + /* __pyx_t_8 allocated */ + __pyx_t_8 = PyObject_GetAttr(__pyx_2, __pyx_kp_sqrt); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_8 released */ + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyNumber_Multiply(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_3 released */ + __Pyx_DECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3053 * # The rows of x now have the correct covariance but mean 0. Add @@ -14022,19 +19244,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * return x */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_add); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_6 = PyTuple_New(3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_mean); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_mean); - Py_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_x); - Py_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_6, 2, __pyx_v_x); - __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_GOTREF(__pyx_3); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_3); __pyx_3 = 0; + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 released */ + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3054 * # mean to each row. Then each row will have mean mean. @@ -14043,13 +19278,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * return x * */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_final_shape); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape); - __pyx_1 = PyObject_Call(((PyObject*)&PyTuple_Type), ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - if (PyObject_SetAttr(__pyx_v_x, __pyx_kp_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_v_final_shape); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_final_shape); + __Pyx_GIVEREF(__pyx_v_final_shape); + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + if (PyObject_SetAttr(__pyx_v_x, __pyx_kp_shape, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3055 * np.add(mean,x,x) @@ -14058,29 +19300,36 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__ * * def multinomial(self, long n, object pvals, size=None): */ - Py_INCREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_6); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_2); + __Pyx_XDECREF(__pyx_3); + __Pyx_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_shape); - Py_DECREF(__pyx_v_final_shape); - Py_DECREF(__pyx_v_x); - Py_DECREF(__pyx_v_svd); - Py_DECREF(__pyx_v_u); - Py_DECREF(__pyx_v_s); - Py_DECREF(__pyx_v_v); - Py_DECREF(__pyx_v_mean); - Py_DECREF(__pyx_v_cov); + __Pyx_DECREF(__pyx_v_shape); + __Pyx_DECREF(__pyx_v_final_shape); + __Pyx_DECREF(__pyx_v_x); + __Pyx_DECREF(__pyx_v_svd); + __Pyx_DECREF(__pyx_v_u); + __Pyx_DECREF(__pyx_v_s); + __Pyx_DECREF(__pyx_v_v); + __Pyx_DECREF(__pyx_v_mean); + __Pyx_DECREF(__pyx_v_cov); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -14109,34 +19358,73 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se double __pyx_v_Sum; PyObject *__pyx_v_shape; PyObject *__pyx_v_multin; - PyObject *__pyx_r; - Py_ssize_t __pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_3; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - long __pyx_6; - static char *__pyx_argnames[] = {"n","pvals","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(2 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 3)) { - __pyx_v_n = __pyx_PyInt_long(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_pvals = PyTuple_GET_ITEM(__pyx_args, 1); - if (PyTuple_GET_SIZE(__pyx_args) > 2) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_1 = 0; + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + long __pyx_t_6; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_n,&__pyx_kp_pvals,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("multinomial"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[3] = {0,0,0}; + values[2] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_n); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_pvals); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "multinomial") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_n = __pyx_PyInt_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_pvals = values[1]; + __pyx_v_size = values[2]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: + __pyx_v_pvals = PyTuple_GET_ITEM(__pyx_args, 1); + __pyx_v_n = __pyx_PyInt_long(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lO|O", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.multinomial"); return NULL; - __pyx_L4:; - arrayObject_parr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - arrayObject_mnarr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_shape = Py_None; Py_INCREF(Py_None); - __pyx_v_multin = Py_None; Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + arrayObject_parr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + arrayObject_mnarr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_multin = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3116 * cdef double Sum @@ -14145,8 +19433,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1) * pix = <double*>parr.data */ - __pyx_1 = PyObject_Length(__pyx_v_pvals); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_d = __pyx_1; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Length(__pyx_v_pvals); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_d = __pyx_t_1; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3117 * @@ -14155,11 +19445,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * pix = <double*>parr.data * */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)arrayObject_parr)); - arrayObject_parr = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_pvals, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject_parr)); + arrayObject_parr = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3118 * d = len(pvals) @@ -14177,8 +19470,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * raise ValueError("sum(pvals[:-1]) > 1.0") * */ - __pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix, (__pyx_v_d - 1)) > (1.0 + 1e-12)); - if (__pyx_3) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix, (__pyx_v_d - 1)) > 1.0000000000010001); + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3121 * @@ -14187,17 +19482,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * * if size is None: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_129); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_129); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_kp_129); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_129); + __Pyx_GIVEREF(__pyx_kp_129); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3123 * raise ValueError("sum(pvals[:-1]) > 1.0") @@ -14206,8 +19508,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * shape = (d,) * elif type(size) is int: */ - __pyx_3 = (__pyx_v_size == Py_None); - if (__pyx_3) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_v_size == Py_None); + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3124 * @@ -14216,14 +19520,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * elif type(size) is int: * shape = (size, d) */ - __pyx_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_4); - __pyx_4 = 0; - goto __pyx_L6; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = ((PyObject *)__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + goto __pyx_L7; } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3125 @@ -14233,14 +19544,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * shape = (size, d) * else: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - __pyx_4 = PyObject_Call(((PyObject*)&PyType_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_3 = (__pyx_4 == ((PyObject*)&PyInt_Type)); - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_3) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); + __Pyx_GIVEREF(__pyx_v_size); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_t_4 == ((PyObject *)((PyObject*)&PyInt_Type))); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3126 * shape = (d,) @@ -14249,16 +19569,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * else: * shape = size + (d,) */ - __pyx_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); - __pyx_2 = 0; - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_4); - __pyx_4 = 0; - goto __pyx_L6; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); + __Pyx_GIVEREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = ((PyObject *)__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + goto __pyx_L7; } /*else*/ { @@ -14269,17 +19597,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * * multin = np.zeros(shape, int) */ - __pyx_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_4)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ } - __pyx_L6:; + __pyx_L7:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3130 * shape = size + (d,) @@ -14288,20 +19626,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * mnarr = <ndarray>multin * mnix = <long*>mnarr.data */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_kp_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_shape); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_shape); - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject*)&PyInt_Type)); - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - Py_DECREF(__pyx_v_multin); - __pyx_v_multin = __pyx_5; - __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + /* __pyx_t_5 allocated */ + __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 = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_4 released */ + __Pyx_DECREF(__pyx_v_multin); + __pyx_v_multin = __pyx_t_5; + __pyx_t_5 = 0; + /* __pyx_t_5 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3131 * @@ -14310,8 +19660,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * mnix = <long*>mnarr.data * i = 0 */ - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); - Py_DECREF(((PyObject *)arrayObject_mnarr)); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); + __Pyx_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3132 @@ -14340,8 +19690,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * dn = n */ while (1) { - __pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); - if (!__pyx_3) break; + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); + if (!__pyx_t_3) break; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3135 * i = 0 @@ -14368,8 +19720,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum) * dn = dn - mnix[i+j] */ - __pyx_6 = (__pyx_v_d - 1); - for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; __pyx_v_j++) { + /* __pyx_t_6 allocated */ + __pyx_t_6 = (__pyx_v_d - 1); + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3138 * dn = n @@ -14396,8 +19749,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * break * Sum = Sum - pix[j] */ - __pyx_3 = (__pyx_v_dn <= 0); - if (__pyx_3) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_v_dn <= 0); + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3141 * dn = dn - mnix[i+j] @@ -14406,10 +19761,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * Sum = Sum - pix[j] * if dn > 0: */ - goto __pyx_L10; - goto __pyx_L11; + goto __pyx_L11_break; + goto __pyx_L12; } - __pyx_L11:; + __pyx_L12:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3142 * if dn <= 0: @@ -14420,7 +19775,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se */ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j])); } - __pyx_L10:; + __pyx_L11_break:; + /* __pyx_t_6 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3143 * break @@ -14429,8 +19785,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * mnix[i+d-1] = dn * */ - __pyx_3 = (__pyx_v_dn > 0); - if (__pyx_3) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_v_dn > 0); + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3144 * Sum = Sum - pix[j] @@ -14440,9 +19798,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * i = i + d */ (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn; - goto __pyx_L12; + goto __pyx_L13; } - __pyx_L12:; + __pyx_L13:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3146 * mnix[i+d-1] = dn @@ -14461,23 +19819,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se * * def dirichlet(self, object alpha, size=None): */ - Py_INCREF(__pyx_v_multin); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_multin); __pyx_r = __pyx_v_multin; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.multinomial"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(arrayObject_parr); - Py_DECREF(arrayObject_mnarr); - Py_DECREF(__pyx_v_shape); - Py_DECREF(__pyx_v_multin); + __Pyx_DECREF((PyObject *)arrayObject_parr); + __Pyx_DECREF((PyObject *)arrayObject_mnarr); + __Pyx_DECREF(__pyx_v_shape); + __Pyx_DECREF(__pyx_v_multin); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -14506,32 +19868,61 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self double __pyx_v_invacc; PyObject *__pyx_v_shape; PyObject *__pyx_v_diric; - PyObject *__pyx_r; - Py_ssize_t __pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_3; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static char *__pyx_argnames[] = {"alpha","size",0}; - __pyx_v_size = Py_None; - if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) { - __pyx_v_alpha = PyTuple_GET_ITEM(__pyx_args, 0); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + PyObject *__pyx_r = NULL; + PyObject *__pyx_1 = 0; + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_kp_alpha,&__pyx_kp_size,0}; + __Pyx_SetupRefcountContext("dirichlet"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + values[1] = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_alpha); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 1) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + if (unlikely(value)) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dirichlet") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_alpha = values[0]; + __pyx_v_size = values[1]; + } else { + __pyx_v_size = Py_None; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: __pyx_v_alpha = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_alpha, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dirichlet", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mtrand.RandomState.dirichlet"); return NULL; - __pyx_L4:; - __pyx_v_alpha_arr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_val_arr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_shape = Py_None; Py_INCREF(Py_None); - __pyx_v_diric = Py_None; Py_INCREF(Py_None); + __pyx_L4_argument_unpacking_done:; + __pyx_v_alpha_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_val_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_diric = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3214 * cdef double acc, invacc @@ -14540,8 +19931,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * alpha_arr = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1) * alpha_data = <double*>alpha_arr.data */ - __pyx_1 = PyObject_Length(__pyx_v_alpha); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_k = __pyx_1; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Length(__pyx_v_alpha); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3215 * @@ -14550,11 +19943,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * alpha_data = <double*>alpha_arr.data * */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_alpha_arr)); - __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_alpha, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)__pyx_v_alpha_arr)); + __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3216 * k = len(alpha) @@ -14572,8 +19968,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * shape = (k,) * elif type(size) is int: */ - __pyx_3 = (__pyx_v_size == Py_None); - if (__pyx_3) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_v_size == Py_None); + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3219 * @@ -14582,14 +19980,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * elif type(size) is int: * shape = (size, k) */ - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_4); - __pyx_4 = 0; - goto __pyx_L5; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = ((PyObject *)__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + goto __pyx_L6; } /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3220 @@ -14599,14 +20004,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * shape = (size, k) * else: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - __pyx_4 = PyObject_Call(((PyObject*)&PyType_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __pyx_3 = (__pyx_4 == ((PyObject*)&PyInt_Type)); - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_3) { + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + __Pyx_GIVEREF(__pyx_v_size); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_t_2 == ((PyObject *)((PyObject*)&PyInt_Type))); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3221 * shape = (k,) @@ -14615,16 +20029,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * else: * shape = size + (k,) */ - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); - __pyx_2 = 0; - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_4); - __pyx_4 = 0; - goto __pyx_L5; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + __Pyx_GIVEREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = ((PyObject *)__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + goto __pyx_L6; } /*else*/ { @@ -14635,17 +20057,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * * diric = np.zeros(shape, np.float64) */ - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_4)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - Py_DECREF(__pyx_v_shape); - __pyx_v_shape = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ } - __pyx_L5:; + __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3225 * shape = size + (k,) @@ -14654,23 +20086,39 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * val_arr = <ndarray>diric * val_data= <double*>val_arr.data */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_kp_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_kp_19); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_shape); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_shape); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5); - __pyx_5 = 0; - __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - Py_DECREF(__pyx_v_diric); - __pyx_v_diric = __pyx_5; - __pyx_5 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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 = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_5 released */ + __Pyx_DECREF(__pyx_v_diric); + __pyx_v_diric = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3226 * @@ -14679,8 +20127,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * val_data= <double*>val_arr.data * */ - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric))); - Py_DECREF(((PyObject *)__pyx_v_val_arr)); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric))); + __Pyx_DECREF(((PyObject *)__pyx_v_val_arr)); __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3227 @@ -14718,8 +20166,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * for j from 0 <= j < k: */ while (1) { - __pyx_3 = (__pyx_v_i < __pyx_v_totsize); - if (!__pyx_3) break; + /* __pyx_t_3 allocated */ + __pyx_t_3 = (__pyx_v_i < __pyx_v_totsize); + if (!__pyx_t_3) break; + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3232 * totsize = PyArray_SIZE(val_arr) @@ -14803,23 +20253,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self * * # Shuffling and permutations: */ - Py_INCREF(__pyx_v_diric); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_diric); __pyx_r = __pyx_v_diric; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.dirichlet"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_alpha_arr); - Py_DECREF(__pyx_v_val_arr); - Py_DECREF(__pyx_v_shape); - Py_DECREF(__pyx_v_diric); + __Pyx_DECREF((PyObject *)__pyx_v_alpha_arr); + __Pyx_DECREF((PyObject *)__pyx_v_val_arr); + __Pyx_DECREF(__pyx_v_shape); + __Pyx_DECREF(__pyx_v_diric); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -14837,13 +20291,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, long __pyx_v_i; long __pyx_v_j; int __pyx_v_copy; - PyObject *__pyx_r; - Py_ssize_t __pyx_1 = 0; + PyObject *__pyx_r = NULL; + PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - int __pyx_5; - int __pyx_6; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_SetupRefcountContext("shuffle"); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3254 * cdef int copy @@ -14852,8 +20310,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * try: * j = len(x[0]) */ - __pyx_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_i = (__pyx_1 - 1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = (__pyx_t_1 - 1); + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3255 * @@ -14862,49 +20322,75 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * j = len(x[0]) * except: */ - /*try:*/ { - - /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3256 + { + PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; + __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); + __Pyx_XGOTREF(__pyx_save_exc_type); + __Pyx_XGOTREF(__pyx_save_exc_value); + __Pyx_XGOTREF(__pyx_save_exc_tb); + /*try:*/ { + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3256 * i = len(x) - 1 * try: * j = len(x[0]) # <<<<<<<<<<<<<< * except: * j = 0 */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __pyx_1 = PyObject_Length(__pyx_2); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_v_j = __pyx_1; - } - goto __pyx_L6; - __pyx_L5_error:; - Py_XDECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3257 + __pyx_1 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Length(__pyx_1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_v_j = __pyx_t_1; + /* __pyx_t_1 released */ + } + __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; + __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; + __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3257 * try: * j = len(x[0]) * except: # <<<<<<<<<<<<<< * j = 0 * */ - /*except:*/ { - __Pyx_AddTraceback("mtrand.shuffle"); - if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*except:*/ { + __Pyx_AddTraceback("mtrand.shuffle"); + if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_GOTREF(__pyx_2); + __Pyx_GOTREF(__pyx_3); - /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3258 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3258 * j = len(x[0]) * except: * j = 0 # <<<<<<<<<<<<<< * * if (j == 0): */ - __pyx_v_j = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - goto __pyx_L6; + __pyx_v_j = 0; + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_DECREF(__pyx_3); __pyx_3 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + __Pyx_XDECREF(__pyx_save_exc_type); + __Pyx_XDECREF(__pyx_save_exc_value); + __Pyx_XDECREF(__pyx_save_exc_tb); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_save_exc_type); + __Pyx_XGIVEREF(__pyx_save_exc_value); + __Pyx_XGIVEREF(__pyx_save_exc_tb); + __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); + __pyx_L12_try_end:; } - __pyx_L6:; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3260 * j = 0 @@ -14913,8 +20399,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * # adaptation of random.shuffle() * while i > 0: */ - __pyx_5 = (__pyx_v_j == 0); - if (__pyx_5) { + /* __pyx_t_2 allocated */ + __pyx_t_2 = (__pyx_v_j == 0); + if (__pyx_t_2) { + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3262 * if (j == 0): @@ -14924,8 +20412,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * x[i], x[j] = x[j], x[i] */ while (1) { - __pyx_5 = (__pyx_v_i > 0); - if (!__pyx_5) break; + /* __pyx_t_2 allocated */ + __pyx_t_2 = (__pyx_v_i > 0); + if (!__pyx_t_2) break; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3263 * # adaptation of random.shuffle() @@ -14943,12 +20433,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * i = i - 1 * else: */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_2, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3265 * j = rk_interval(i, self.internal_state) @@ -14959,7 +20451,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, */ __pyx_v_i = (__pyx_v_i - 1); } - goto __pyx_L7; + goto __pyx_L15; } /*else*/ { @@ -14970,10 +20462,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * if copy: * while(i > 0): */ - __pyx_4 = __Pyx_GetItemInt(__pyx_v_x, 0, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyObject_HasAttr(__pyx_4, __pyx_kp_130); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_v_copy = __pyx_5; + __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_3); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_HasAttr(__pyx_3, __pyx_kp_130); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_copy = __pyx_t_2; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3269 * # make copies @@ -14982,8 +20477,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * while(i > 0): * j = rk_interval(i, self.internal_state) */ - __pyx_6 = __pyx_v_copy; - if (__pyx_6) { + /* __pyx_t_3 allocated */ + __pyx_t_3 = __pyx_v_copy; + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3270 * copy = hasattr(x[0], 'copy') @@ -14993,8 +20490,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * x[i], x[j] = x[j].copy(), x[i].copy() */ while (1) { - __pyx_5 = (__pyx_v_i > 0); - if (!__pyx_5) break; + /* __pyx_t_2 allocated */ + __pyx_t_2 = (__pyx_v_i > 0); + if (!__pyx_t_2) break; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3271 * if copy: @@ -15012,20 +20511,34 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * i = i - 1 * else: */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_copy); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_copy); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_4, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_2, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_5 allocated */ + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + /* __pyx_t_6 allocated */ + __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_5, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* __pyx_t_5 released */ + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + /* __pyx_t_6 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3273 * j = rk_interval(i, self.internal_state) @@ -15036,7 +20549,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, */ __pyx_v_i = (__pyx_v_i - 1); } - goto __pyx_L10; + goto __pyx_L18; } /*else*/ { @@ -15048,8 +20561,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * x[i], x[j] = x[j][:], x[i][:] */ while (1) { - __pyx_5 = (__pyx_v_i > 0); - if (!__pyx_5) break; + /* __pyx_t_2 allocated */ + __pyx_t_2 = (__pyx_v_i > 0); + if (!__pyx_t_2) break; + /* __pyx_t_2 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3276 * else: @@ -15067,16 +20582,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, * i = i - 1 * */ - __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PySequence_GetSlice(__pyx_3, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_3); + __pyx_1 = PySequence_GetSlice(__pyx_3, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_2); __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_4, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_GOTREF(__pyx_3); + __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_3); __pyx_3 = 0; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3278 * j = rk_interval(i, self.internal_state) @@ -15088,19 +20607,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, __pyx_v_i = (__pyx_v_i - 1); } } - __pyx_L10:; + __pyx_L18:; } - __pyx_L7:; + __pyx_L15:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_2); + __Pyx_XDECREF(__pyx_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("mtrand.RandomState.shuffle"); __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -15116,12 +20640,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_se static char __pyx_doc_6mtrand_11RandomState_permutation[] = "\n permutation(x)\n\n Randomly permute a sequence, or return a permuted range.\n\n Parameters\n ----------\n x : int or array_like\n If `x` is an integer, randomly permute ``np.arange(x)``.\n If `x` is an array, make a copy and shuffle the elements\n randomly.\n\n Returns\n -------\n out : ndarray\n Permuted sequence or array range.\n\n Examples\n --------\n >>> np.random.permutation(10)\n array([1, 7, 4, 3, 0, 9, 2, 5, 8, 6])\n\n >>> np.random.permutation([1, 4, 9, 12, 15])\n array([15, 1, 9, 4, 12])\n\n "; static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { PyObject *__pyx_v_arr; - PyObject *__pyx_r; + PyObject *__pyx_r = NULL; PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_3; - PyObject *__pyx_4 = 0; - __pyx_v_arr = Py_None; Py_INCREF(Py_None); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_SetupRefcountContext("permutation"); + __pyx_v_arr = Py_None; __Pyx_INCREF(Py_None); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3307 * @@ -15131,16 +20657,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_se * else: */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_integer); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject*)&PyInt_Type)); - PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2); - __pyx_2 = 0; - __pyx_3 = PyObject_IsInstance(__pyx_v_x, ((PyObject *)__pyx_1)); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - if (__pyx_3) { + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_integer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + /* __pyx_t_3 allocated */ + __pyx_t_3 = PyObject_IsInstance(__pyx_v_x, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + /* __pyx_t_2 released */ + if (__pyx_t_3) { + /* __pyx_t_3 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3308 * """ @@ -15149,18 +20686,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_se * else: * arr = np.array(x) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_arange); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x); - __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - Py_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_4; - __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_1 released */ + __Pyx_DECREF(__pyx_v_arr); + __pyx_v_arr = __pyx_t_4; + __pyx_t_4 = 0; + /* __pyx_t_4 released */ goto __pyx_L5; } /*else*/ { @@ -15173,17 +20721,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_se * return arr */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_x); - __pyx_1 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - Py_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_1; - __pyx_1 = 0; + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_4 released */ + /* __pyx_t_1 released */ + __Pyx_DECREF(__pyx_v_arr); + __pyx_v_arr = __pyx_t_2; + __pyx_t_2 = 0; + /* __pyx_t_2 released */ } __pyx_L5:; @@ -15194,14 +20753,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_se * return arr * */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_shuffle); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_arr); - __pyx_1 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; + /* __pyx_t_2 allocated */ + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_shuffle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + /* __pyx_t_4 allocated */ + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* __pyx_t_2 released */ + /* __pyx_t_1 released */ + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* __pyx_t_4 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3312 * arr = np.array(x) @@ -15210,20 +20779,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_se * * _rand = RandomState() */ - Py_INCREF(__pyx_v_arr); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); + __Pyx_XDECREF(__pyx_1); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.permutation"); __pyx_r = NULL; __pyx_L0:; - Py_DECREF(__pyx_v_arr); + __Pyx_DECREF(__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_FinishRefcountContext(); return __pyx_r; } @@ -15247,56 +20820,56 @@ static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) { } static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = { - {"seed", (PyCFunction)__pyx_pf_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed}, - {"get_state", (PyCFunction)__pyx_pf_6mtrand_11RandomState_get_state, METH_NOARGS, __pyx_doc_6mtrand_11RandomState_get_state}, - {"set_state", (PyCFunction)__pyx_pf_6mtrand_11RandomState_set_state, METH_O, __pyx_doc_6mtrand_11RandomState_set_state}, - {"__getstate__", (PyCFunction)__pyx_pf_6mtrand_11RandomState___getstate__, METH_NOARGS, 0}, - {"__setstate__", (PyCFunction)__pyx_pf_6mtrand_11RandomState___setstate__, METH_O, 0}, - {"__reduce__", (PyCFunction)__pyx_pf_6mtrand_11RandomState___reduce__, METH_NOARGS, 0}, - {"random_sample", (PyCFunction)__pyx_pf_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample}, - {"tomaxint", (PyCFunction)__pyx_pf_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint}, - {"randint", (PyCFunction)__pyx_pf_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint}, - {"bytes", (PyCFunction)__pyx_pf_6mtrand_11RandomState_bytes, METH_O, __pyx_doc_6mtrand_11RandomState_bytes}, - {"uniform", (PyCFunction)__pyx_pf_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform}, - {"rand", (PyCFunction)__pyx_pf_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand}, - {"randn", (PyCFunction)__pyx_pf_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn}, - {"random_integers", (PyCFunction)__pyx_pf_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers}, - {"standard_normal", (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal}, - {"normal", (PyCFunction)__pyx_pf_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal}, - {"beta", (PyCFunction)__pyx_pf_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta}, - {"exponential", (PyCFunction)__pyx_pf_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential}, - {"standard_exponential", (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential}, - {"standard_gamma", (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma}, - {"gamma", (PyCFunction)__pyx_pf_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma}, - {"f", (PyCFunction)__pyx_pf_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f}, - {"noncentral_f", (PyCFunction)__pyx_pf_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f}, - {"chisquare", (PyCFunction)__pyx_pf_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare}, - {"noncentral_chisquare", (PyCFunction)__pyx_pf_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare}, - {"standard_cauchy", (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy}, - {"standard_t", (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t}, - {"vonmises", (PyCFunction)__pyx_pf_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises}, - {"pareto", (PyCFunction)__pyx_pf_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto}, - {"weibull", (PyCFunction)__pyx_pf_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull}, - {"power", (PyCFunction)__pyx_pf_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power}, - {"laplace", (PyCFunction)__pyx_pf_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace}, - {"gumbel", (PyCFunction)__pyx_pf_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel}, - {"logistic", (PyCFunction)__pyx_pf_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic}, - {"lognormal", (PyCFunction)__pyx_pf_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal}, - {"rayleigh", (PyCFunction)__pyx_pf_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh}, - {"wald", (PyCFunction)__pyx_pf_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald}, - {"triangular", (PyCFunction)__pyx_pf_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular}, - {"binomial", (PyCFunction)__pyx_pf_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial}, - {"negative_binomial", (PyCFunction)__pyx_pf_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial}, - {"poisson", (PyCFunction)__pyx_pf_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson}, - {"zipf", (PyCFunction)__pyx_pf_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf}, - {"geometric", (PyCFunction)__pyx_pf_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric}, - {"hypergeometric", (PyCFunction)__pyx_pf_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric}, - {"logseries", (PyCFunction)__pyx_pf_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries}, - {"multivariate_normal", (PyCFunction)__pyx_pf_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal}, - {"multinomial", (PyCFunction)__pyx_pf_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial}, - {"dirichlet", (PyCFunction)__pyx_pf_6mtrand_11RandomState_dirichlet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_dirichlet}, - {"shuffle", (PyCFunction)__pyx_pf_6mtrand_11RandomState_shuffle, METH_O, __pyx_doc_6mtrand_11RandomState_shuffle}, - {"permutation", (PyCFunction)__pyx_pf_6mtrand_11RandomState_permutation, METH_O, __pyx_doc_6mtrand_11RandomState_permutation}, + {__Pyx_NAMESTR("seed"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_seed)}, + {__Pyx_NAMESTR("get_state"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_get_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_get_state)}, + {__Pyx_NAMESTR("set_state"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_set_state, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_set_state)}, + {__Pyx_NAMESTR("__getstate__"), (PyCFunction)__pyx_pf_6mtrand_11RandomState___getstate__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__setstate__"), (PyCFunction)__pyx_pf_6mtrand_11RandomState___setstate__, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_6mtrand_11RandomState___reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("random_sample"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_random_sample)}, + {__Pyx_NAMESTR("tomaxint"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_tomaxint)}, + {__Pyx_NAMESTR("randint"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_randint)}, + {__Pyx_NAMESTR("bytes"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_bytes, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_bytes)}, + {__Pyx_NAMESTR("uniform"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_uniform)}, + {__Pyx_NAMESTR("rand"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_rand)}, + {__Pyx_NAMESTR("randn"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_randn)}, + {__Pyx_NAMESTR("random_integers"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_random_integers)}, + {__Pyx_NAMESTR("standard_normal"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_standard_normal)}, + {__Pyx_NAMESTR("normal"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_normal)}, + {__Pyx_NAMESTR("beta"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_beta)}, + {__Pyx_NAMESTR("exponential"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_exponential)}, + {__Pyx_NAMESTR("standard_exponential"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_standard_exponential)}, + {__Pyx_NAMESTR("standard_gamma"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_standard_gamma)}, + {__Pyx_NAMESTR("gamma"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_gamma)}, + {__Pyx_NAMESTR("f"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_f)}, + {__Pyx_NAMESTR("noncentral_f"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_noncentral_f)}, + {__Pyx_NAMESTR("chisquare"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_chisquare)}, + {__Pyx_NAMESTR("noncentral_chisquare"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_noncentral_chisquare)}, + {__Pyx_NAMESTR("standard_cauchy"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_standard_cauchy)}, + {__Pyx_NAMESTR("standard_t"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_standard_t)}, + {__Pyx_NAMESTR("vonmises"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_vonmises)}, + {__Pyx_NAMESTR("pareto"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_pareto)}, + {__Pyx_NAMESTR("weibull"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_weibull)}, + {__Pyx_NAMESTR("power"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_power)}, + {__Pyx_NAMESTR("laplace"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_laplace)}, + {__Pyx_NAMESTR("gumbel"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_gumbel)}, + {__Pyx_NAMESTR("logistic"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_logistic)}, + {__Pyx_NAMESTR("lognormal"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_lognormal)}, + {__Pyx_NAMESTR("rayleigh"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_rayleigh)}, + {__Pyx_NAMESTR("wald"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_wald)}, + {__Pyx_NAMESTR("triangular"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_triangular)}, + {__Pyx_NAMESTR("binomial"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_binomial)}, + {__Pyx_NAMESTR("negative_binomial"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_negative_binomial)}, + {__Pyx_NAMESTR("poisson"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_poisson)}, + {__Pyx_NAMESTR("zipf"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_zipf)}, + {__Pyx_NAMESTR("geometric"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_geometric)}, + {__Pyx_NAMESTR("hypergeometric"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_hypergeometric)}, + {__Pyx_NAMESTR("logseries"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_logseries)}, + {__Pyx_NAMESTR("multivariate_normal"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_multivariate_normal)}, + {__Pyx_NAMESTR("multinomial"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_multinomial)}, + {__Pyx_NAMESTR("dirichlet"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_dirichlet, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_dirichlet)}, + {__Pyx_NAMESTR("shuffle"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_shuffle, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_shuffle)}, + {__Pyx_NAMESTR("permutation"), (PyCFunction)__pyx_pf_6mtrand_11RandomState_permutation, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_permutation)}, {0, 0, 0, 0} }; @@ -15386,17 +20959,17 @@ static PyBufferProcs __pyx_tp_as_buffer_RandomState = { #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER) + #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER) + #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_6mtrand_RandomState = { PyVarObject_HEAD_INIT(0, 0) - "mtrand.RandomState", /*tp_name*/ + __Pyx_NAMESTR("mtrand.RandomState"), /*tp_name*/ sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/ @@ -15414,8 +20987,8 @@ PyTypeObject __pyx_type_6mtrand_RandomState = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "\n RandomState(seed=None)\n\n Container for the Mersenne Twister PRNG.\n\n `RandomState` exposes a number of methods for generating random numbers\n drawn from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n `size` that defaults to ``None``. If `size` is ``None``, then a single\n value is generated and returned. If `size` is an integer, then a 1-D\n numpy array filled with generated values is returned. If size is a tuple,\n then a numpy array with that shape is filled and returned.\n\n Parameters\n ----------\n seed : array_like, int, optional\n Random seed initializing the PRNG.\n Can be an integer, an array (or other sequence) of integers of\n any length, or ``None``.\n If `seed` is ``None``, then `RandomState` will try to read data from\n ``/dev/urandom`` (or the Windows analogue) if available or seed from\n the clock otherwise.\n\n ", /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + __Pyx_DOCSTR("\n RandomState(seed=None)\n\n Container for the Mersenne Twister PRNG.\n\n `RandomState` exposes a number of methods for generating random numbers\n drawn from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n `size` that defaults to ``None``. If `size` is ``None``, then a single\n value is generated and returned. If `size` is an integer, then a 1-D\n numpy array filled with generated values is returned. If size is a tuple,\n then a numpy array with that shape is filled and returned.\n\n Parameters\n ----------\n seed : array_like, int, optional\n Random seed initializing the PRNG.\n Can be an integer, an array (or other sequence) of integers of\n any length, or ``None``.\n If `seed` is ``None``, then `RandomState` will try to read data from\n ``/dev/urandom`` (or the Windows analogue) if available or seed from\n the clock otherwise.\n\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -15451,7 +21024,7 @@ static void __pyx_init_filenames(void); /*proto*/ #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, - "mtrand", + __Pyx_NAMESTR("mtrand"), 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, @@ -15463,58 +21036,89 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 0, 1, 1}, - {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 0, 1, 1}, - {&__pyx_kp_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 1, 1}, - {&__pyx_kp_get_state, __pyx_k_get_state, sizeof(__pyx_k_get_state), 0, 1, 1}, - {&__pyx_kp_set_state, __pyx_k_set_state, sizeof(__pyx_k_set_state), 0, 1, 1}, - {&__pyx_kp___getstate__, __pyx_k___getstate__, sizeof(__pyx_k___getstate__), 0, 1, 1}, - {&__pyx_kp___setstate__, __pyx_k___setstate__, sizeof(__pyx_k___setstate__), 0, 1, 1}, - {&__pyx_kp___reduce__, __pyx_k___reduce__, sizeof(__pyx_k___reduce__), 0, 1, 1}, - {&__pyx_kp_random_sample, __pyx_k_random_sample, sizeof(__pyx_k_random_sample), 0, 1, 1}, - {&__pyx_kp_tomaxint, __pyx_k_tomaxint, sizeof(__pyx_k_tomaxint), 0, 1, 1}, - {&__pyx_kp_randint, __pyx_k_randint, sizeof(__pyx_k_randint), 0, 1, 1}, - {&__pyx_kp_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 1, 1}, - {&__pyx_kp_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 1, 1}, - {&__pyx_kp_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 0, 1, 1}, - {&__pyx_kp_randn, __pyx_k_randn, sizeof(__pyx_k_randn), 0, 1, 1}, - {&__pyx_kp_random_integers, __pyx_k_random_integers, sizeof(__pyx_k_random_integers), 0, 1, 1}, - {&__pyx_kp_standard_normal, __pyx_k_standard_normal, sizeof(__pyx_k_standard_normal), 0, 1, 1}, - {&__pyx_kp_normal, __pyx_k_normal, sizeof(__pyx_k_normal), 0, 1, 1}, - {&__pyx_kp_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 1, 1}, - {&__pyx_kp_exponential, __pyx_k_exponential, sizeof(__pyx_k_exponential), 0, 1, 1}, - {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 1, 1}, - {&__pyx_kp_standard_gamma, __pyx_k_standard_gamma, sizeof(__pyx_k_standard_gamma), 0, 1, 1}, - {&__pyx_kp_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 1, 1}, - {&__pyx_kp_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 1, 1}, - {&__pyx_kp_noncentral_f, __pyx_k_noncentral_f, sizeof(__pyx_k_noncentral_f), 0, 1, 1}, - {&__pyx_kp_chisquare, __pyx_k_chisquare, sizeof(__pyx_k_chisquare), 0, 1, 1}, - {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 1, 1}, - {&__pyx_kp_standard_cauchy, __pyx_k_standard_cauchy, sizeof(__pyx_k_standard_cauchy), 0, 1, 1}, - {&__pyx_kp_standard_t, __pyx_k_standard_t, sizeof(__pyx_k_standard_t), 0, 1, 1}, - {&__pyx_kp_vonmises, __pyx_k_vonmises, sizeof(__pyx_k_vonmises), 0, 1, 1}, - {&__pyx_kp_pareto, __pyx_k_pareto, sizeof(__pyx_k_pareto), 0, 1, 1}, - {&__pyx_kp_weibull, __pyx_k_weibull, sizeof(__pyx_k_weibull), 0, 1, 1}, - {&__pyx_kp_power, __pyx_k_power, sizeof(__pyx_k_power), 0, 1, 1}, - {&__pyx_kp_laplace, __pyx_k_laplace, sizeof(__pyx_k_laplace), 0, 1, 1}, - {&__pyx_kp_gumbel, __pyx_k_gumbel, sizeof(__pyx_k_gumbel), 0, 1, 1}, - {&__pyx_kp_logistic, __pyx_k_logistic, sizeof(__pyx_k_logistic), 0, 1, 1}, - {&__pyx_kp_lognormal, __pyx_k_lognormal, sizeof(__pyx_k_lognormal), 0, 1, 1}, - {&__pyx_kp_rayleigh, __pyx_k_rayleigh, sizeof(__pyx_k_rayleigh), 0, 1, 1}, - {&__pyx_kp_wald, __pyx_k_wald, sizeof(__pyx_k_wald), 0, 1, 1}, - {&__pyx_kp_triangular, __pyx_k_triangular, sizeof(__pyx_k_triangular), 0, 1, 1}, - {&__pyx_kp_binomial, __pyx_k_binomial, sizeof(__pyx_k_binomial), 0, 1, 1}, - {&__pyx_kp_negative_binomial, __pyx_k_negative_binomial, sizeof(__pyx_k_negative_binomial), 0, 1, 1}, - {&__pyx_kp_poisson, __pyx_k_poisson, sizeof(__pyx_k_poisson), 0, 1, 1}, - {&__pyx_kp_zipf, __pyx_k_zipf, sizeof(__pyx_k_zipf), 0, 1, 1}, - {&__pyx_kp_geometric, __pyx_k_geometric, sizeof(__pyx_k_geometric), 0, 1, 1}, - {&__pyx_kp_hypergeometric, __pyx_k_hypergeometric, sizeof(__pyx_k_hypergeometric), 0, 1, 1}, - {&__pyx_kp_logseries, __pyx_k_logseries, sizeof(__pyx_k_logseries), 0, 1, 1}, - {&__pyx_kp_multivariate_normal, __pyx_k_multivariate_normal, sizeof(__pyx_k_multivariate_normal), 0, 1, 1}, - {&__pyx_kp_multinomial, __pyx_k_multinomial, sizeof(__pyx_k_multinomial), 0, 1, 1}, - {&__pyx_kp_dirichlet, __pyx_k_dirichlet, sizeof(__pyx_k_dirichlet), 0, 1, 1}, - {&__pyx_kp_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 1, 1}, - {&__pyx_kp_permutation, __pyx_k_permutation, sizeof(__pyx_k_permutation), 0, 1, 1}, + {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1}, + {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 1, 1, 1}, + {&__pyx_kp_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 1, 1, 1}, + {&__pyx_kp_get_state, __pyx_k_get_state, sizeof(__pyx_k_get_state), 1, 1, 1}, + {&__pyx_kp_set_state, __pyx_k_set_state, sizeof(__pyx_k_set_state), 1, 1, 1}, + {&__pyx_kp___getstate__, __pyx_k___getstate__, sizeof(__pyx_k___getstate__), 1, 1, 1}, + {&__pyx_kp___setstate__, __pyx_k___setstate__, sizeof(__pyx_k___setstate__), 1, 1, 1}, + {&__pyx_kp___reduce__, __pyx_k___reduce__, sizeof(__pyx_k___reduce__), 1, 1, 1}, + {&__pyx_kp_random_sample, __pyx_k_random_sample, sizeof(__pyx_k_random_sample), 1, 1, 1}, + {&__pyx_kp_tomaxint, __pyx_k_tomaxint, sizeof(__pyx_k_tomaxint), 1, 1, 1}, + {&__pyx_kp_randint, __pyx_k_randint, sizeof(__pyx_k_randint), 1, 1, 1}, + {&__pyx_kp_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 1, 1, 1}, + {&__pyx_kp_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 1, 1, 1}, + {&__pyx_kp_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 1, 1, 1}, + {&__pyx_kp_randn, __pyx_k_randn, sizeof(__pyx_k_randn), 1, 1, 1}, + {&__pyx_kp_random_integers, __pyx_k_random_integers, sizeof(__pyx_k_random_integers), 1, 1, 1}, + {&__pyx_kp_standard_normal, __pyx_k_standard_normal, sizeof(__pyx_k_standard_normal), 1, 1, 1}, + {&__pyx_kp_normal, __pyx_k_normal, sizeof(__pyx_k_normal), 1, 1, 1}, + {&__pyx_kp_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 1, 1, 1}, + {&__pyx_kp_exponential, __pyx_k_exponential, sizeof(__pyx_k_exponential), 1, 1, 1}, + {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 1, 1, 1}, + {&__pyx_kp_standard_gamma, __pyx_k_standard_gamma, sizeof(__pyx_k_standard_gamma), 1, 1, 1}, + {&__pyx_kp_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 1, 1, 1}, + {&__pyx_kp_f, __pyx_k_f, sizeof(__pyx_k_f), 1, 1, 1}, + {&__pyx_kp_noncentral_f, __pyx_k_noncentral_f, sizeof(__pyx_k_noncentral_f), 1, 1, 1}, + {&__pyx_kp_chisquare, __pyx_k_chisquare, sizeof(__pyx_k_chisquare), 1, 1, 1}, + {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 1, 1, 1}, + {&__pyx_kp_standard_cauchy, __pyx_k_standard_cauchy, sizeof(__pyx_k_standard_cauchy), 1, 1, 1}, + {&__pyx_kp_standard_t, __pyx_k_standard_t, sizeof(__pyx_k_standard_t), 1, 1, 1}, + {&__pyx_kp_vonmises, __pyx_k_vonmises, sizeof(__pyx_k_vonmises), 1, 1, 1}, + {&__pyx_kp_pareto, __pyx_k_pareto, sizeof(__pyx_k_pareto), 1, 1, 1}, + {&__pyx_kp_weibull, __pyx_k_weibull, sizeof(__pyx_k_weibull), 1, 1, 1}, + {&__pyx_kp_power, __pyx_k_power, sizeof(__pyx_k_power), 1, 1, 1}, + {&__pyx_kp_laplace, __pyx_k_laplace, sizeof(__pyx_k_laplace), 1, 1, 1}, + {&__pyx_kp_gumbel, __pyx_k_gumbel, sizeof(__pyx_k_gumbel), 1, 1, 1}, + {&__pyx_kp_logistic, __pyx_k_logistic, sizeof(__pyx_k_logistic), 1, 1, 1}, + {&__pyx_kp_lognormal, __pyx_k_lognormal, sizeof(__pyx_k_lognormal), 1, 1, 1}, + {&__pyx_kp_rayleigh, __pyx_k_rayleigh, sizeof(__pyx_k_rayleigh), 1, 1, 1}, + {&__pyx_kp_wald, __pyx_k_wald, sizeof(__pyx_k_wald), 1, 1, 1}, + {&__pyx_kp_triangular, __pyx_k_triangular, sizeof(__pyx_k_triangular), 1, 1, 1}, + {&__pyx_kp_binomial, __pyx_k_binomial, sizeof(__pyx_k_binomial), 1, 1, 1}, + {&__pyx_kp_negative_binomial, __pyx_k_negative_binomial, sizeof(__pyx_k_negative_binomial), 1, 1, 1}, + {&__pyx_kp_poisson, __pyx_k_poisson, sizeof(__pyx_k_poisson), 1, 1, 1}, + {&__pyx_kp_zipf, __pyx_k_zipf, sizeof(__pyx_k_zipf), 1, 1, 1}, + {&__pyx_kp_geometric, __pyx_k_geometric, sizeof(__pyx_k_geometric), 1, 1, 1}, + {&__pyx_kp_hypergeometric, __pyx_k_hypergeometric, sizeof(__pyx_k_hypergeometric), 1, 1, 1}, + {&__pyx_kp_logseries, __pyx_k_logseries, sizeof(__pyx_k_logseries), 1, 1, 1}, + {&__pyx_kp_multivariate_normal, __pyx_k_multivariate_normal, sizeof(__pyx_k_multivariate_normal), 1, 1, 1}, + {&__pyx_kp_multinomial, __pyx_k_multinomial, sizeof(__pyx_k_multinomial), 1, 1, 1}, + {&__pyx_kp_dirichlet, __pyx_k_dirichlet, sizeof(__pyx_k_dirichlet), 1, 1, 1}, + {&__pyx_kp_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 1, 1, 1}, + {&__pyx_kp_permutation, __pyx_k_permutation, sizeof(__pyx_k_permutation), 1, 1, 1}, + {&__pyx_kp_state, __pyx_k_state, sizeof(__pyx_k_state), 1, 1, 1}, + {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1}, + {&__pyx_kp_low, __pyx_k_low, sizeof(__pyx_k_low), 1, 1, 1}, + {&__pyx_kp_high, __pyx_k_high, sizeof(__pyx_k_high), 1, 1, 1}, + {&__pyx_kp_length, __pyx_k_length, sizeof(__pyx_k_length), 1, 1, 1}, + {&__pyx_kp_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 1, 1, 1}, + {&__pyx_kp_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 1, 1, 1}, + {&__pyx_kp_a, __pyx_k_a, sizeof(__pyx_k_a), 1, 1, 1}, + {&__pyx_kp_b, __pyx_k_b, sizeof(__pyx_k_b), 1, 1, 1}, + {&__pyx_kp_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 1, 1, 1}, + {&__pyx_kp_dfnum, __pyx_k_dfnum, sizeof(__pyx_k_dfnum), 1, 1, 1}, + {&__pyx_kp_dfden, __pyx_k_dfden, sizeof(__pyx_k_dfden), 1, 1, 1}, + {&__pyx_kp_nonc, __pyx_k_nonc, sizeof(__pyx_k_nonc), 1, 1, 1}, + {&__pyx_kp_df, __pyx_k_df, sizeof(__pyx_k_df), 1, 1, 1}, + {&__pyx_kp_mu, __pyx_k_mu, sizeof(__pyx_k_mu), 1, 1, 1}, + {&__pyx_kp_kappa, __pyx_k_kappa, sizeof(__pyx_k_kappa), 1, 1, 1}, + {&__pyx_kp_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 1, 1, 1}, + {&__pyx_kp_sigma, __pyx_k_sigma, sizeof(__pyx_k_sigma), 1, 1, 1}, + {&__pyx_kp_left, __pyx_k_left, sizeof(__pyx_k_left), 1, 1, 1}, + {&__pyx_kp_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 1, 1, 1}, + {&__pyx_kp_right, __pyx_k_right, sizeof(__pyx_k_right), 1, 1, 1}, + {&__pyx_kp_n, __pyx_k_n, sizeof(__pyx_k_n), 1, 1, 1}, + {&__pyx_kp_p, __pyx_k_p, sizeof(__pyx_k_p), 1, 1, 1}, + {&__pyx_kp_lam, __pyx_k_lam, sizeof(__pyx_k_lam), 1, 1, 1}, + {&__pyx_kp_ngood, __pyx_k_ngood, sizeof(__pyx_k_ngood), 1, 1, 1}, + {&__pyx_kp_nbad, __pyx_k_nbad, sizeof(__pyx_k_nbad), 1, 1, 1}, + {&__pyx_kp_nsample, __pyx_k_nsample, sizeof(__pyx_k_nsample), 1, 1, 1}, + {&__pyx_kp_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 1, 1, 1}, + {&__pyx_kp_pvals, __pyx_k_pvals, sizeof(__pyx_k_pvals), 1, 1, 1}, + {&__pyx_kp_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 1, 1, 1}, + {&__pyx_kp_x, __pyx_k_x, sizeof(__pyx_k_x), 1, 1, 1}, {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1}, {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, {&__pyx_kp__rand, __pyx_k__rand, sizeof(__pyx_k__rand), 1, 1, 1}, @@ -15531,7 +21135,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_random, __pyx_k_random, sizeof(__pyx_k_random), 1, 1, 1}, {&__pyx_kp___RandomState_ctor, __pyx_k___RandomState_ctor, sizeof(__pyx_k___RandomState_ctor), 1, 1, 1}, {&__pyx_kp_subtract, __pyx_k_subtract, sizeof(__pyx_k_subtract), 1, 1, 1}, - {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1}, {&__pyx_kp_any, __pyx_k_any, sizeof(__pyx_k_any), 1, 1, 1}, {&__pyx_kp_less_equal, __pyx_k_less_equal, sizeof(__pyx_k_less_equal), 1, 1, 1}, {&__pyx_kp_less, __pyx_k_less, sizeof(__pyx_k_less), 1, 1, 1}, @@ -15540,7 +21143,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_add, __pyx_k_add, sizeof(__pyx_k_add), 1, 1, 1}, {&__pyx_kp_greater_equal, __pyx_k_greater_equal, sizeof(__pyx_k_greater_equal), 1, 1, 1}, {&__pyx_kp_array, __pyx_k_array, sizeof(__pyx_k_array), 1, 1, 1}, - {&__pyx_kp_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 1, 1, 1}, {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1}, {&__pyx_kp_multiply, __pyx_k_multiply, sizeof(__pyx_k_multiply), 1, 1, 1}, {&__pyx_kp_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 1, 1, 1}, @@ -15687,31 +21289,26 @@ PyMODINIT_FUNC PyInit_mtrand(void) #endif { PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; - PyObject *__pyx_7 = 0; - PyObject *__pyx_8 = 0; - PyObject *__pyx_9 = 0; - PyObject *__pyx_10 = 0; - PyObject *__pyx_11 = 0; - PyObject *__pyx_12 = 0; - PyObject *__pyx_13 = 0; - PyObject *__pyx_14 = 0; - PyObject *__pyx_15 = 0; - PyObject *__pyx_16 = 0; - PyObject *__pyx_17 = 0; - PyObject *__pyx_18 = 0; + PyObject *__pyx_t_1 = NULL; + #ifdef CYTHON_REFNANNY + void* __pyx_refchk = NULL; + __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny"); + if (!__Pyx_Refnanny) { + PyErr_Clear(); + __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny"); + if (!__Pyx_Refnanny) + Py_FatalError("failed to import refnanny module"); + } + __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_mtrand(void)", __LINE__, __FILE__); + #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Libary function declarations ---*/ + /*--- Library function declarations ---*/ __pyx_init_filenames(); /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("mtrand", __pyx_methods, 0, 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("mtrand"), __pyx_methods, 0, 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -15719,9 +21316,9 @@ PyMODINIT_FUNC PyInit_mtrand(void) #if PY_MAJOR_VERSION < 3 Py_INCREF(__pyx_m); #endif - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_skip_dispatch = 0; @@ -15733,7 +21330,7 @@ PyMODINIT_FUNC PyInit_mtrand(void) __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_6mtrand_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_6mtrand_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; /*--- Type import code ---*/ /*--- Function import code ---*/ @@ -15756,8 +21353,9 @@ PyMODINIT_FUNC PyInit_mtrand(void) * cdef object cont0_array(rk_state *state, rk_cont0 func, object size): */ __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":790 * return bytestring @@ -15766,12 +21364,20 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * uniform(low=0.0, high=1.0, size=1) */ - __pyx_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_3 = __pyx_1; - __pyx_1 = 0; - __pyx_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_4 = __pyx_2; - __pyx_2 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_3 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_3); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_4 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_4); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":974 * return cont0_array(self.internal_state, rk_gauss, size) @@ -15780,12 +21386,20 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * normal(loc=0.0, scale=1.0, size=None) */ - __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_5 = __pyx_3; - __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_6 = __pyx_4; - __pyx_4 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_5 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_5); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_6 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_6); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1133 * return cont2_array(self.internal_state, rk_beta, size, oa, ob) @@ -15794,9 +21408,13 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * exponential(scale=1.0, size=None) */ - __pyx_5 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_7 = __pyx_5; - __pyx_5 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_7 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_7); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1218 * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) @@ -15805,9 +21423,13 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * gamma(shape, scale=1.0, size=None) */ - __pyx_6 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_8 = __pyx_6; - __pyx_6 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_8 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_8); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1910 * return cont1_array(self.internal_state, rk_power, size, oa) @@ -15816,12 +21438,20 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * laplace(loc=0.0, scale=1.0, size=None) */ - __pyx_7 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_9 = __pyx_7; - __pyx_7 = 0; - __pyx_8 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_10 = __pyx_8; - __pyx_8 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_9 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_9); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_10 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_10); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1949 * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) @@ -15830,12 +21460,20 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * gumbel(loc=0.0, scale=1.0, size=None) */ - __pyx_9 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_11 = __pyx_9; - __pyx_9 = 0; - __pyx_10 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_12 = __pyx_10; - __pyx_10 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_11 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_11); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_12 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_12); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2073 * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) @@ -15844,12 +21482,20 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * logistic(loc=0.0, scale=1.0, size=None) */ - __pyx_11 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_13 = __pyx_11; - __pyx_11 = 0; - __pyx_12 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_14 = __pyx_12; - __pyx_12 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_13 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_13); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_14 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_14); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2161 * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) @@ -15858,12 +21504,20 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * lognormal(mean=0.0, sigma=1.0, size=None) */ - __pyx_13 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_15 = __pyx_13; - __pyx_13 = 0; - __pyx_14 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_16 = __pyx_14; - __pyx_14 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_15 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_15); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_16 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_16); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2292 * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) @@ -15872,9 +21526,13 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * rayleigh(scale=1.0, size=None) */ - __pyx_15 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_17 = __pyx_15; - __pyx_15 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_17 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_17); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2530 * on, op) @@ -15883,9 +21541,13 @@ PyMODINIT_FUNC PyInit_mtrand(void) * """ * poisson(lam=1.0, size=None) */ - __pyx_16 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_18 = __pyx_16; - __pyx_16 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_18 = __pyx_t_1; + __pyx_t_1 = 0; + /* __pyx_t_1 released */ + __Pyx_GIVEREF(__pyx_k_18); /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3314 * return arr @@ -15894,9 +21556,12 @@ PyMODINIT_FUNC PyInit_mtrand(void) * seed = _rand.seed * get_state = _rand.get_state */ - __pyx_17 = PyObject_Call(((PyObject*)__pyx_ptype_6mtrand_RandomState), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_m, __pyx_kp__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6mtrand_RandomState)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetAttr(__pyx_m, __pyx_kp__rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3315 * @@ -15905,11 +21570,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * get_state = _rand.get_state * set_state = _rand.set_state */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_seed); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_seed, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3316 * _rand = RandomState() @@ -15918,11 +21587,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * set_state = _rand.set_state * random_sample = _rand.random_sample */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_get_state); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_get_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3317 * seed = _rand.seed @@ -15931,11 +21604,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * random_sample = _rand.random_sample * randint = _rand.randint */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_set_state); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_set_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_set_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3318 * get_state = _rand.get_state @@ -15944,11 +21621,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * randint = _rand.randint * bytes = _rand.bytes */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_random_sample); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_random_sample); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_random_sample, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3319 * set_state = _rand.set_state @@ -15957,11 +21638,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * bytes = _rand.bytes * uniform = _rand.uniform */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_randint); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_randint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_randint, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3320 * random_sample = _rand.random_sample @@ -15970,11 +21655,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * uniform = _rand.uniform * rand = _rand.rand */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_bytes); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3321 * randint = _rand.randint @@ -15983,11 +21672,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * rand = _rand.rand * randn = _rand.randn */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_uniform); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_uniform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_uniform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3322 * bytes = _rand.bytes @@ -15996,11 +21689,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * randn = _rand.randn * random_integers = _rand.random_integers */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_rand); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3323 * uniform = _rand.uniform @@ -16009,11 +21706,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * random_integers = _rand.random_integers * standard_normal = _rand.standard_normal */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_randn); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_randn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_randn, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3324 * rand = _rand.rand @@ -16022,11 +21723,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * standard_normal = _rand.standard_normal * normal = _rand.normal */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_random_integers); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_random_integers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_random_integers, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3325 * randn = _rand.randn @@ -16035,11 +21740,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * normal = _rand.normal * beta = _rand.beta */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_standard_normal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3326 * random_integers = _rand.random_integers @@ -16048,11 +21757,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * beta = _rand.beta * exponential = _rand.exponential */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_normal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3327 * standard_normal = _rand.standard_normal @@ -16061,11 +21774,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * exponential = _rand.exponential * standard_exponential = _rand.standard_exponential */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_beta); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_beta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_beta, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3328 * normal = _rand.normal @@ -16074,11 +21791,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * standard_exponential = _rand.standard_exponential * standard_gamma = _rand.standard_gamma */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_exponential); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_exponential); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_exponential, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3329 * beta = _rand.beta @@ -16087,11 +21808,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * standard_gamma = _rand.standard_gamma * gamma = _rand.gamma */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_1); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_1, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3330 * exponential = _rand.exponential @@ -16100,11 +21825,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * gamma = _rand.gamma * f = _rand.f */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_standard_gamma); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_gamma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_gamma, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3331 * standard_exponential = _rand.standard_exponential @@ -16113,11 +21842,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * f = _rand.f * noncentral_f = _rand.noncentral_f */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_gamma); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_gamma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_gamma, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3332 * standard_gamma = _rand.standard_gamma @@ -16126,11 +21859,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * noncentral_f = _rand.noncentral_f * chisquare = _rand.chisquare */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_f); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3333 * gamma = _rand.gamma @@ -16139,11 +21876,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * chisquare = _rand.chisquare * noncentral_chisquare = _rand.noncentral_chisquare */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_noncentral_f); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_noncentral_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_noncentral_f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3334 * f = _rand.f @@ -16152,11 +21893,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * noncentral_chisquare = _rand.noncentral_chisquare * standard_cauchy = _rand.standard_cauchy */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_chisquare); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_chisquare); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_chisquare, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3335 * noncentral_f = _rand.noncentral_f @@ -16165,11 +21910,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * standard_cauchy = _rand.standard_cauchy * standard_t = _rand.standard_t */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_2); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_2, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3336 * chisquare = _rand.chisquare @@ -16178,11 +21927,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * standard_t = _rand.standard_t * vonmises = _rand.vonmises */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_standard_cauchy); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_cauchy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_cauchy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3337 * noncentral_chisquare = _rand.noncentral_chisquare @@ -16191,11 +21944,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * vonmises = _rand.vonmises * pareto = _rand.pareto */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_standard_t); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_t, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3338 * standard_cauchy = _rand.standard_cauchy @@ -16204,11 +21961,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * pareto = _rand.pareto * weibull = _rand.weibull */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_vonmises); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_vonmises); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_vonmises, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3339 * standard_t = _rand.standard_t @@ -16217,11 +21978,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * weibull = _rand.weibull * power = _rand.power */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_pareto); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_pareto); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_pareto, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3340 * vonmises = _rand.vonmises @@ -16230,11 +21995,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * power = _rand.power * laplace = _rand.laplace */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_weibull); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_weibull); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_weibull, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3341 * pareto = _rand.pareto @@ -16243,11 +22012,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * laplace = _rand.laplace * gumbel = _rand.gumbel */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_power); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_power); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_power, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3342 * weibull = _rand.weibull @@ -16256,11 +22029,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * gumbel = _rand.gumbel * logistic = _rand.logistic */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_laplace); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_laplace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_laplace, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3343 * power = _rand.power @@ -16269,11 +22046,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * logistic = _rand.logistic * lognormal = _rand.lognormal */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_gumbel); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_gumbel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_gumbel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3344 * laplace = _rand.laplace @@ -16282,11 +22063,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * lognormal = _rand.lognormal * rayleigh = _rand.rayleigh */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_logistic); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_logistic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_logistic, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3345 * gumbel = _rand.gumbel @@ -16295,11 +22080,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * rayleigh = _rand.rayleigh * wald = _rand.wald */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_lognormal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_lognormal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_lognormal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3346 * logistic = _rand.logistic @@ -16308,11 +22097,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * wald = _rand.wald * triangular = _rand.triangular */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_rayleigh); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_rayleigh); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_rayleigh, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3347 * lognormal = _rand.lognormal @@ -16321,11 +22114,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * triangular = _rand.triangular * */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_wald); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_wald); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_wald, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3348 * rayleigh = _rand.rayleigh @@ -16334,11 +22131,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * * binomial = _rand.binomial */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_triangular); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_triangular); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_triangular, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3350 * triangular = _rand.triangular @@ -16347,11 +22148,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * negative_binomial = _rand.negative_binomial * poisson = _rand.poisson */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_binomial); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_binomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_binomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3351 * @@ -16360,11 +22165,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * poisson = _rand.poisson * zipf = _rand.zipf */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_negative_binomial); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_negative_binomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_negative_binomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3352 * binomial = _rand.binomial @@ -16373,11 +22182,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * zipf = _rand.zipf * geometric = _rand.geometric */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_poisson); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_poisson); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_poisson, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3353 * negative_binomial = _rand.negative_binomial @@ -16386,11 +22199,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * geometric = _rand.geometric * hypergeometric = _rand.hypergeometric */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_zipf); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_zipf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_zipf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3354 * poisson = _rand.poisson @@ -16399,11 +22216,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * hypergeometric = _rand.hypergeometric * logseries = _rand.logseries */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_geometric); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_geometric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_geometric, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3355 * zipf = _rand.zipf @@ -16412,11 +22233,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * logseries = _rand.logseries * */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_hypergeometric); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_hypergeometric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_hypergeometric, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3356 * geometric = _rand.geometric @@ -16425,11 +22250,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * * multivariate_normal = _rand.multivariate_normal */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_logseries); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_logseries); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_logseries, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3358 * logseries = _rand.logseries @@ -16438,11 +22267,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * multinomial = _rand.multinomial * dirichlet = _rand.dirichlet */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_multivariate_normal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_multivariate_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_multivariate_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3359 * @@ -16451,11 +22284,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * dirichlet = _rand.dirichlet * */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_multinomial); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_multinomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_multinomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3360 * multivariate_normal = _rand.multivariate_normal @@ -16464,11 +22301,15 @@ PyMODINIT_FUNC PyInit_mtrand(void) * * shuffle = _rand.shuffle */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_dirichlet); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_dirichlet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_dirichlet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3362 * dirichlet = _rand.dirichlet @@ -16476,50 +22317,48 @@ PyMODINIT_FUNC PyInit_mtrand(void) * shuffle = _rand.shuffle # <<<<<<<<<<<<<< * permutation = _rand.permutation */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_shuffle); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_shuffle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_shuffle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3363 * * shuffle = _rand.shuffle * permutation = _rand.permutation # <<<<<<<<<<<<<< */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_kp_permutation); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_18); __pyx_18 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_1); + /* __pyx_t_1 allocated */ + __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_permutation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_kp_permutation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* __pyx_t_1 released */ + + /* "/usr/lib/python2.5/site-packages/Cython/Includes/python_object.pxd":1 + * cdef extern from "Python.h": # <<<<<<<<<<<<<< + * ctypedef void PyObject + * ctypedef void PyTypeObject + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_1); + __Pyx_AddTraceback("mtrand"); + Py_DECREF(__pyx_m); __pyx_m = 0; + __pyx_L0:; + __Pyx_FinishRefcountContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); - Py_XDECREF(__pyx_7); - Py_XDECREF(__pyx_8); - Py_XDECREF(__pyx_9); - Py_XDECREF(__pyx_10); - Py_XDECREF(__pyx_11); - Py_XDECREF(__pyx_12); - Py_XDECREF(__pyx_13); - Py_XDECREF(__pyx_14); - Py_XDECREF(__pyx_15); - Py_XDECREF(__pyx_16); - Py_XDECREF(__pyx_17); - Py_XDECREF(__pyx_18); - __Pyx_AddTraceback("mtrand"); - #if PY_MAJOR_VERSION >= 3 - return NULL; - #endif } static const char *__pyx_filenames[] = { @@ -16533,40 +22372,130 @@ static void __pyx_init_filenames(void) { __pyx_f = __pyx_filenames; } -static INLINE void __Pyx_RaiseArgtupleTooLong( - Py_ssize_t num_expected, - Py_ssize_t num_found) +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) { - const char* error_message = - #if PY_VERSION_HEX < 0x02050000 - "function takes at most %d positional arguments (%d given)"; - #else - "function takes at most %zd positional arguments (%zd given)"; - #endif - PyErr_Format(PyExc_TypeError, error_message, num_expected, num_found); + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AS_STRING(kw_name)); + #endif } -static INLINE int __Pyx_SplitStarArg( - PyObject **args, - Py_ssize_t nargs, - PyObject **args2) +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) { - PyObject *args1 = 0; - args1 = PyTuple_GetSlice(*args, 0, nargs); - if (!args1) { - *args2 = 0; - return -1; + Py_ssize_t num_expected; + const char *number, *more_or_less; + + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; } - *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args)); - if (!*args2) { - Py_DECREF(args1); - return -1; + if (exact) { + more_or_less = "exactly"; + } + number = (num_expected == 1) ? "" : "s"; + PyErr_Format(PyExc_TypeError, + #if PY_VERSION_HEX < 0x02050000 + "%s() takes %s %d positional argument%s (%d given)", + #else + "%s() takes %s %zd positional argument%s (%zd given)", + #endif + func_name, more_or_less, num_expected, number, num_found); +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + } else { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { + #else + if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { + #endif + goto invalid_keyword_type; + } else { + for (name = first_kw_arg; *name; name++) { + #if PY_MAJOR_VERSION >= 3 + if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && + PyUnicode_Compare(**name, key) == 0) break; + #else + if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && + _PyString_Eq(**name, key)) break; + #endif + } + if (*name) { + values[name-argnames] = value; + } else { + /* unexpected keyword found */ + for (name=argnames; name != first_kw_arg; name++) { + if (**name == key) goto arg_passed_twice; + #if PY_MAJOR_VERSION >= 3 + if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && + PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; + #else + if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && + _PyString_Eq(**name, key)) goto arg_passed_twice; + #endif + } + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + } + } } - *args = args1; return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, **name); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%s() got an unexpected keyword argument '%s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; } -static int __Pyx_CheckKeywordStrings( + +static INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) @@ -16575,27 +22504,66 @@ static int __Pyx_CheckKeywordStrings( Py_ssize_t pos = 0; while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_Check(key))) { + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #else - if (unlikely(!PyUnicode_Check(key))) { + if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) #endif - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - return 0; - } + goto invalid_keyword_type; } - if (unlikely(!kw_allowed) && unlikely(key)) { - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "'%s' is an invalid keyword argument for this function", - PyString_AsString(key)); - #else - "'%U' is an invalid keyword argument for this function", - key); - #endif + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%s() keywords must be strings", function_name); + return 0; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%s() got an unexpected keyword argument '%s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } - return 1; + if (obj == Py_None || PyObject_TypeCheck(obj, type)) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + + +static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} + +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { @@ -16605,7 +22573,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); if (!__import__) goto bad; if (from_list) @@ -16622,8 +22590,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunction(__import__, "OOOO", - name, global_dict, empty_dict, list); + module = PyObject_CallFunctionObjArgs(__import__, + name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); Py_XDECREF(__import__); @@ -16694,7 +22662,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { } #endif } - PyErr_Restore(type, value, tb); + __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -16703,6 +22671,49 @@ raise_error: return; } +static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + +#if PY_MAJOR_VERSION >= 3 + /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */ + if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) { + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + PyErr_NormalizeException(&type, &value, &tb); + PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb); + tstate->exc_type = 0; + tstate->exc_value = 0; + tstate->exc_traceback = 0; + PyException_SetContext(value, tmp_value); + Py_DECREF(tmp_type); + Py_XDECREF(tmp_tb); + } +#endif + + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} + +static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} + static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { PyObject *item; @@ -16734,8 +22745,8 @@ static int __Pyx_EndUnpack(PyObject *iter) { static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_Get(); - PyErr_Fetch(type, value, tb); + PyThreadState *tstate = PyThreadState_GET(); + __Pyx_ErrFetch(type, value, tb); PyErr_NormalizeException(type, value, tb); if (PyErr_Occurred()) goto bad; @@ -16762,40 +22773,35 @@ bad: } -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; +static INLINE int __Pyx_StrEq(const char *s1, const char *s2) { + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + return *s1 == *s2; } - #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(module_name); + py_name = PyString_FromString(class_name); #else - py_name = PyUnicode_FromString(module_name); + py_name = PyUnicode_FromString(class_name); #endif if (!py_name) goto bad; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - result = PyObject_GetAttrString(py_module, class_name); + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { @@ -16812,7 +22818,7 @@ static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, } return (PyTypeObject *)result; bad: - Py_XDECREF(py_name); + Py_XDECREF(py_module); Py_XDECREF(result); return 0; } @@ -16820,7 +22826,7 @@ bad: #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(char *name) { +static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; @@ -16902,7 +22908,7 @@ static void __Pyx_AddTraceback(const char *funcname) { ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_Get(), /*PyThreadState *tstate,*/ + PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -16955,44 +22961,85 @@ static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { return ival; } +static INLINE PyObject * __pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + +static INLINE size_t __pyx_PyInt_AsSize_t(PyObject* b) { + unsigned PY_LONG_LONG val = __pyx_PyInt_AsUnsignedLongLong(b); + if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { + return (size_t)-1; + } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { + PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); + return (size_t)-1; + } + return val; +} + static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { if (x == Py_True) return 1; - else if (x == Py_False) return 0; + else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) { +#if PY_VERSION_HEX < 0x03000000 if (PyInt_CheckExact(x)) { return PyInt_AS_LONG(x); } - else if (PyLong_CheckExact(x)) { + else +#endif + if (PyLong_CheckExact(x)) { return PyLong_AsLongLong(x); } else { PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; +#if PY_VERSION_HEX < 0x03000000 + PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; val = __pyx_PyInt_AsLongLong(tmp); +#else + PyObject* tmp = PyNumber_Long(x); if (!tmp) return (PY_LONG_LONG)-1; + val = PyLong_AsLongLong(tmp); +#endif Py_DECREF(tmp); return val; } } static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) { +#if PY_VERSION_HEX < 0x03000000 if (PyInt_CheckExact(x)) { long val = PyInt_AS_LONG(x); if (unlikely(val < 0)) { - PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type."); + PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long long"); return (unsigned PY_LONG_LONG)-1; } return val; } - else if (PyLong_CheckExact(x)) { + else +#endif + if (PyLong_CheckExact(x)) { return PyLong_AsUnsignedLongLong(x); } else { - PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; + unsigned PY_LONG_LONG val; +#if PY_VERSION_HEX < 0x03000000 + PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; val = __pyx_PyInt_AsUnsignedLongLong(tmp); +#else + PyObject* tmp = PyNumber_Long(x); if (!tmp) return (PY_LONG_LONG)-1; + val = PyLong_AsUnsignedLongLong(tmp); +#endif Py_DECREF(tmp); return val; } |