summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/random/mtrand/mtrand.c15535
1 files changed, 4594 insertions, 10941 deletions
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c
index adc03c862..480fbad9b 100644
--- a/numpy/random/mtrand/mtrand.c
+++ b/numpy/random/mtrand/mtrand.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.6.13.1 on Mon May 19 23:33:35 2008 */
+/* Generated by Pyrex 0.9.8.2 on Tue May 20 00:56:24 2008 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -11,18 +11,15 @@
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
- #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
- #define PyNumber_Index(o) PyNumber_Int(o)
- #define PyIndex_Check(o) PyNumber_Check(o)
+ #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#endif
-#if PY_VERSION_HEX < 0x02040000
- #define METH_COEXIST 0
-#endif
-#ifndef __stdcall
- #define __stdcall
-#endif
-#ifndef __cdecl
- #define __cdecl
+#ifndef WIN32
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
@@ -38,72 +35,16 @@
#include "initarray.h"
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE
-#endif
-
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
-typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
-
-
-
-static int __pyx_skip_dispatch = 0;
-
-
-/* Type Conversion Predeclarations */
-
-#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);
-static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b);
-
-#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))
-
-static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x);
-static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x);
-static INLINE char __pyx_PyInt_char(PyObject* x);
-static INLINE short __pyx_PyInt_short(PyObject* x);
-static INLINE int __pyx_PyInt_int(PyObject* x);
-static INLINE long __pyx_PyInt_long(PyObject* x);
-static INLINE signed char __pyx_PyInt_signed_char(PyObject* x);
-static INLINE signed short __pyx_PyInt_signed_short(PyObject* x);
-static INLINE signed int __pyx_PyInt_signed_int(PyObject* x);
-static INLINE signed long __pyx_PyInt_signed_long(PyObject* x);
-static INLINE long double __pyx_PyInt_long_double(PyObject* x);
-#ifdef __GNUC__
-/* Test for GCC > 2.95 */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-#define likely(x) __builtin_expect(!!(x), 1)
-#define unlikely(x) __builtin_expect(!!(x), 0)
-#else /* __GNUC__ > 2 ... */
-#define likely(x) (x)
-#define unlikely(x) (x)
-#endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
-#define likely(x) (x)
-#define unlikely(x) (x)
-#endif /* __GNUC__ */
-
+typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
+
static PyObject *__pyx_m;
static PyObject *__pyx_b;
-static PyObject *__pyx_empty_tuple;
static int __pyx_lineno;
-static int __pyx_clineno = 0;
-static char * __pyx_cfilenm= __FILE__;
static char *__pyx_filename;
static char **__pyx_f;
-static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/
-
-static INLINE int __Pyx_SplitStarArg(PyObject **args, Py_ssize_t nargs, PyObject **args2); /*proto*/
-
-static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
@@ -111,13 +52,17 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
+static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/
+
+static PyObject *__Pyx_UnpackItem(PyObject *); /*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 int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v); /*proto*/
+
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
@@ -128,34 +73,23 @@ static PyObject *__Pyx_ImportModule(char *name); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
-/* Declarations from numpy */
-
-
/* Declarations from mtrand */
typedef double (*__pyx_t_6mtrand_rk_cont0)(rk_state *);
-typedef double (*__pyx_t_6mtrand_rk_cont1)(rk_state *, double);
+typedef double (*__pyx_t_6mtrand_rk_cont1)(rk_state *,double);
-typedef double (*__pyx_t_6mtrand_rk_cont2)(rk_state *, double, double);
+typedef double (*__pyx_t_6mtrand_rk_cont2)(rk_state *,double,double);
-typedef double (*__pyx_t_6mtrand_rk_cont3)(rk_state *, double, double, double);
+typedef double (*__pyx_t_6mtrand_rk_cont3)(rk_state *,double,double,double);
typedef long (*__pyx_t_6mtrand_rk_disc0)(rk_state *);
-typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *, long, double);
-
-typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *, long, long, long);
+typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *,long,double);
-typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *, double);
+typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *,long,long,long);
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":469
- * return sum
- *
- * cdef class RandomState: # <<<<<<<<<<<<<<
- * """Container for the Mersenne Twister PRNG.
- *
- */
+typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *,double);
struct __pyx_obj_6mtrand_RandomState {
PyObject_HEAD
@@ -168,52 +102,92 @@ 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_2;
-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_f_6mtrand_cont0_array(rk_state *, __pyx_t_6mtrand_rk_cont0, PyObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *, __pyx_t_6mtrand_rk_cont1, PyObject *, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *, __pyx_t_6mtrand_rk_cont1, PyObject *, PyArrayObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *, __pyx_t_6mtrand_rk_cont2, PyObject *, double, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *, __pyx_t_6mtrand_rk_cont2, PyObject *, PyArrayObject *, PyArrayObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *, __pyx_t_6mtrand_rk_cont3, PyObject *, double, double, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *, __pyx_t_6mtrand_rk_cont3, PyObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *, __pyx_t_6mtrand_rk_disc0, PyObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *, __pyx_t_6mtrand_rk_discnp, PyObject *, long, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *, __pyx_t_6mtrand_rk_discnp, PyObject *, PyArrayObject *, PyArrayObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *, __pyx_t_6mtrand_rk_discnmN, PyObject *, long, long, long); /*proto*/
-static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *, __pyx_t_6mtrand_rk_discnmN, PyObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *, __pyx_t_6mtrand_rk_discd, PyObject *, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_discd_array(rk_state *, __pyx_t_6mtrand_rk_discd, PyObject *, PyArrayObject *); /*proto*/
-static double __pyx_f_6mtrand_kahan_sum(double *, long); /*proto*/
+static PyObject *__pyx_k2;
+static PyObject *__pyx_k3;
+static PyObject *__pyx_k4;
+static PyObject *__pyx_k5;
+static PyObject *__pyx_k6;
+static PyObject *__pyx_k7;
+static PyObject *__pyx_k8;
+static PyObject *__pyx_k9;
+static PyObject *__pyx_k10;
+static PyObject *__pyx_k11;
+static PyObject *__pyx_k12;
+static PyObject *__pyx_k13;
+static PyObject *__pyx_k14;
+static PyObject *__pyx_k15;
+static PyObject *__pyx_k16;
+static PyObject *__pyx_k17;
+static PyObject *__pyx_k18;
+static PyObject *__pyx_k19;
+static PyObject *__pyx_k20;
+static PyObject *__pyx_k21;
+static PyObject *__pyx_k22;
+static PyObject *__pyx_k23;
+static PyObject *__pyx_k24;
+static PyObject *__pyx_k25;
+static PyObject *__pyx_k26;
+static PyObject *__pyx_k27;
+static PyObject *__pyx_k28;
+static PyObject *__pyx_k29;
+static PyObject *__pyx_k30;
+static PyObject *__pyx_k31;
+static PyObject *__pyx_k32;
+static PyObject *__pyx_k33;
+static PyObject *__pyx_k34;
+static PyObject *__pyx_k35;
+static PyObject *__pyx_k36;
+static PyObject *__pyx_k37;
+static PyObject *__pyx_k38;
+static PyObject *__pyx_k39;
+static PyObject *__pyx_k40;
+static PyObject *__pyx_k41;
+static PyObject *__pyx_k42;
+static PyObject *__pyx_k43;
+static PyObject *__pyx_k44;
+static PyObject *__pyx_k45;
+static PyObject *__pyx_k46;
+static PyObject *__pyx_k47;
+static PyObject *__pyx_k48;
+static PyObject *__pyx_k49;
+static PyObject *__pyx_k50;
+static PyObject *__pyx_k51;
+static PyObject *__pyx_k52;
+static PyObject *__pyx_k53;
+static PyObject *__pyx_k54;
+static PyObject *__pyx_k55;
+static PyObject *__pyx_k56;
+static PyObject *__pyx_k57;
+static PyObject *__pyx_k58;
+static PyObject *__pyx_k59;
+static PyObject *__pyx_k60;
+static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *,__pyx_t_6mtrand_rk_cont0,PyObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *,__pyx_t_6mtrand_rk_cont1,PyObject *,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *,__pyx_t_6mtrand_rk_cont1,PyObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *,__pyx_t_6mtrand_rk_cont2,PyObject *,double,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *,__pyx_t_6mtrand_rk_cont2,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *,__pyx_t_6mtrand_rk_cont3,PyObject *,double,double,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *,__pyx_t_6mtrand_rk_cont3,PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *,__pyx_t_6mtrand_rk_disc0,PyObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,long,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,long,long,long); /*proto*/
+static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *); /*proto*/
+static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *,__pyx_t_6mtrand_rk_discd,PyObject *,double); /*proto*/
+static PyObject *__pyx_f_6mtrand_discd_array(rk_state *,__pyx_t_6mtrand_rk_discd,PyObject *,PyArrayObject *); /*proto*/
+static double __pyx_f_6mtrand_kahan_sum(double *,long); /*proto*/
/* Implementation of mtrand */
-static PyObject *__pyx_n___init__;
-static PyObject *__pyx_n___dealloc__;
+static PyObject *__pyx_n_numpy;
+static PyObject *__pyx_n__sp;
+static PyObject *__pyx_n__rand;
static PyObject *__pyx_n_seed;
static PyObject *__pyx_n_get_state;
static PyObject *__pyx_n_set_state;
-static PyObject *__pyx_n___getstate__;
-static PyObject *__pyx_n___setstate__;
-static PyObject *__pyx_n___reduce__;
static PyObject *__pyx_n_random_sample;
-static PyObject *__pyx_n_tomaxint;
static PyObject *__pyx_n_randint;
static PyObject *__pyx_n_bytes;
static PyObject *__pyx_n_uniform;
@@ -256,22 +230,11 @@ static PyObject *__pyx_n_multinomial;
static PyObject *__pyx_n_dirichlet;
static PyObject *__pyx_n_shuffle;
static PyObject *__pyx_n_permutation;
-static PyObject *__pyx_n_numpy;
-static PyObject *__pyx_n__sp;
-static PyObject *__pyx_n__rand;
-
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":124
- * import numpy as _sp
- *
- * cdef object cont0_array(rk_state *state, rk_cont0 func, object size): # <<<<<<<<<<<<<<
- * cdef double *array_data
- * cdef ndarray array "arrayObject"
- */
static PyObject *__pyx_n_empty;
static PyObject *__pyx_n_float64;
-static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont0 __pyx_v_func, PyObject *__pyx_v_size) {
+static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont0 __pyx_v_func,PyObject *__pyx_v_size) {
double *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -281,26 +244,13 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":130
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":130 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":131
- *
- * if size is None:
- * return func(state) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- */
- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -308,25 +258,19 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":133
- * return func(state)
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":133 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -334,50 +278,18 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":134
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":134 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":135
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":135 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":136
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":137
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state) # <<<<<<<<<<<<<<
- * return array
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":136 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":138
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- * return array # <<<<<<<<<<<<<<
- *
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":138 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -394,18 +306,11 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":141
- *
- *
- * cdef object cont1_array_sc(rk_state *state, rk_cont1 func, object size, double a): # <<<<<<<<<<<<<<
- * cdef double *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont1 __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a) {
+static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont1 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a) {
double *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -415,26 +320,13 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":147
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":147 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":148
- *
- * if size is None:
- * return func(state, a) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, _sp.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 = 148; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -442,25 +334,19 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":150
- * return func(state, a)
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":150 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -468,50 +354,18 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":151
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":151 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":152
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":152 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":153
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":154
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":153 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":155
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":155 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -528,26 +382,15 @@ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":157
- * return array
- *
- * cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa): # <<<<<<<<<<<<<<
- * cdef double *array_data
- * cdef double *oa_data
- */
-
-static PyObject *__pyx_n_ValueError;
-
-static PyObject *__pyx_k_18p;
-
-static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_k61p;
-static char __pyx_k_18[] = "size is not compatible with inputs";
+static char __pyx_k61[] = "size is not compatible with inputs";
-static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont1 __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_oa) {
+static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont1 __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa) {
double *__pyx_v_array_data;
double *__pyx_v_oa_data;
PyArrayObject *arrayObject;
@@ -561,114 +404,62 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
npy_intp __pyx_5;
+ Py_INCREF(__pyx_v_size);
+ Py_INCREF(__pyx_v_oa);
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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":166
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE)
- * length = PyArray_SIZE(array)
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":166 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":167
- *
- * if size is None:
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<<
- * 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 = 167; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":167 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":168
- * if size is None:
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":168 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":169
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE)
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":169 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":170
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- * itera = <flatiter>PyArray_IterNew(<object>oa) # <<<<<<<<<<<<<<
- * 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 = 170; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":170 */
+ __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_itera));
__pyx_v_itera = ((PyArrayIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":171
- * array_data = <double *>array.data
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera)
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":172
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0]) # <<<<<<<<<<<<<<
- * PyArray_ITER_NEXT(itera)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (((double *)__pyx_v_itera->dataptr)[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":173
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":171 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":172 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":173 */
PyArray_ITER_NEXT(__pyx_v_itera);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":175
- * PyArray_ITER_NEXT(itera)
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":175 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -676,104 +467,48 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":176
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- * <void *>oa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":176 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":178
- * array_data = <double *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- * <void *>oa) # <<<<<<<<<<<<<<
- * 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 = 177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":177 */
+ __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":179
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- * <void *>oa)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":179 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":180
- * <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * 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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_18p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_18p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
+ Py_INCREF(__pyx_k61p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k61p);
+ __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":181
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":181 */
__pyx_5 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":182
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":183
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":184
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<<
- * return array
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":182 */
+ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":183 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":184 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
}
}
__pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":185
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":185 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -790,18 +525,12 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6
Py_DECREF(arrayObject);
Py_DECREF(__pyx_v_itera);
Py_DECREF(__pyx_v_multi);
+ Py_DECREF(__pyx_v_size);
+ Py_DECREF(__pyx_v_oa);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":187
- * return array
- *
- * cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a, # <<<<<<<<<<<<<<
- * double b):
- * cdef double *array_data
- */
-
-static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont2 __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a, double __pyx_v_b) {
+static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont2 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {
double *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -811,26 +540,13 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":194
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a, b)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":194 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":195
- *
- * if size is None:
- * return func(state, a, b) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, _sp.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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -838,25 +554,19 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":197
- * return func(state, a, b)
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":197 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -864,50 +574,18 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":198
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":198 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":199
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":199 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":200
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a, b)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":201
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":200 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":202
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b)
- * return array # <<<<<<<<<<<<<<
- *
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":202 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -924,22 +602,15 @@ static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":205
- *
- *
- * cdef object cont2_array(rk_state *state, rk_cont2 func, object size, # <<<<<<<<<<<<<<
- * ndarray oa, ndarray ob):
- * cdef double *array_data
- */
-
-static PyObject *__pyx_k_19p;
+static PyObject *__pyx_k62p;
-static char __pyx_k_19[] = "size is not compatible with inputs";
+static char __pyx_k62[] = "size is not compatible with inputs";
-static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont2 __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_oa, PyArrayObject *__pyx_v_ob) {
+static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont2 __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa,PyArrayObject *__pyx_v_ob) {
double *__pyx_v_array_data;
double *__pyx_v_oa_data;
double *__pyx_v_ob_data;
@@ -952,123 +623,66 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6
npy_intp __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
+ Py_INCREF(__pyx_v_size);
+ Py_INCREF(__pyx_v_oa);
+ Py_INCREF(__pyx_v_ob);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":215
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * 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);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":215 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":216
- *
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob) # <<<<<<<<<<<<<<
- * 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 = 216; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":216 */
+ __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":217
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<<
- * 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 = 217; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":217 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":218
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":218 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":219
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>array.data
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":219 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":220
- * array_data = <double *>array.data
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":221
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":222
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0], ob_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":223
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":220 */
+ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":221 */
+ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":222 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":223 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":225
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":225 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
@@ -1076,122 +690,54 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6
arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":226
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- * if (multi.size != PyArray_SIZE(array)):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":226 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":227
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * array_data = <double *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob) # <<<<<<<<<<<<<<
- * 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 = 227; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":227 */
+ __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":228
- * array_data = <double *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":228 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":229
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * 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 = 229; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_19p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_19p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
+ Py_INCREF(__pyx_k62p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":230
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":230 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":231
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":232
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":233
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2)
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":234
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 2)
- * return array
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":235
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<<
- * return array
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 2);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":231 */
+ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":232 */
+ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":233 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":234 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":235 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
}
}
__pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":236
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":236 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1207,18 +753,13 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6
__pyx_L0:;
Py_DECREF(arrayObject);
Py_DECREF(__pyx_v_multi);
+ Py_DECREF(__pyx_v_size);
+ Py_DECREF(__pyx_v_oa);
+ Py_DECREF(__pyx_v_ob);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":238
- * return array
- *
- * cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a, # <<<<<<<<<<<<<<
- * double b, double c):
- *
- */
-
-static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont3 __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a, double __pyx_v_b, double __pyx_v_c) {
+static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont3 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {
double *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -1228,26 +769,13 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":246
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a, b, c)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":246 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":247
- *
- * if size is None:
- * return func(state, a, b, c) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, _sp.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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -1255,25 +783,19 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":249
- * return func(state, a, b, c)
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":249 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -1281,50 +803,18 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":250
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":250 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":251
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b, c)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":251 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":252
- * length = PyArray_SIZE(array)
- * array_data = <double *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a, b, c)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":253
- * array_data = <double *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b, c) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b, __pyx_v_c);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":252 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":254
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b, c)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":254 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1341,22 +831,15 @@ static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":256
- * return array
- *
- * cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa, # <<<<<<<<<<<<<<
- * ndarray ob, ndarray oc):
- *
- */
+static PyObject *__pyx_k63p;
-static PyObject *__pyx_k_20p;
+static char __pyx_k63[] = "size is not compatible with inputs";
-static char __pyx_k_20[] = "size is not compatible with inputs";
-
-static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont3 __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_oa, PyArrayObject *__pyx_v_ob, PyArrayObject *__pyx_v_oc) {
+static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont3 __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa,PyArrayObject *__pyx_v_ob,PyArrayObject *__pyx_v_oc) {
double *__pyx_v_array_data;
double *__pyx_v_oa_data;
double *__pyx_v_ob_data;
@@ -1370,132 +853,70 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6
npy_intp __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
+ Py_INCREF(__pyx_v_size);
+ Py_INCREF(__pyx_v_oa);
+ Py_INCREF(__pyx_v_ob);
+ Py_INCREF(__pyx_v_oc);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":268
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * 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);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":268 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":269
- *
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc) # <<<<<<<<<<<<<<
- * 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 = 269; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":269 */
+ __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":270
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<<
- * 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 = 270; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":270 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":271
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":271 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":272
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>array.data
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":272 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":273
- * array_data = <double *>array.data
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":274
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":275
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":276
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]), (__pyx_v_oc_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":277
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":273 */
+ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":274 */
+ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":275 */
+ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":276 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":277 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":279
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64) # <<<<<<<<<<<<<<
- * array_data = <double *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":279 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
@@ -1503,122 +924,54 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6
arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":280
- * else:
- * array = <ndarray>_sp.empty(size, _sp.float64)
- * array_data = <double *>array.data # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- * <void *>ob, <void *>oc)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":280 */
__pyx_v_array_data = ((double *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":282
- * array_data = <double *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- * <void *>ob, <void *>oc) # <<<<<<<<<<<<<<
- * 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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":281 */
+ __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":283
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- * <void *>ob, <void *>oc)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":283 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":284
- * <void *>ob, <void *>oc)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * 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 = 284; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_20p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_20p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
+ Py_INCREF(__pyx_k63p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k63p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":285
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":285 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":286
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":287
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":288
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 3));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":289
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * return array
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]), (__pyx_v_oc_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":290
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * return array
- *
- */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":286 */
+ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":287 */
+ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":288 */
+ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,3));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":289 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":290 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
}
__pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":291
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object disc0_array(rk_state *state, rk_disc0 func, object size):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":291 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1634,18 +987,14 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6
__pyx_L0:;
Py_DECREF(arrayObject);
Py_DECREF(__pyx_v_multi);
+ Py_DECREF(__pyx_v_size);
+ Py_DECREF(__pyx_v_oa);
+ Py_DECREF(__pyx_v_ob);
+ Py_DECREF(__pyx_v_oc);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":293
- * return array
- *
- * cdef object disc0_array(rk_state *state, rk_disc0 func, object size): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_disc0 __pyx_v_func, PyObject *__pyx_v_size) {
+static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_disc0 __pyx_v_func,PyObject *__pyx_v_size) {
long *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -1655,26 +1004,13 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":299
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":299 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":300
- *
- * if size is None:
- * return func(state) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, int)
- */
- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -1682,22 +1018,16 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":302
- * return func(state)
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":302 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -1705,50 +1035,18 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":303
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":303 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":304
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":304 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":305
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":306
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state) # <<<<<<<<<<<<<<
- * return array
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":305 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
(__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":307
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n, double p):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":307 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1765,18 +1063,11 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state, __pyx_t_6
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":309
- * return array
- *
- * cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n, double p): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discnp __pyx_v_func, PyObject *__pyx_v_size, long __pyx_v_n, double __pyx_v_p) {
+static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnp __pyx_v_func,PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {
long *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -1786,26 +1077,13 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":315
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, n, p)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":315 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":316
- *
- * if size is None:
- * return func(state, n, p) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.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 = 316; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -1813,22 +1091,16 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":318
- * return func(state, n, p)
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":318 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -1836,50 +1108,18 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":319
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":319 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":320
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":320 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":321
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, n, p)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":322
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":321 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":323
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray on, ndarray op):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":323 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -1896,22 +1136,15 @@ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":325
- * return array
- *
- * cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray on, ndarray op): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
+static PyObject *__pyx_k64p;
-static PyObject *__pyx_k_21p;
+static char __pyx_k64[] = "size is not compatible with inputs";
-static char __pyx_k_21[] = "size is not compatible with inputs";
-
-static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discnp __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_on, PyArrayObject *__pyx_v_op) {
+static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnp __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_on,PyArrayObject *__pyx_v_op) {
long *__pyx_v_array_data;
PyArrayObject *arrayObject;
npy_intp __pyx_v_i;
@@ -1924,120 +1157,63 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_
npy_intp __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
+ Py_INCREF(__pyx_v_size);
+ Py_INCREF(__pyx_v_on);
+ Py_INCREF(__pyx_v_op);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":334
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * 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);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":334 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":335
- *
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op) # <<<<<<<<<<<<<<
- * 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 = 335; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":335 */
+ __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":336
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) # <<<<<<<<<<<<<<
- * 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 = 336; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":336 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":337
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":337 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":338
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>array.data
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":338 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":339
- * array_data = <long *>array.data
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, on_data[0], op_data[0])
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":340
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, on_data[0], op_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":341
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, on_data[0], op_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":342
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, on_data[0], op_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, int)
- */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":339 */
+ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":340 */
+ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":341 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":342 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":344
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":344 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
@@ -2045,122 +1221,54 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_
arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":345
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- * if (multi.size != PyArray_SIZE(array)):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":345 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":346
- * array = <ndarray>_sp.empty(size, int)
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op) # <<<<<<<<<<<<<<
- * 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 = 346; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":346 */
+ __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":347
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":347 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":348
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * 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 = 348; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_21p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_21p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
+ Py_INCREF(__pyx_k64p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k64p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":349
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":349 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":350
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], op_data[0])
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":351
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, on_data[0], op_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- */
- __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":352
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], op_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2)
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":353
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], op_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 2)
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":354
- * array_data[i] = func(state, on_data[0], op_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<<
- *
- * return array
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 2);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":350 */
+ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":351 */
+ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":352 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":353 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":354 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
}
}
__pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":356
- * PyArray_MultiIter_NEXTi(multi, 2)
- *
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":356 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -2176,18 +1284,13 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_
__pyx_L0:;
Py_DECREF(arrayObject);
Py_DECREF(__pyx_v_multi);
+ Py_DECREF(__pyx_v_size);
+ Py_DECREF(__pyx_v_on);
+ Py_DECREF(__pyx_v_op);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":358
- * return array
- *
- * cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size, # <<<<<<<<<<<<<<
- * long n, long m, long N):
- * cdef long *array_data
- */
-
-static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discnmN __pyx_v_func, PyObject *__pyx_v_size, long __pyx_v_n, long __pyx_v_m, long __pyx_v_N) {
+static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {
long *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -2197,26 +1300,13 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":365
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, n, m, N)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":365 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":366
- *
- * if size is None:
- * return func(state, n, m, N) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.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 = 366; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -2224,22 +1314,16 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":368
- * return func(state, n, m, N)
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":368 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
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;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -2247,50 +1331,18 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":369
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":369 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":370
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, m, N)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":370 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":371
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, n, m, N)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":372
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, m, N) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_m, __pyx_v_N);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":371 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":373
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, m, N)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnmN_array(rk_state *state, rk_discnmN func, object size,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":373 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -2307,22 +1359,15 @@ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state, __py
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":375
- * return array
- *
- * cdef object discnmN_array(rk_state *state, rk_discnmN func, object size, # <<<<<<<<<<<<<<
- * ndarray on, ndarray om, ndarray oN):
- * cdef long *array_data
- */
+static PyObject *__pyx_k65p;
-static PyObject *__pyx_k_22p;
+static char __pyx_k65[] = "size is not compatible with inputs";
-static char __pyx_k_22[] = "size is not compatible with inputs";
-
-static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discnmN __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_on, PyArrayObject *__pyx_v_om, PyArrayObject *__pyx_v_oN) {
+static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_on,PyArrayObject *__pyx_v_om,PyArrayObject *__pyx_v_oN) {
long *__pyx_v_array_data;
long *__pyx_v_on_data;
long *__pyx_v_om_data;
@@ -2336,129 +1381,67 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t
npy_intp __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
+ Py_INCREF(__pyx_v_size);
+ Py_INCREF(__pyx_v_on);
+ Py_INCREF(__pyx_v_om);
+ Py_INCREF(__pyx_v_oN);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":386
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * 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);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":386 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":387
- *
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN) # <<<<<<<<<<<<<<
- * 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 = 387; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":387 */
+ __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":388
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) # <<<<<<<<<<<<<<
- * 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 = 388; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":388 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":389
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":389 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":390
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>array.data
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":390 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":391
- * array_data = <long *>array.data
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":392
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- */
- __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":393
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":394
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_om_data[0]), (__pyx_v_oN_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":395
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, int)
- */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":391 */
+ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":392 */
+ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":393 */
+ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":394 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":395 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":397
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":397 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
@@ -2466,122 +1449,54 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t
arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":398
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- * <void *>oN)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":398 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":400
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- * <void *>oN) # <<<<<<<<<<<<<<
- * 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 = 399; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":399 */
+ __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":401
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- * <void *>oN)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":401 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":402
- * <void *>oN)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * 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 = 402; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_22p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_22p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
+ Py_INCREF(__pyx_k65p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k65p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":403
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":403 */
__pyx_3 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":404
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":405
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- */
- __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":406
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 3));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":407
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_om_data[0]), (__pyx_v_oN_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":408
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- *
- * return array
- */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":404 */
+ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":405 */
+ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":406 */
+ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,3));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":407 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":408 */
PyArray_MultiIter_NEXT(__pyx_v_multi);
}
}
__pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":410
- * PyArray_MultiIter_NEXT(multi)
- *
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":410 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -2597,18 +1512,14 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state, __pyx_t
__pyx_L0:;
Py_DECREF(arrayObject);
Py_DECREF(__pyx_v_multi);
+ Py_DECREF(__pyx_v_size);
+ Py_DECREF(__pyx_v_on);
+ Py_DECREF(__pyx_v_om);
+ Py_DECREF(__pyx_v_oN);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":412
- * return array
- *
- * cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discd __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a) {
+static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discd __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a) {
long *__pyx_v_array_data;
PyArrayObject *arrayObject;
long __pyx_v_length;
@@ -2618,26 +1529,13 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":418
- * cdef long i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a)
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":418 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":419
- *
- * if size is None:
- * return func(state, a) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.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 = 419; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -2645,22 +1543,16 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":421
- * return func(state, a)
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":421 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -2668,50 +1560,18 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":422
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":422 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":423
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":423 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":424
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":425
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":424 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":426
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":426 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -2728,22 +1588,15 @@ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":428
- * return array
- *
- * cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef double *oa_data
- */
-
-static PyObject *__pyx_k_23p;
+static PyObject *__pyx_k66p;
-static char __pyx_k_23[] = "size is not compatible with inputs";
+static char __pyx_k66[] = "size is not compatible with inputs";
-static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discd __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_oa) {
+static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discd __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa) {
long *__pyx_v_array_data;
double *__pyx_v_oa_data;
PyArrayObject *arrayObject;
@@ -2757,111 +1610,59 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
npy_intp __pyx_5;
+ Py_INCREF(__pyx_v_size);
+ Py_INCREF(__pyx_v_oa);
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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":437
- * cdef flatiter itera
- *
- * if size is None: # <<<<<<<<<<<<<<
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG)
- * length = PyArray_SIZE(array)
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":437 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":438
- *
- * if size is None:
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG) # <<<<<<<<<<<<<<
- * 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 = 438; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":438 */
+ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject));
arrayObject = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":439
- * if size is None:
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":439 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":440
- * array = <ndarray>PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG)
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":440 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":441
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- * itera = <flatiter>PyArray_IterNew(<object>oa) # <<<<<<<<<<<<<<
- * 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 = 441; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":441 */
+ __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_itera));
__pyx_v_itera = ((PyArrayIterObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":442
- * array_data = <long *>array.data
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera)
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":443
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0]) # <<<<<<<<<<<<<<
- * PyArray_ITER_NEXT(itera)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (((double *)__pyx_v_itera->dataptr)[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":444
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.empty(size, int)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":442 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":443 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":444 */
PyArray_ITER_NEXT(__pyx_v_itera);
}
goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":446
- * PyArray_ITER_NEXT(itera)
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":446 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
@@ -2869,104 +1670,48 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6
arrayObject = ((PyArrayObject *)__pyx_4);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":447
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":447 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":448
- * array = <ndarray>_sp.empty(size, int)
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa) # <<<<<<<<<<<<<<
- * 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 = 448; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":448 */
+ __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_multi));
__pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":449
- * array_data = <long *>array.data
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":449 */
__pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":450
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * 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 = 450; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_23p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_23p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
+ Py_INCREF(__pyx_k66p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k66p);
+ __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":451
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":451 */
__pyx_5 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":452
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":453
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":454
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<<
- * return array
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":452 */
+ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":453 */
+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":454 */
+ PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
}
}
__pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":455
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef double kahan_sum(double *darr, long n):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":455 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
@@ -2983,18 +1728,12 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state, __pyx_t_6
Py_DECREF(arrayObject);
Py_DECREF(__pyx_v_multi);
Py_DECREF(__pyx_v_itera);
+ Py_DECREF(__pyx_v_size);
+ Py_DECREF(__pyx_v_oa);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":457
- * return array
- *
- * cdef double kahan_sum(double *darr, long n): # <<<<<<<<<<<<<<
- * cdef double c, y, t, sum
- * cdef long i
- */
-
-static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr, long __pyx_v_n) {
+static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr,long __pyx_v_n) {
double __pyx_v_c;
double __pyx_v_y;
double __pyx_v_t;
@@ -3002,77 +1741,29 @@ static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr, long __pyx_v_n) {
long __pyx_v_i;
double __pyx_r;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":460
- * cdef double c, y, t, sum
- * cdef long i
- * sum = darr[0] # <<<<<<<<<<<<<<
- * c = 0.0
- * for i from 1 <= i < n:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":460 */
__pyx_v_sum = (__pyx_v_darr[0]);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":461
- * cdef long i
- * sum = darr[0]
- * c = 0.0 # <<<<<<<<<<<<<<
- * for i from 1 <= i < n:
- * y = darr[i] - c
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":461 */
__pyx_v_c = 0.0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":462
- * sum = darr[0]
- * c = 0.0
- * for i from 1 <= i < n: # <<<<<<<<<<<<<<
- * y = darr[i] - c
- * t = sum + y
- */
- for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":463
- * c = 0.0
- * for i from 1 <= i < n:
- * y = darr[i] - c # <<<<<<<<<<<<<<
- * t = sum + y
- * c = (t-sum) - y
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":462 */
+ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":463 */
__pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":464
- * for i from 1 <= i < n:
- * y = darr[i] - c
- * t = sum + y # <<<<<<<<<<<<<<
- * c = (t-sum) - y
- * sum = t
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":464 */
__pyx_v_t = (__pyx_v_sum + __pyx_v_y);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":465
- * y = darr[i] - c
- * t = sum + y
- * c = (t-sum) - y # <<<<<<<<<<<<<<
- * sum = t
- * return sum
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":465 */
__pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":466
- * t = sum + y
- * c = (t-sum) - y
- * sum = t # <<<<<<<<<<<<<<
- * return sum
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":466 */
__pyx_v_sum = __pyx_v_t;
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":467
- * c = (t-sum) - y
- * sum = t
- * return sum # <<<<<<<<<<<<<<
- *
- * cdef class RandomState:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":467 */
__pyx_r = __pyx_v_sum;
goto __pyx_L0;
@@ -3081,58 +1772,28 @@ static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr, long __pyx_v_n) {
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":489
- * cdef rk_state *internal_state
- *
- * def __init__(self, seed=None): # <<<<<<<<<<<<<<
- * self.internal_state = <rk_state*>PyMem_Malloc(sizeof(rk_state))
- *
- */
-
-static int __pyx_pf_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_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);
- }
- }
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.__init__");
- return -1;
- __pyx_L3:;
+ __pyx_v_seed = __pyx_k2;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed)) return -1;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_seed);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":490
- *
- * def __init__(self, seed=None):
- * self.internal_state = <rk_state*>PyMem_Malloc(sizeof(rk_state)) # <<<<<<<<<<<<<<
- *
- * self.seed(seed)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":490 */
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state))));
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":492
- * self.internal_state = <rk_state*>PyMem_Malloc(sizeof(rk_state))
- *
- * self.seed(seed) # <<<<<<<<<<<<<<
- *
- * def __dealloc__(self):
- */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":492 */
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}
Py_INCREF(__pyx_v_seed);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);
- __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
@@ -3146,67 +1807,35 @@ static int __pyx_pf_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObj
__Pyx_AddTraceback("mtrand.RandomState.__init__");
__pyx_r = -1;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_seed);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":494
- * self.seed(seed)
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * if self.internal_state != NULL:
- * PyMem_Free(self.internal_state)
- */
-
-static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {
+static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":495
- *
- * def __dealloc__(self):
- * if self.internal_state != NULL: # <<<<<<<<<<<<<<
- * PyMem_Free(self.internal_state)
- * self.internal_state = NULL
- */
+ Py_INCREF(__pyx_v_self);
__pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL);
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":496
- * def __dealloc__(self):
- * if self.internal_state != NULL:
- * PyMem_Free(self.internal_state) # <<<<<<<<<<<<<<
- * self.internal_state = NULL
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":496 */
PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":497
- * if self.internal_state != NULL:
- * PyMem_Free(self.internal_state)
- * self.internal_state = NULL # <<<<<<<<<<<<<<
- *
- * def seed(self, seed=None):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":497 */
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = NULL;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
+ Py_DECREF(__pyx_v_self);
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":499
- * self.internal_state = NULL
- *
- * def seed(self, seed=None): # <<<<<<<<<<<<<<
- * """Seed the generator.
- *
- */
-
static PyObject *__pyx_n_integer;
-static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_seed[] = "Seed the generator.\n\n seed(seed=None)\n\n seed can be an integer, an array (or other sequence) of integers of any\n length, or None. If seed is None, then RandomState will try to read data\n from /dev/urandom (or the Windows analogue) if available or seed from\n the clock otherwise.\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_seed = 0;
rk_error __pyx_v_errcode;
PyArrayObject *arrayObject_obj;
@@ -3217,138 +1846,66 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO
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);
- }
- }
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.seed");
- return NULL;
- __pyx_L3:;
+ __pyx_v_seed = __pyx_k3;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_seed);
arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_iseed = Py_None; Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":511
- * cdef rk_error errcode
- * cdef ndarray obj "arrayObject_obj"
- * if seed is None: # <<<<<<<<<<<<<<
- * errcode = rk_randomseed(self.internal_state)
- * elif type(seed) is int:
- */
- __pyx_1 = (__pyx_v_seed == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":511 */
+ __pyx_1 = __pyx_v_seed == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":512
- * cdef ndarray obj "arrayObject_obj"
- * if seed is None:
- * errcode = rk_randomseed(self.internal_state) # <<<<<<<<<<<<<<
- * elif type(seed) is int:
- * rk_seed(seed, self.internal_state)
- */
__pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- goto __pyx_L4;
+ goto __pyx_L2;
}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":513
- * if seed is None:
- * errcode = rk_randomseed(self.internal_state)
- * elif type(seed) is int: # <<<<<<<<<<<<<<
- * rk_seed(seed, self.internal_state)
- * elif isinstance(seed, _sp.integer):
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}
Py_INCREF(__pyx_v_seed);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);
- __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = (__pyx_3 == ((PyObject*)&PyInt_Type));
+ __pyx_1 = __pyx_3 == ((PyObject *)(&PyInt_Type));
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":514
- * errcode = rk_randomseed(self.internal_state)
- * elif type(seed) is int:
- * rk_seed(seed, self.internal_state) # <<<<<<<<<<<<<<
- * elif isinstance(seed, _sp.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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1;}
- rk_seed(__pyx_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- goto __pyx_L4;
+ __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
+ rk_seed(__pyx_4,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+ goto __pyx_L2;
}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":515
- * elif type(seed) is int:
- * rk_seed(seed, self.internal_state)
- * elif isinstance(seed, _sp.integer): # <<<<<<<<<<<<<<
- * iseed = int(seed)
- * rk_seed(iseed, self.internal_state)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
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 = 515; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":516
- * rk_seed(seed, self.internal_state)
- * elif isinstance(seed, _sp.integer):
- * iseed = int(seed) # <<<<<<<<<<<<<<
- * rk_seed(iseed, self.internal_state)
- * else:
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":516 */
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;}
Py_INCREF(__pyx_v_seed);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);
- __pyx_3 = PyObject_Call(((PyObject*)&PyInt_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_iseed);
__pyx_v_iseed = __pyx_3;
__pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":517
- * elif isinstance(seed, _sp.integer):
- * iseed = int(seed)
- * rk_seed(iseed, self.internal_state) # <<<<<<<<<<<<<<
- * 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 = 517; __pyx_clineno = __LINE__; goto __pyx_L1;}
- rk_seed(__pyx_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
- goto __pyx_L4;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":517 */
+ __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}
+ rk_seed(__pyx_4,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+ goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":519
- * rk_seed(iseed, self.internal_state)
- * else:
- * obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) # <<<<<<<<<<<<<<
- * 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 = 519; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":519 */
+ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject_obj));
arrayObject_obj = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":521
- * obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1)
- * init_by_array(self.internal_state, <unsigned long *>(obj.data),
- * obj.dimensions[0]) # <<<<<<<<<<<<<<
- *
- * def get_state(self):
- */
- init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, ((unsigned long *)arrayObject_obj->data), (arrayObject_obj->dimensions[0]));
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":520 */
+ init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long *)arrayObject_obj->data),(arrayObject_obj->dimensions[0]));
}
- __pyx_L4:;
+ __pyx_L2:;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
@@ -3356,132 +1913,96 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyO
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("mtrand.RandomState.seed");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject_obj);
Py_DECREF(__pyx_v_iseed);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_seed);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":523
- * obj.dimensions[0])
- *
- * def get_state(self): # <<<<<<<<<<<<<<
- * """Return a tuple representing the internal state of the generator.
- *
- */
-
-static PyObject *__pyx_int_624;
-
static PyObject *__pyx_n_uint;
static PyObject *__pyx_n_asarray;
static PyObject *__pyx_n_uint32;
static PyObject *__pyx_n_MT19937;
-static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_get_state[] = "Return a tuple representing the internal state of the generator.\n\n get_state() -> (\'MT19937\', int key[624], int pos, int has_gauss, float cached_gaussian)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *unused) {
+static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *arrayObject_state;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
+ static char *__pyx_argnames[] = {0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+ Py_INCREF(__pyx_v_self);
arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":529
- * """
- * cdef ndarray state "arrayObject_state"
- * state = <ndarray>_sp.empty(624, _sp.uint) # <<<<<<<<<<<<<<
- * memcpy(<void*>(state.data), <void*>(self.internal_state.key), 624*sizeof(long))
- * state = <ndarray>_sp.asarray(state, _sp.uint32)
- */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_uint); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1;}
- 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, __pyx_1, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":529 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
- Py_DECREF(((PyObject *)arrayObject_state));
- arrayObject_state = ((PyArrayObject *)__pyx_3);
+ __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":530
- * cdef ndarray state "arrayObject_state"
- * state = <ndarray>_sp.empty(624, _sp.uint)
- * memcpy(<void*>(state.data), <void*>(self.internal_state.key), 624*sizeof(long)) # <<<<<<<<<<<<<<
- * state = <ndarray>_sp.asarray(state, _sp.uint32)
- * return ('MT19937', state, self.internal_state.pos,
- */
- memcpy(((void *)arrayObject_state->data), ((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key), (624 * (sizeof(long))));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":531
- * state = <ndarray>_sp.empty(624, _sp.uint)
- * memcpy(<void*>(state.data), <void*>(self.internal_state.key), 624*sizeof(long))
- * state = <ndarray>_sp.asarray(state, _sp.uint32) # <<<<<<<<<<<<<<
- * return ('MT19937', state, self.internal_state.pos,
- * self.internal_state.has_gauss, self.internal_state.gauss)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_asarray); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
+ __pyx_1 = 0;
+ __pyx_4 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1;}
- 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, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
+ Py_DECREF(((PyObject *)arrayObject_state));
+ arrayObject_state = ((PyArrayObject *)__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":530 */
+ memcpy(arrayObject_state->data,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long))));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":531 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
- Py_DECREF(((PyObject *)arrayObject_state));
- arrayObject_state = ((PyArrayObject *)__pyx_2);
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)arrayObject_state));
+ PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)arrayObject_state));
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_1);
+ __pyx_1 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
+ Py_DECREF(((PyObject *)arrayObject_state));
+ arrayObject_state = ((PyArrayObject *)__pyx_3);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":532
- * memcpy(<void*>(state.data), <void*>(self.internal_state.key), 624*sizeof(long))
- * state = <ndarray>_sp.asarray(state, _sp.uint32)
- * return ('MT19937', state, self.internal_state.pos, # <<<<<<<<<<<<<<
- * 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 = 532; __pyx_clineno = __LINE__; goto __pyx_L1;}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":533
- * state = <ndarray>_sp.asarray(state, _sp.uint32)
- * return ('MT19937', state, self.internal_state.pos,
- * self.internal_state.has_gauss, self.internal_state.gauss) # <<<<<<<<<<<<<<
- *
- * 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 = 533; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __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 = 533; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":532 */
+ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;}
Py_INCREF(__pyx_n_MT19937);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_n_MT19937);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_MT19937);
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);
+ PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)arrayObject_state));
+ PyTuple_SET_ITEM(__pyx_3, 2, __pyx_1);
+ PyTuple_SET_ITEM(__pyx_3, 3, __pyx_2);
+ PyTuple_SET_ITEM(__pyx_3, 4, __pyx_4);
__pyx_1 = 0;
- __pyx_3 = 0;
__pyx_2 = 0;
- __pyx_r = __pyx_4;
__pyx_4 = 0;
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3492,35 +2013,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("mtrand.RandomState.get_state");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject_state);
+ Py_DECREF(__pyx_v_self);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":535
- * self.internal_state.has_gauss, self.internal_state.gauss)
- *
- * def set_state(self, state): # <<<<<<<<<<<<<<
- * """Set the state from a tuple.
- *
- */
-
-static PyObject *__pyx_int_0;
-
-static PyObject *__pyx_n_TypeError;
+static PyObject *__pyx_k69p;
+static PyObject *__pyx_k70p;
-static PyObject *__pyx_k_26p;
-static PyObject *__pyx_k_27p;
+static char __pyx_k69[] = "algorithm must be 'MT19937'";
+static char __pyx_k70[] = "state must be 624 longs";
-static PyObject *__pyx_builtin_TypeError;
-
-static char __pyx_k_26[] = "algorithm must be 'MT19937'";
-static char __pyx_k_27[] = "state must be 624 longs";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_set_state[] = "Set the state from a tuple.\n\n state = (\'MT19937\', int key[624], int pos, int has_gauss, float cached_gaussian)\n\n For backwards compatibility, the following form is also accepted\n although it is missing some information about the cached Gaussian value.\n\n state = (\'MT19937\', int key[624], int pos)\n\n set_state(state)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
+static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_state = 0;
PyArrayObject *arrayObject_obj;
int __pyx_v_pos;
PyObject *__pyx_v_algorithm_name;
@@ -3529,351 +2038,184 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self
PyObject *__pyx_v_cached_gaussian;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- int __pyx_3;
- PyObject *__pyx_4 = 0;
- int __pyx_5;
- Py_ssize_t __pyx_6 = 0;
- PyObject *__pyx_7 = 0;
- double __pyx_8;
+ int __pyx_2;
+ PyObject *__pyx_3 = 0;
+ Py_ssize_t __pyx_4;
+ PyObject *__pyx_5 = 0;
+ PyObject *__pyx_6 = 0;
+ double __pyx_7;
+ static char *__pyx_argnames[] = {"state",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_state);
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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":549
- * cdef ndarray obj "arrayObject_obj"
- * cdef int pos
- * algorithm_name = state[0] # <<<<<<<<<<<<<<
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'")
- */
- if (PyList_CheckExact(__pyx_v_state) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_state)) {
- __pyx_2 = PyList_GET_ITEM(__pyx_v_state, 0); Py_INCREF(__pyx_2);
- } else if (PyTuple_CheckExact(__pyx_v_state) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_state)) {
- __pyx_2 = PyTuple_GET_ITEM(__pyx_v_state, 0); Py_INCREF(__pyx_2);
- } else {
- __pyx_1 = PyInt_FromLong(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- }
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":549 */
+ __pyx_1 = __Pyx_GetItemInt(__pyx_v_state, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}
Py_DECREF(__pyx_v_algorithm_name);
- __pyx_v_algorithm_name = __pyx_2;
- __pyx_2 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":550
- * cdef int pos
- * algorithm_name = state[0]
- * if algorithm_name != 'MT19937': # <<<<<<<<<<<<<<
- * raise ValueError("algorithm must be 'MT19937'")
- * key, pos = state[1:3]
- */
- __pyx_1 = PyObject_RichCompare(__pyx_v_algorithm_name, __pyx_n_MT19937, Py_NE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__pyx_3) {
+ __pyx_v_algorithm_name = __pyx_1;
+ __pyx_1 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":551
- * algorithm_name = state[0]
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'") # <<<<<<<<<<<<<<
- * key, pos = state[1:3]
- * if len(state) == 3:
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_26p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_26p);
- __pyx_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_1, 0, 0);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":550 */
+ if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;}
+ __pyx_2 = __pyx_2 != 0;
+ if (__pyx_2) {
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;}
+ Py_INCREF(__pyx_k69p);
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k69p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L4;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;}
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":552
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'")
- * key, pos = state[1:3] # <<<<<<<<<<<<<<
- * if len(state) == 3:
- * has_gauss = 0
- */
- __pyx_2 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
- PyObject* tuple = __pyx_2;
- __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 = 552; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_v_pos = __pyx_5;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- else {
- __pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_v_key);
- __pyx_v_key = __pyx_4;
- __pyx_4 = 0;
- __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_v_pos = __pyx_5;
- if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- }
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":552 */
+ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_key);
+ __pyx_v_key = __pyx_1;
+ __pyx_1 = 0;
+ __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
+ __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_v_pos = __pyx_2;
+ if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":553
- * raise ValueError("algorithm must be 'MT19937'")
- * key, pos = state[1:3]
- * if len(state) == 3: # <<<<<<<<<<<<<<
- * 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 = 553; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = (__pyx_6 == 3);
- if (__pyx_3) {
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":553 */
+ __pyx_4 = PyObject_Length(__pyx_v_state); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}
+ __pyx_2 = (__pyx_4 == 3);
+ if (__pyx_2) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":554
- * key, pos = state[1:3]
- * if len(state) == 3:
- * has_gauss = 0 # <<<<<<<<<<<<<<
- * cached_gaussian = 0.0
- * else:
- */
- Py_INCREF(__pyx_int_0);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":554 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}
Py_DECREF(__pyx_v_has_gauss);
- __pyx_v_has_gauss = __pyx_int_0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":555
- * if len(state) == 3:
- * has_gauss = 0
- * cached_gaussian = 0.0 # <<<<<<<<<<<<<<
- * 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 = 555; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_v_has_gauss = __pyx_1;
+ __pyx_1 = 0;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":555 */
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; goto __pyx_L1;}
Py_DECREF(__pyx_v_cached_gaussian);
- __pyx_v_cached_gaussian = __pyx_4;
- __pyx_4 = 0;
- goto __pyx_L5;
+ __pyx_v_cached_gaussian = __pyx_3;
+ __pyx_3 = 0;
+ goto __pyx_L3;
}
/*else*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":557
- * cached_gaussian = 0.0
- * else:
- * has_gauss, cached_gaussian = state[3:5] # <<<<<<<<<<<<<<
- * try:
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1)
- */
- __pyx_2 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
- PyObject* tuple = __pyx_2;
- __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_2); __pyx_2 = 0;
- }
- else {
- __pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_v_has_gauss);
- __pyx_v_has_gauss = __pyx_4;
- __pyx_4 = 0;
- __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_v_cached_gaussian);
- __pyx_v_cached_gaussian = __pyx_4;
- __pyx_4 = 0;
- if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- }
+ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_has_gauss);
+ __pyx_v_has_gauss = __pyx_1;
+ __pyx_1 = 0;
+ __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_cached_gaussian);
+ __pyx_v_cached_gaussian = __pyx_1;
+ __pyx_1 = 0;
+ if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":558
- * else:
- * has_gauss, cached_gaussian = state[3:5]
- * try: # <<<<<<<<<<<<<<
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1)
- * except TypeError:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":558 */
/*try:*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":559
- * 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 = 559; __pyx_clineno = __LINE__; goto __pyx_L6;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
+ __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; goto __pyx_L4;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
Py_DECREF(((PyObject *)arrayObject_obj));
- arrayObject_obj = ((PyArrayObject *)__pyx_4);
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ arrayObject_obj = ((PyArrayObject *)__pyx_1);
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
}
- goto __pyx_L7;
- __pyx_L6:;
- Py_XDECREF(__pyx_2); __pyx_2 = 0;
+ goto __pyx_L5;
+ __pyx_L4:;
+ Py_XDECREF(__pyx_3); __pyx_3 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
- Py_XDECREF(__pyx_4); __pyx_4 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":560
- * 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) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":560 */
+ __pyx_2 = PyErr_ExceptionMatches(PyExc_TypeError);
+ if (__pyx_2) {
__Pyx_AddTraceback("mtrand.set_state");
- if (__Pyx_GetException(&__pyx_2, &__pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1;}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":562
- * 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 = 562; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_7)));
+ if (__Pyx_GetException(&__pyx_3, &__pyx_1, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
+ __pyx_6 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_6)));
Py_DECREF(((PyObject *)arrayObject_obj));
- arrayObject_obj = ((PyArrayObject *)__pyx_7);
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ arrayObject_obj = ((PyArrayObject *)__pyx_6);
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- goto __pyx_L7;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ goto __pyx_L5;
}
goto __pyx_L1;
- __pyx_L7:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":563
- * # 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")
- * memcpy(<void*>(self.internal_state.key), <void*>(obj.data), 624*sizeof(long))
- */
- __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);
- if (__pyx_3) {
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":564
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1)
- * if obj.dimensions[0] != 624:
- * raise ValueError("state must be 624 longs") # <<<<<<<<<<<<<<
- * 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 = 564; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_27p);
- PyTuple_SET_ITEM(__pyx_7, 0, __pyx_k_27p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_7, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":563 */
+ __pyx_2 = ((arrayObject_obj->dimensions[0]) != 624);
+ if (__pyx_2) {
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
+ Py_INCREF(__pyx_k70p);
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k70p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":565
- * if obj.dimensions[0] != 624:
- * raise ValueError("state must be 624 longs")
- * memcpy(<void*>(self.internal_state.key), <void*>(obj.data), 624*sizeof(long)) # <<<<<<<<<<<<<<
- * self.internal_state.pos = pos
- * self.internal_state.has_gauss = has_gauss
- */
- memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key), ((void *)arrayObject_obj->data), (624 * (sizeof(long))));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":566
- * raise ValueError("state must be 624 longs")
- * memcpy(<void*>(self.internal_state.key), <void*>(obj.data), 624*sizeof(long))
- * self.internal_state.pos = pos # <<<<<<<<<<<<<<
- * self.internal_state.has_gauss = has_gauss
- * self.internal_state.gauss = cached_gaussian
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":565 */
+ memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,arrayObject_obj->data,(624 * (sizeof(long))));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":566 */
((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":567
- * memcpy(<void*>(self.internal_state.key), <void*>(obj.data), 624*sizeof(long))
- * self.internal_state.pos = pos
- * self.internal_state.has_gauss = has_gauss # <<<<<<<<<<<<<<
- * 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 = 567; __pyx_clineno = __LINE__; goto __pyx_L1;}
- ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_5;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":568
- * self.internal_state.pos = pos
- * self.internal_state.has_gauss = has_gauss
- * self.internal_state.gauss = cached_gaussian # <<<<<<<<<<<<<<
- *
- * # Pickling support:
- */
- __pyx_8 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1;}
- ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_8;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":567 */
+ __pyx_2 = PyInt_AsLong(__pyx_v_has_gauss); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;}
+ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_2;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":568 */
+ __pyx_7 = PyFloat_AsDouble(__pyx_v_cached_gaussian); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; goto __pyx_L1;}
+ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_7;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_4);
- Py_XDECREF(__pyx_7);
+ Py_XDECREF(__pyx_3);
+ Py_XDECREF(__pyx_5);
+ Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("mtrand.RandomState.set_state");
- __pyx_r = NULL;
+ __pyx_r = 0;
__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);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_state);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":571
- *
- * # Pickling support:
- * def __getstate__(self): # <<<<<<<<<<<<<<
- * return self.get_state()
- *
- */
-
-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) {
+static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":572
- * # Pickling support:
- * def __getstate__(self):
- * return self.get_state() # <<<<<<<<<<<<<<
- *
- * def __setstate__(self, state):
- */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_Call(__pyx_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ static char *__pyx_argnames[] = {0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+ Py_INCREF(__pyx_v_self);
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
@@ -3885,38 +2227,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_s
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("mtrand.RandomState.__getstate__");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":574
- * return self.get_state()
- *
- * def __setstate__(self, state): # <<<<<<<<<<<<<<
- * self.set_state(state)
- *
- */
-
-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) {
+static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_state = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":575
- *
- * def __setstate__(self, state):
- * self.set_state(state) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ static char *__pyx_argnames[] = {"state",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_state);
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
Py_INCREF(__pyx_v_state);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);
- __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
@@ -3928,53 +2260,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_s
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("mtrand.RandomState.__setstate__");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_state);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":577
- * self.set_state(state)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * return (_sp.random.__RandomState_ctor, (), self.get_state())
- *
- */
-
static PyObject *__pyx_n_random;
static PyObject *__pyx_n___RandomState_ctor;
-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) {
+static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":578
- *
- * def __reduce__(self):
- * return (_sp.random.__RandomState_ctor, (), self.get_state()) # <<<<<<<<<<<<<<
- *
- * # Basic distributions:
- */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyObject *__pyx_4 = 0;
+ static char *__pyx_argnames[] = {0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+ Py_INCREF(__pyx_v_self);
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
- Py_INCREF(__pyx_empty_tuple);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_empty_tuple);
- PyTuple_SET_ITEM(__pyx_2, 2, __pyx_3);
+ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
+ PyTuple_SET_ITEM(__pyx_3, 2, __pyx_4);
__pyx_1 = 0;
- __pyx_3 = 0;
- __pyx_r = __pyx_2;
__pyx_2 = 0;
+ __pyx_4 = 0;
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -3983,50 +2306,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_sel
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
+ Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("mtrand.RandomState.__reduce__");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":581
- *
- * # Basic distributions:
- * def random_sample(self, size=None): # <<<<<<<<<<<<<<
- * """Return random floats in the half-open interval [0.0, 1.0).
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_random_sample[] = "Return random floats in the half-open interval [0.0, 1.0).\n\n random_sample(size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_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);
- }
- }
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.random_sample");
- return NULL;
- __pyx_L3:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":586
- * random_sample(size=None) -> random values
- * """
- * return cont0_array(self.internal_state, rk_double, size) # <<<<<<<<<<<<<<
- *
- * 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 = 586; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_v_size = __pyx_k4;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_size);
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -4036,49 +2335,25 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("mtrand.RandomState.random_sample");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":588
- * return cont0_array(self.internal_state, rk_double, size)
- *
- * def tomaxint(self, size=None): # <<<<<<<<<<<<<<
- * """Returns random integers x such that 0 <= x <= sys.maxint.
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_tomaxint[] = "Returns random integers x such that 0 <= x <= sys.maxint.\n\n tomaxint(size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_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);
- }
- }
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.tomaxint");
- return NULL;
- __pyx_L3:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":593
- * tomaxint(size=None) -> random values
- * """
- * return disc0_array(self.internal_state, rk_long, size) # <<<<<<<<<<<<<<
- *
- * 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 = 593; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_v_size = __pyx_k5;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_size);
+ __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -4088,26 +2363,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self,
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("mtrand.RandomState.tomaxint");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":595
- * return disc0_array(self.internal_state, rk_long, size)
- *
- * def randint(self, low, high=None, size=None): # <<<<<<<<<<<<<<
- * """Return random integers x such that low <= x < high.
- *
- */
-
-static PyObject *__pyx_k_28p;
+static PyObject *__pyx_k71p;
-static char __pyx_k_28[] = "low >= high";
+static char __pyx_k71[] = "low >= high";
-static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_randint[] = "Return random integers x such that low <= x < high.\n\n randint(low, high=None, size=None) -> random values\n\n If high is None, then 0 <= x < low.\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_low = 0;
PyObject *__pyx_v_high = 0;
PyObject *__pyx_v_size = 0;
@@ -4125,160 +2394,78 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self,
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);
- }
- }
- }
- 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 = 595; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.randint");
- return NULL;
- __pyx_L3:;
+ __pyx_v_high = __pyx_k6;
+ __pyx_v_size = __pyx_k7;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_low);
+ Py_INCREF(__pyx_v_high);
+ Py_INCREF(__pyx_v_size);
arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":608
- * cdef long i
- *
- * if high is None: # <<<<<<<<<<<<<<
- * lo = 0
- * hi = low
- */
- __pyx_1 = (__pyx_v_high == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":608 */
+ __pyx_1 = __pyx_v_high == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":609
- *
- * if high is None:
- * lo = 0 # <<<<<<<<<<<<<<
- * hi = low
- * else:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":609 */
__pyx_v_lo = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":610
- * if high is None:
- * lo = 0
- * hi = low # <<<<<<<<<<<<<<
- * 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 = 610; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":610 */
+ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}
__pyx_v_hi = __pyx_2;
- goto __pyx_L4;
+ goto __pyx_L2;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":612
- * hi = low
- * else:
- * lo = low # <<<<<<<<<<<<<<
- * 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 = 612; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":612 */
+ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; goto __pyx_L1;}
__pyx_v_lo = __pyx_2;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":613
- * else:
- * lo = low
- * hi = high # <<<<<<<<<<<<<<
- *
- * 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 = 613; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":613 */
+ __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;}
__pyx_v_hi = __pyx_2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":615
- * hi = high
- *
- * diff = hi - lo - 1 # <<<<<<<<<<<<<<
- * if diff < 0:
- * raise ValueError("low >= high")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":615 */
__pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":616
- *
- * diff = hi - lo - 1
- * if diff < 0: # <<<<<<<<<<<<<<
- * raise ValueError("low >= high")
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":616 */
__pyx_1 = (__pyx_v_diff < 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":617
- * diff = hi - lo - 1
- * if diff < 0:
- * raise ValueError("low >= high") # <<<<<<<<<<<<<<
- *
- * if size is None:
- */
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_28p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_28p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
+ Py_INCREF(__pyx_k71p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);
+ __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":619
- * raise ValueError("low >= high")
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return <long>rk_interval(diff, self.internal_state) + lo
- * else:
- */
- __pyx_1 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":619 */
+ __pyx_1 = __pyx_v_size == Py_None;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":620
- *
- * if size is None:
- * return <long>rk_interval(diff, self.internal_state) + lo # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>_sp.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 = 620; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; goto __pyx_L1;}
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;
- goto __pyx_L6;
+ goto __pyx_L4;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":622
- * return <long>rk_interval(diff, self.internal_state) + lo
- * else:
- * array = <ndarray>_sp.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":622 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
@@ -4286,55 +2473,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self,
arrayObject = ((PyArrayObject *)__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":623
- * else:
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":623 */
__pyx_v_length = PyArray_SIZE(arrayObject);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":624
- * array = <ndarray>_sp.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = lo + <long>rk_interval(diff, self.internal_state)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":624 */
__pyx_v_array_data = ((long *)arrayObject->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":625
- * length = PyArray_SIZE(array)
- * array_data = <long *>array.data
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = lo + <long>rk_interval(diff, self.internal_state)
- * return array
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; __pyx_v_i++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":626
- * array_data = <long *>array.data
- * for i from 0 <= i < length:
- * array_data[i] = lo + <long>rk_interval(diff, self.internal_state) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":625 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {
+ (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":627
- * for i from 0 <= i < length:
- * array_data[i] = lo + <long>rk_interval(diff, self.internal_state)
- * return array # <<<<<<<<<<<<<<
- *
- * def bytes(self, unsigned int length):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":627 */
Py_INCREF(((PyObject *)arrayObject));
__pyx_r = ((PyObject *)arrayObject);
goto __pyx_L0;
}
- __pyx_L6:;
+ __pyx_L4:;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
@@ -4343,75 +2498,42 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randint(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.randint");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_low);
+ Py_DECREF(__pyx_v_high);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":629
- * return array
- *
- * def bytes(self, unsigned int length): # <<<<<<<<<<<<<<
- * """Return random bytes.
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_bytes[] = "Return random bytes.\n\n bytes(length) -> str\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_length) {
+static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
unsigned int __pyx_v_length;
void *__pyx_v_bytes;
PyObject *__pyx_v_bytestring;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
- 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 = 629; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.bytes");
- return NULL;
- __pyx_L3:;
+ static char *__pyx_argnames[] = {"length",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "I", __pyx_argnames, &__pyx_v_length)) return 0;
+ Py_INCREF(__pyx_v_self);
__pyx_v_bytestring = Py_None; Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":635
- * """
- * cdef void *bytes
- * bytestring = PyString_FromStringAndSize(NULL, length) # <<<<<<<<<<<<<<
- * 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 = 635; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":635 */
+ __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;}
Py_DECREF(__pyx_v_bytestring);
__pyx_v_bytestring = __pyx_1;
__pyx_1 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":636
- * cdef void *bytes
- * bytestring = PyString_FromStringAndSize(NULL, length)
- * bytes = PyString_AS_STRING(bytestring) # <<<<<<<<<<<<<<
- * rk_fill(bytes, length, self.internal_state)
- * return bytestring
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":636 */
__pyx_v_bytes = PyString_AS_STRING(__pyx_v_bytestring);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":637
- * bytestring = PyString_FromStringAndSize(NULL, length)
- * bytes = PyString_AS_STRING(bytestring)
- * rk_fill(bytes, length, self.internal_state) # <<<<<<<<<<<<<<
- * return bytestring
- *
- */
- rk_fill(__pyx_v_bytes, __pyx_v_length, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":638
- * bytes = PyString_AS_STRING(bytestring)
- * rk_fill(bytes, length, self.internal_state)
- * return bytestring # <<<<<<<<<<<<<<
- *
- * def uniform(self, low=0.0, high=1.0, size=None):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":637 */
+ rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":638 */
Py_INCREF(__pyx_v_bytestring);
__pyx_r = __pyx_v_bytestring;
goto __pyx_L0;
@@ -4421,25 +2543,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, Py
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("mtrand.RandomState.bytes");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_bytestring);
+ Py_DECREF(__pyx_v_self);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":640
- * return bytestring
- *
- * def uniform(self, low=0.0, high=1.0, size=None): # <<<<<<<<<<<<<<
- * """Uniform distribution over [low, high).
- *
- */
-
static PyObject *__pyx_n_subtract;
-static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_uniform[] = "Uniform distribution over [low, high).\n\n uniform(low=0.0, high=1.0, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_low = 0;
PyObject *__pyx_v_high = 0;
PyObject *__pyx_v_size = 0;
@@ -4455,163 +2570,81 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self,
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"low","high","size",0};
- __pyx_v_low = __pyx_k_2;
- __pyx_v_high = __pyx_k_3;
- __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);
- }
- }
- }
- }
- 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 = 640; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.uniform");
- return NULL;
- __pyx_L3:;
+ __pyx_v_low = __pyx_k8;
+ __pyx_v_high = __pyx_k9;
+ __pyx_v_size = __pyx_k10;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_low);
+ Py_INCREF(__pyx_v_high);
+ Py_INCREF(__pyx_v_size);
__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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":649
- * cdef object temp
- *
- * flow = PyFloat_AsDouble(low) # <<<<<<<<<<<<<<
- * fhigh = PyFloat_AsDouble(high)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":649 */
__pyx_v_flow = PyFloat_AsDouble(__pyx_v_low);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":650
- *
- * flow = PyFloat_AsDouble(low)
- * fhigh = PyFloat_AsDouble(high) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":650 */
__pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":651
- * flow = PyFloat_AsDouble(low)
- * fhigh = PyFloat_AsDouble(high)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- * PyErr_Clear()
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":651 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":652
- * fhigh = PyFloat_AsDouble(high)
- * if not PyErr_Occurred():
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow) # <<<<<<<<<<<<<<
- * 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 = 652; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":653
- * if not PyErr_Occurred():
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED)
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":653 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":654
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- * PyErr_Clear()
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED)
- * temp = _sp.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 = 654; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":654 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":655
- * PyErr_Clear()
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED)
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * temp = _sp.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 = 655; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":655 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":656
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED)
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED)
- * temp = _sp.subtract(ohigh, olow) # <<<<<<<<<<<<<<
- * 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_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":656 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_temp);
__pyx_v_temp = __pyx_4;
__pyx_4 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":657
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED)
- * temp = _sp.subtract(ohigh, olow)
- * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting # <<<<<<<<<<<<<<
- * # rules because EnsureArray steals a reference
- * odiff = <ndarray>PyArray_EnsureArray(temp)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":657 */
Py_INCREF(__pyx_v_temp);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":659
- * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting
- * # rules because EnsureArray steals a reference
- * odiff = <ndarray>PyArray_EnsureArray(temp) # <<<<<<<<<<<<<<
- * 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 = 659; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":659 */
+ __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":660
- * # rules because EnsureArray steals a reference
- * odiff = <ndarray>PyArray_EnsureArray(temp)
- * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff) # <<<<<<<<<<<<<<
- *
- * 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 = 660; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":660 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -4623,88 +2656,67 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("mtrand.RandomState.uniform");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_olow);
Py_DECREF(__pyx_v_ohigh);
Py_DECREF(__pyx_v_odiff);
Py_DECREF(__pyx_v_temp);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_low);
+ Py_DECREF(__pyx_v_high);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":662
- * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff)
- *
- * def rand(self, *args): # <<<<<<<<<<<<<<
- * """Return an array of the given dimensions which is initialized to
- * random numbers from a uniform distribution in the range [0,1).
- */
-
static PyObject *__pyx_n_size;
-static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_rand[] = "Return an array of the given dimensions which is initialized to\n random numbers from a uniform distribution in the range [0,1).\n\n rand(d0, d1, ..., dn) -> random values\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.random_sample(shape_tuple).\n\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_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;
+ Py_ssize_t __pyx_1;
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;
+ PyObject *__pyx_6 = 0;
+ static char *__pyx_argnames[] = {0};
+ if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0, 0) < 0) return 0;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
+ Py_XDECREF(__pyx_args);
+ Py_XDECREF(__pyx_kwds);
+ Py_XDECREF(__pyx_v_args);
+ return 0;
}
- Py_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":673
- *
- * """
- * if len(args) == 0: # <<<<<<<<<<<<<<
- * return self.random_sample()
- * else:
- */
- __pyx_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_self);
+ __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}
__pyx_2 = (__pyx_1 == 0);
if (__pyx_2) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":674
- * """
- * if len(args) == 0:
- * return self.random_sample() # <<<<<<<<<<<<<<
- * else:
- * return self.random_sample(size=args)
- */
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
/*else*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":676
- * return self.random_sample()
- * else:
- * return self.random_sample(size=args) # <<<<<<<<<<<<<<
- *
- * def randn(self, *args):
- */
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyDict_SetItem(__pyx_4, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_empty_tuple, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;}
+ __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;}
+ if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;}
+ __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_r = __pyx_5;
- __pyx_5 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_r = __pyx_6;
+ __pyx_6 = 0;
goto __pyx_L0;
}
- __pyx_L4:;
+ __pyx_L2:;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
@@ -4712,84 +2724,60 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyO
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
+ Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("mtrand.RandomState.rand");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
- Py_DECREF(__pyx_v_args);
+ Py_XDECREF(__pyx_v_args);
+ Py_DECREF(__pyx_v_self);
+ Py_XDECREF(__pyx_args);
+ Py_XDECREF(__pyx_kwds);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":678
- * return self.random_sample(size=args)
- *
- * def randn(self, *args): # <<<<<<<<<<<<<<
- * """Returns zero-mean, unit-variance Gaussian random numbers in an
- * array of shape (d0, d1, ..., dn).
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_randn[] = "Returns zero-mean, unit-variance Gaussian random numbers in an\n array of shape (d0, d1, ..., dn).\n\n randn(d0, d1, ..., dn) -> random values\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 ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_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;
+ Py_ssize_t __pyx_1;
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;
+ static char *__pyx_argnames[] = {0};
+ if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0, 0) < 0) return 0;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
+ Py_XDECREF(__pyx_args);
+ Py_XDECREF(__pyx_kwds);
+ Py_XDECREF(__pyx_v_args);
+ return 0;
}
- Py_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":688
- * use numpy.random.standard_normal(shape_tuple).
- * """
- * if len(args) == 0: # <<<<<<<<<<<<<<
- * return self.standard_normal()
- * else:
- */
- __pyx_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_self);
+ __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; goto __pyx_L1;}
__pyx_2 = (__pyx_1 == 0);
if (__pyx_2) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":689
- * """
- * if len(args) == 0:
- * return self.standard_normal() # <<<<<<<<<<<<<<
- * else:
- * return self.standard_normal(args)
- */
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
/*else*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":691
- * return self.standard_normal()
- * else:
- * return self.standard_normal(args) # <<<<<<<<<<<<<<
- *
- * def random_integers(self, low, high=None, size=None):
- */
- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}
Py_INCREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_args);
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_5;
__pyx_5 = 0;
goto __pyx_L0;
}
- __pyx_L4:;
+ __pyx_L2:;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
@@ -4798,25 +2786,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, Py
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.randn");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
- Py_DECREF(__pyx_v_args);
+ Py_XDECREF(__pyx_v_args);
+ Py_DECREF(__pyx_v_self);
+ Py_XDECREF(__pyx_args);
+ Py_XDECREF(__pyx_kwds);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":693
- * return self.standard_normal(args)
- *
- * def random_integers(self, low, high=None, size=None): # <<<<<<<<<<<<<<
- * """Return random integers x such that low <= x <= high.
- *
- */
-
-static PyObject *__pyx_int_1;
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_random_integers[] = "Return random integers x such that low <= x <= high.\n\n random_integers(low, high=None, size=None) -> random values.\n\n If high is None, then 1 <= x <= low.\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_low = 0;
PyObject *__pyx_v_high = 0;
PyObject *__pyx_v_size = 0;
@@ -4826,84 +2807,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_
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);
- }
- }
- }
- 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 = 693; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.random_integers");
- return NULL;
- __pyx_L3:;
+ __pyx_v_high = __pyx_k11;
+ __pyx_v_size = __pyx_k12;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_low);
Py_INCREF(__pyx_v_high);
+ Py_INCREF(__pyx_v_size);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":700
- * If high is None, then 1 <= x <= low.
- * """
- * if high is None: # <<<<<<<<<<<<<<
- * high = low
- * low = 1
- */
- __pyx_1 = (__pyx_v_high == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":700 */
+ __pyx_1 = __pyx_v_high == Py_None;
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":701
- * """
- * if high is None:
- * high = low # <<<<<<<<<<<<<<
- * low = 1
- * return self.randint(low, high+1, size)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":701 */
Py_INCREF(__pyx_v_low);
Py_DECREF(__pyx_v_high);
__pyx_v_high = __pyx_v_low;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":702
- * if high is None:
- * high = low
- * low = 1 # <<<<<<<<<<<<<<
- * return self.randint(low, high+1, size)
- *
- */
- Py_INCREF(__pyx_int_1);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":702 */
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}
Py_DECREF(__pyx_v_low);
- __pyx_v_low = __pyx_int_1;
- goto __pyx_L4;
+ __pyx_v_low = __pyx_2;
+ __pyx_2 = 0;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":703
- * high = low
- * low = 1
- * return self.randint(low, high+1, size) # <<<<<<<<<<<<<<
- *
- * # Complicated, continuous distributions:
- */
- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyNumber_Add(__pyx_v_high, __pyx_int_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":703 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;}
+ __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;}
Py_INCREF(__pyx_v_low);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_low);
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
Py_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_size);
- __pyx_3 = 0;
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_r = __pyx_4;
+ __pyx_4 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -4913,51 +2859,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_random_integers(PyObject *__pyx_
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("mtrand.RandomState.random_integers");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_low);
Py_DECREF(__pyx_v_high);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":706
- *
- * # Complicated, continuous distributions:
- * def standard_normal(self, size=None): # <<<<<<<<<<<<<<
- * """Standard Normal distribution (mean=0, stdev=1).
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_standard_normal[] = "Standard Normal distribution (mean=0, stdev=1).\n\n standard_normal(size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_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);
- }
- }
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_normal");
- return NULL;
- __pyx_L3:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":711
- * standard_normal(size=None) -> random values
- * """
- * return cont0_array(self.internal_state, rk_gauss, size) # <<<<<<<<<<<<<<
- *
- * 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 = 711; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_v_size = __pyx_k13;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_size);
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -4967,31 +2889,25 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_normal(PyObject *__pyx_
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("mtrand.RandomState.standard_normal");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":713
- * return cont0_array(self.internal_state, rk_gauss, size)
- *
- * def normal(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Normal distribution (mean=loc, stdev=scale).
- *
- */
-
static PyObject *__pyx_n_any;
static PyObject *__pyx_n_less_equal;
-static PyObject *__pyx_k_30p;
-static PyObject *__pyx_k_31p;
+static PyObject *__pyx_k73p;
+static PyObject *__pyx_k74p;
-static char __pyx_k_30[] = "scale <= 0";
-static char __pyx_k_31[] = "scale <= 0";
+static char __pyx_k73[] = "scale <= 0";
+static char __pyx_k74[] = "scale <= 0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_normal[] = "Normal distribution (mean=loc, stdev=scale).\n\n normal(loc=0.0, scale=1.0, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_loc = 0;
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
@@ -5006,196 +2922,107 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"loc","scale","size",0};
- __pyx_v_loc = __pyx_k_4;
- __pyx_v_scale = __pyx_k_5;
- __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);
- }
- }
- }
- }
- 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 = 713; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.normal");
- return NULL;
- __pyx_L3:;
+ __pyx_v_loc = __pyx_k14;
+ __pyx_v_scale = __pyx_k15;
+ __pyx_v_size = __pyx_k16;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_loc);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":721
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":721 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":722
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":722 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":723
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":723 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":724
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":724 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":725
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 725; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_30p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_30p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; goto __pyx_L1;}
+ Py_INCREF(__pyx_k73p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k73p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":726
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 726; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":726 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":728
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":728 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":730
- * PyErr_Clear()
- *
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 730; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":730 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":731
- *
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 731; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":731 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":732
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale)
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":732 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale));
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":733
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 733; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_31p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_31p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;}
+ Py_INCREF(__pyx_k74p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":734
- * if _sp.any(_sp.less_equal(oscale, 0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * 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 = 734; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":734 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -5208,34 +3035,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, P
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.normal");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oloc);
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_loc);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":736
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale)
- *
- * def beta(self, a, b, size=None): # <<<<<<<<<<<<<<
- * """Beta distribution over [0, 1].
- *
- */
-
-static PyObject *__pyx_k_32p;
-static PyObject *__pyx_k_33p;
-static PyObject *__pyx_k_34p;
-static PyObject *__pyx_k_35p;
-
-static char __pyx_k_32[] = "a <= 0";
-static char __pyx_k_33[] = "b <= 0";
-static char __pyx_k_34[] = "a <= 0";
-static char __pyx_k_35[] = "b <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k75p;
+static PyObject *__pyx_k76p;
+static PyObject *__pyx_k77p;
+static PyObject *__pyx_k78p;
+
+static char __pyx_k75[] = "a <= 0";
+static char __pyx_k76[] = "b <= 0";
+static char __pyx_k77[] = "a <= 0";
+static char __pyx_k78[] = "b <= 0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_beta[] = "Beta distribution over [0, 1].\n\n beta(a, b, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_a = 0;
PyObject *__pyx_v_b = 0;
PyObject *__pyx_v_size = 0;
@@ -5250,269 +3073,157 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 736; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.beta");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k17;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_a);
+ Py_INCREF(__pyx_v_b);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":744
- * cdef double fa, fb
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * fb = PyFloat_AsDouble(b)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":744 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":745
- *
- * fa = PyFloat_AsDouble(a)
- * fb = PyFloat_AsDouble(b) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":745 */
__pyx_v_fb = PyFloat_AsDouble(__pyx_v_b);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":746
- * fa = PyFloat_AsDouble(a)
- * fb = PyFloat_AsDouble(b)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":746 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":747
- * fb = PyFloat_AsDouble(b)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * if fb <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":747 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":748
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * if fb <= 0:
- * raise ValueError("b <= 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_32p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_32p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}
+ Py_INCREF(__pyx_k75p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k75p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":749
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * if fb <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("b <= 0")
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":749 */
__pyx_1 = (__pyx_v_fb <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":750
- * raise ValueError("a <= 0")
- * if fb <= 0:
- * raise ValueError("b <= 0") # <<<<<<<<<<<<<<
- * 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 = 750; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_33p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_33p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}
+ Py_INCREF(__pyx_k76p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k76p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":751
- * if fb <= 0:
- * raise ValueError("b <= 0")
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb) # <<<<<<<<<<<<<<
- *
- * 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 = 751; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":751 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":753
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":753 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":755
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":755 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":756
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 756; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":756 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":757
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * if _sp.any(_sp.less_equal(ob, 0)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":757 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa));
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":758
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.less_equal(ob, 0)):
- * raise ValueError("b <= 0")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_34p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_34p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;}
+ Py_INCREF(__pyx_k77p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":759
- * if _sp.any(_sp.less_equal(oa, 0)):
- * raise ValueError("a <= 0")
- * if _sp.any(_sp.less_equal(ob, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("b <= 0")
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":759 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_ob));
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":760
- * raise ValueError("a <= 0")
- * if _sp.any(_sp.less_equal(ob, 0)):
- * raise ValueError("b <= 0") # <<<<<<<<<<<<<<
- * 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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_35p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_35p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;}
+ Py_INCREF(__pyx_k78p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k78p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":761
- * if _sp.any(_sp.less_equal(ob, 0)):
- * raise ValueError("b <= 0")
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob) # <<<<<<<<<<<<<<
- *
- * 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 = 761; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":761 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -5525,30 +3236,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyO
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.beta");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oa);
Py_DECREF(__pyx_v_ob);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_b);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":763
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- *
- * def exponential(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Exponential distribution.
- *
- */
-
-static PyObject *__pyx_k_36p;
-static PyObject *__pyx_k_37p;
+static PyObject *__pyx_k79p;
+static PyObject *__pyx_k80p;
-static char __pyx_k_36[] = "scale <= 0";
-static char __pyx_k_37[] = "scale <= 0";
+static char __pyx_k79[] = "scale <= 0";
+static char __pyx_k80[] = "scale <= 0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_exponential[] = "Exponential distribution.\n\n exponential(scale=1.0, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_oscale;
@@ -5560,170 +3267,94 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"scale","size",0};
- __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) <= 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);
- }
- }
- }
- 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 = 763; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.exponential");
- return NULL;
- __pyx_L3:;
+ __pyx_v_scale = __pyx_k18;
+ __pyx_v_size = __pyx_k19;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":771
- * cdef double fscale
- *
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":771 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":772
- *
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":772 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":773
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":773 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":774
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 774; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_36p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_36p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;}
+ Py_INCREF(__pyx_k79p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k79p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":775
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 775; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":775 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":777
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":777 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":779
- * PyErr_Clear()
- *
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 779; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":779 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":780
- *
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont1_array(self.internal_state, rk_exponential, size, oscale)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":780 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":781
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 781; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_37p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_37p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;}
+ Py_INCREF(__pyx_k80p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k80p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":782
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont1_array(self.internal_state, rk_exponential, size, oscale) # <<<<<<<<<<<<<<
- *
- * 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 = 782; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":782 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -5736,50 +3367,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_exponential(PyObject *__pyx_v_se
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.exponential");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":784
- * return cont1_array(self.internal_state, rk_exponential, size, oscale)
- *
- * def standard_exponential(self, size=None): # <<<<<<<<<<<<<<
- * """Standard exponential distribution (scale=1).
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = "Standard exponential distribution (scale=1).\n\n standard_exponential(size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_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);
- }
- }
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_exponential");
- return NULL;
- __pyx_L3:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":789
- * standard_exponential(size=None) -> random values
- * """
- * return cont0_array(self.internal_state, rk_standard_exponential, size) # <<<<<<<<<<<<<<
- *
- * 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 = 789; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_v_size = __pyx_k20;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_size);
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -5789,28 +3397,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_exponential(PyObject *_
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("mtrand.RandomState.standard_exponential");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":791
- * return cont0_array(self.internal_state, rk_standard_exponential, size)
- *
- * def standard_gamma(self, shape, size=None): # <<<<<<<<<<<<<<
- * """Standard Gamma distribution.
- *
- */
+static PyObject *__pyx_k81p;
+static PyObject *__pyx_k82p;
-static PyObject *__pyx_k_38p;
-static PyObject *__pyx_k_39p;
+static char __pyx_k81[] = "shape <= 0";
+static char __pyx_k82[] = "shape <= 0";
-static char __pyx_k_38[] = "shape <= 0";
-static char __pyx_k_39[] = "shape <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = "Standard Gamma distribution.\n\n standard_gamma(shape, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_shape = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_oshape;
@@ -5822,167 +3424,93 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v
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);
- }
- }
- 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 = 791; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_gamma");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k21;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_shape);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":799
- * cdef double fshape
- *
- * fshape = PyFloat_AsDouble(shape) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fshape <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":799 */
__pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":800
- *
- * fshape = PyFloat_AsDouble(shape)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":800 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":801
- * fshape = PyFloat_AsDouble(shape)
- * if not PyErr_Occurred():
- * if fshape <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":801 */
__pyx_1 = (__pyx_v_fshape <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":802
- * if not PyErr_Occurred():
- * if fshape <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * 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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_38p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_38p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}
+ Py_INCREF(__pyx_k81p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k81p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":803
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape) # <<<<<<<<<<<<<<
- *
- * 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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":803 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":805
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oshape, 0.0)):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":805 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":806
- *
- * PyErr_Clear()
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 806; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":806 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":807
- * PyErr_Clear()
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oshape, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":807 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":808
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * 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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_39p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_39p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}
+ Py_INCREF(__pyx_k82p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k82p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":809
- * if _sp.any(_sp.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0")
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) # <<<<<<<<<<<<<<
- *
- * 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 = 809; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":809 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -5995,33 +3523,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.standard_gamma");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oshape);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_shape);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":811
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- *
- * def gamma(self, shape, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Gamma distribution.
- *
- */
-
-static PyObject *__pyx_k_40p;
-static PyObject *__pyx_k_41p;
-static PyObject *__pyx_k_42p;
-static PyObject *__pyx_k_43p;
-
-static char __pyx_k_40[] = "shape <= 0";
-static char __pyx_k_41[] = "scale <= 0";
-static char __pyx_k_42[] = "shape <= 0";
-static char __pyx_k_43[] = "scale <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k83p;
+static PyObject *__pyx_k84p;
+static PyObject *__pyx_k85p;
+static PyObject *__pyx_k86p;
+
+static char __pyx_k83[] = "shape <= 0";
+static char __pyx_k84[] = "scale <= 0";
+static char __pyx_k85[] = "shape <= 0";
+static char __pyx_k86[] = "scale <= 0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_gamma[] = "Gamma distribution.\n\n gamma(shape, scale=1.0, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_shape = 0;
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
@@ -6036,274 +3559,158 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"shape","scale","size",0};
- __pyx_v_scale = __pyx_k_7;
- __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);
- }
- }
- }
- 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 = 811; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.gamma");
- return NULL;
- __pyx_L3:;
+ __pyx_v_scale = __pyx_k22;
+ __pyx_v_size = __pyx_k23;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_shape);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":819
- * cdef double fshape, fscale
- *
- * fshape = PyFloat_AsDouble(shape) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":819 */
__pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":820
- *
- * fshape = PyFloat_AsDouble(shape)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fshape <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":820 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":821
- * fshape = PyFloat_AsDouble(shape)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":821 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":822
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fshape <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * if fscale <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":822 */
__pyx_1 = (__pyx_v_fshape <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":823
- * if not PyErr_Occurred():
- * if fshape <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_40p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_40p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}
+ Py_INCREF(__pyx_k83p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k83p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":824
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":824 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":825
- * raise ValueError("shape <= 0")
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 825; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_41p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_41p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;}
+ Py_INCREF(__pyx_k84p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k84p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":826
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 826; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":826 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":828
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":828 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":829
- *
- * PyErr_Clear()
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 829; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":829 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":830
- * PyErr_Clear()
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":830 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":831
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oshape, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":831 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":832
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 832; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_42p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_42p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;}
+ Py_INCREF(__pyx_k85p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":833
- * if _sp.any(_sp.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0")
- * if _sp.any(_sp.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale)
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":833 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
- __pyx_3 = PyObject_Call(__pyx_5, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
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 = 833; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":834
- * raise ValueError("shape <= 0")
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 834; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_43p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k_43p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}
+ Py_INCREF(__pyx_k86p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k86p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":835
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) # <<<<<<<<<<<<<<
- *
- * 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 = 835; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":835 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6316,34 +3723,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, Py
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.gamma");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oshape);
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_shape);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":837
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale)
- *
- * def f(self, dfnum, dfden, size=None): # <<<<<<<<<<<<<<
- * """F distribution.
- *
- */
-
-static PyObject *__pyx_k_44p;
-static PyObject *__pyx_k_45p;
-static PyObject *__pyx_k_46p;
-static PyObject *__pyx_k_47p;
-
-static char __pyx_k_44[] = "shape <= 0";
-static char __pyx_k_45[] = "scale <= 0";
-static char __pyx_k_46[] = "dfnum <= 0";
-static char __pyx_k_47[] = "dfden <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k87p;
+static PyObject *__pyx_k88p;
+static PyObject *__pyx_k89p;
+static PyObject *__pyx_k90p;
+
+static char __pyx_k87[] = "shape <= 0";
+static char __pyx_k88[] = "scale <= 0";
+static char __pyx_k89[] = "dfnum <= 0";
+static char __pyx_k90[] = "dfden <= 0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_f[] = "F distribution.\n\n f(dfnum, dfden, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dfnum = 0;
PyObject *__pyx_v_dfden = 0;
PyObject *__pyx_v_size = 0;
@@ -6358,271 +3761,157 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 837; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.f");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k24;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_dfnum);
+ Py_INCREF(__pyx_v_dfden);
+ Py_INCREF(__pyx_v_size);
__pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":845
- * cdef double fdfnum, fdfden
- *
- * fdfnum = PyFloat_AsDouble(dfnum) # <<<<<<<<<<<<<<
- * fdfden = PyFloat_AsDouble(dfden)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":845 */
__pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":846
- *
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdfnum <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":846 */
__pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":847
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdfnum <= 0:
- * raise ValueError("shape <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":847 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":848
- * fdfden = PyFloat_AsDouble(dfden)
- * if not PyErr_Occurred():
- * if fdfnum <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * if fdfden <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":848 */
__pyx_1 = (__pyx_v_fdfnum <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":849
- * if not PyErr_Occurred():
- * if fdfnum <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if fdfden <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_44p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_44p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;}
+ Py_INCREF(__pyx_k87p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k87p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":850
- * if fdfnum <= 0:
- * raise ValueError("shape <= 0")
- * if fdfden <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":850 */
__pyx_1 = (__pyx_v_fdfden <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":851
- * raise ValueError("shape <= 0")
- * if fdfden <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 851; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_45p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_45p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;}
+ Py_INCREF(__pyx_k88p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k88p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":852
- * if fdfden <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden) # <<<<<<<<<<<<<<
- *
- * 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 = 852; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":852 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":854
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":854 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":856
- * PyErr_Clear()
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 856; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":856 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":857
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 857; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":857 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":858
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odfnum, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfnum <= 0")
- * if _sp.any(_sp.less_equal(odfden, 0.0)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":858 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":859
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odfnum, 0.0)):
- * raise ValueError("dfnum <= 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 859; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_46p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_46p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;}
+ Py_INCREF(__pyx_k89p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":860
- * if _sp.any(_sp.less_equal(odfnum, 0.0)):
- * raise ValueError("dfnum <= 0")
- * if _sp.any(_sp.less_equal(odfden, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfden <= 0")
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden)
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":860 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
- __pyx_3 = PyObject_Call(__pyx_5, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
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 = 860; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":861
- * raise ValueError("dfnum <= 0")
- * if _sp.any(_sp.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * 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 = 861; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_47p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k_47p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;}
+ Py_INCREF(__pyx_k90p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k90p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":862
- * if _sp.any(_sp.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) # <<<<<<<<<<<<<<
- *
- * 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 = 862; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":862 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -6635,40 +3924,36 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObje
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.f");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_odfnum);
Py_DECREF(__pyx_v_odfden);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_dfnum);
+ Py_DECREF(__pyx_v_dfden);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":864
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden)
- *
- * def noncentral_f(self, dfnum, dfden, nonc, size=None): # <<<<<<<<<<<<<<
- * """Noncentral F distribution.
- *
- */
-
static PyObject *__pyx_n_less;
-static PyObject *__pyx_k_48p;
-static PyObject *__pyx_k_49p;
-static PyObject *__pyx_k_50p;
-static PyObject *__pyx_k_51p;
-static PyObject *__pyx_k_52p;
-static PyObject *__pyx_k_53p;
-
-static char __pyx_k_48[] = "dfnum <= 1";
-static char __pyx_k_49[] = "dfden <= 0";
-static char __pyx_k_50[] = "nonc < 0";
-static char __pyx_k_51[] = "dfnum <= 1";
-static char __pyx_k_52[] = "dfden <= 0";
-static char __pyx_k_53[] = "nonc < 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k91p;
+static PyObject *__pyx_k92p;
+static PyObject *__pyx_k93p;
+static PyObject *__pyx_k94p;
+static PyObject *__pyx_k95p;
+static PyObject *__pyx_k96p;
+
+static char __pyx_k91[] = "dfnum <= 1";
+static char __pyx_k92[] = "dfden <= 0";
+static char __pyx_k93[] = "nonc < 0";
+static char __pyx_k94[] = "dfnum <= 1";
+static char __pyx_k95[] = "dfden <= 0";
+static char __pyx_k96[] = "nonc < 0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = "Noncentral F distribution.\n\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dfnum = 0;
PyObject *__pyx_v_dfden = 0;
PyObject *__pyx_v_nonc = 0;
@@ -6686,375 +3971,221 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3);
- }
- }
- 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 = 864; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.noncentral_f");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k25;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_dfnum);
+ Py_INCREF(__pyx_v_dfden);
+ Py_INCREF(__pyx_v_nonc);
+ Py_INCREF(__pyx_v_size);
__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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":872
- * cdef double fdfnum, fdfden, fnonc
- *
- * fdfnum = PyFloat_AsDouble(dfnum) # <<<<<<<<<<<<<<
- * fdfden = PyFloat_AsDouble(dfden)
- * fnonc = PyFloat_AsDouble(nonc)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":872 */
__pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":873
- *
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden) # <<<<<<<<<<<<<<
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":873 */
__pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":874
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden)
- * fnonc = PyFloat_AsDouble(nonc) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdfnum <= 1:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":874 */
__pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":875
- * fdfden = PyFloat_AsDouble(dfden)
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdfnum <= 1:
- * raise ValueError("dfnum <= 1")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":875 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":876
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- * if fdfnum <= 1: # <<<<<<<<<<<<<<
- * raise ValueError("dfnum <= 1")
- * if fdfden <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":876 */
__pyx_1 = (__pyx_v_fdfnum <= 1);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":877
- * if not PyErr_Occurred():
- * if fdfnum <= 1:
- * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<<
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_48p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_48p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
+ Py_INCREF(__pyx_k91p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k91p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":878
- * if fdfnum <= 1:
- * raise ValueError("dfnum <= 1")
- * if fdfden <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("dfden <= 0")
- * if fnonc < 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":878 */
__pyx_1 = (__pyx_v_fdfden <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":879
- * raise ValueError("dfnum <= 1")
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * if fnonc < 0:
- * raise ValueError("nonc < 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_49p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_49p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
+ Py_INCREF(__pyx_k92p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k92p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":880
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0")
- * if fnonc < 0: # <<<<<<<<<<<<<<
- * raise ValueError("nonc < 0")
- * return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":880 */
__pyx_1 = (__pyx_v_fnonc < 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":881
- * raise ValueError("dfden <= 0")
- * if fnonc < 0:
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * 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 = 881; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_50p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_50p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
+ Py_INCREF(__pyx_k93p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k93p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":883
- * raise ValueError("nonc < 0")
- * return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
- * fdfnum, fdfden, fnonc) # <<<<<<<<<<<<<<
- *
- * 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 = 882; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":882 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":885
- * fdfnum, fdfden, fnonc)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":885 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":887
- * PyErr_Clear()
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * 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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":887 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":888
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * 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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":888 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":889
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED)
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- *
- * if _sp.any(_sp.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 = 889; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":889 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":891
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED)
- *
- * if _sp.any(_sp.less_equal(odfnum, 1.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfnum <= 1")
- * if _sp.any(_sp.less_equal(odfden, 0.0)):
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":891 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":892
- *
- * if _sp.any(_sp.less_equal(odfnum, 1.0)):
- * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 892; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_51p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_51p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;}
+ Py_INCREF(__pyx_k94p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k94p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":893
- * if _sp.any(_sp.less_equal(odfnum, 1.0)):
- * raise ValueError("dfnum <= 1")
- * if _sp.any(_sp.less_equal(odfden, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfden <= 0")
- * if _sp.any(_sp.less(ononc, 0.0)):
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":893 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
__pyx_4 = 0;
- __pyx_2 = PyObject_Call(__pyx_5, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":894
- * raise ValueError("dfnum <= 1")
- * if _sp.any(_sp.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.less(ononc, 0.0)):
- * raise ValueError("nonc < 0")
- */
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_52p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k_52p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;}
+ Py_INCREF(__pyx_k95p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k95p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L9;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;}
+ goto __pyx_L7;
}
- __pyx_L9:;
+ __pyx_L7:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":895
- * if _sp.any(_sp.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- * if _sp.any(_sp.less(ononc, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("nonc < 0")
- * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":895 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_4 = PyObject_Call(__pyx_2, __pyx_5, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":896
- * raise ValueError("dfden <= 0")
- * if _sp.any(_sp.less(ononc, 0.0)):
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * 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 = 896; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_53p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_53p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;}
+ Py_INCREF(__pyx_k96p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L10;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;}
+ goto __pyx_L8;
}
- __pyx_L10:;
+ __pyx_L8:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":898
- * raise ValueError("nonc < 0")
- * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
- * odfden, ononc) # <<<<<<<<<<<<<<
- *
- * 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 = 897; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":897 */
+ __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 (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;}
__pyx_r = __pyx_5;
__pyx_5 = 0;
goto __pyx_L0;
@@ -7067,31 +4198,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_s
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.noncentral_f");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_odfnum);
Py_DECREF(__pyx_v_odfden);
Py_DECREF(__pyx_v_ononc);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_dfnum);
+ Py_DECREF(__pyx_v_dfden);
+ Py_DECREF(__pyx_v_nonc);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":900
- * odfden, ononc)
- *
- * def chisquare(self, df, size=None): # <<<<<<<<<<<<<<
- * """Chi^2 distribution.
- *
- */
+static PyObject *__pyx_k97p;
+static PyObject *__pyx_k98p;
-static PyObject *__pyx_k_54p;
-static PyObject *__pyx_k_55p;
+static char __pyx_k97[] = "df <= 0";
+static char __pyx_k98[] = "df <= 0";
-static char __pyx_k_54[] = "df <= 0";
-static char __pyx_k_55[] = "df <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_chisquare[] = "Chi^2 distribution.\n\n chisquare(df, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_df = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_odf;
@@ -7103,167 +4231,93 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self
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);
- }
- }
- 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 = 900; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.chisquare");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k26;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_df);
+ Py_INCREF(__pyx_v_size);
__pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":908
- * cdef double fdf
- *
- * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdf <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":908 */
__pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":909
- *
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":909 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":910
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred():
- * if fdf <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":910 */
__pyx_1 = (__pyx_v_fdf <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":911
- * if not PyErr_Occurred():
- * if fdf <= 0:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * 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 = 911; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_54p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_54p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; goto __pyx_L1;}
+ Py_INCREF(__pyx_k97p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k97p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":912
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf) # <<<<<<<<<<<<<<
- *
- * 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 = 912; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":912 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":914
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":914 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":916
- * PyErr_Clear()
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 916; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":916 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":917
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odf, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_chisquare, size, odf)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":917 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":918
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * 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 = 918; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_55p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_55p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}
+ Py_INCREF(__pyx_k98p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k98p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":919
- * if _sp.any(_sp.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_chisquare, size, odf) # <<<<<<<<<<<<<<
- *
- * 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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":919 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -7276,33 +4330,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.chisquare");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_odf);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_df);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":921
- * return cont1_array(self.internal_state, rk_chisquare, size, odf)
- *
- * def noncentral_chisquare(self, df, nonc, size=None): # <<<<<<<<<<<<<<
- * """Noncentral Chi^2 distribution.
- *
- */
-
-static PyObject *__pyx_k_56p;
-static PyObject *__pyx_k_57p;
-static PyObject *__pyx_k_58p;
-static PyObject *__pyx_k_59p;
-
-static char __pyx_k_56[] = "df <= 0";
-static char __pyx_k_57[] = "nonc <= 0";
-static char __pyx_k_58[] = "df <= 1";
-static char __pyx_k_59[] = "nonc < 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k99p;
+static PyObject *__pyx_k100p;
+static PyObject *__pyx_k101p;
+static PyObject *__pyx_k102p;
+
+static char __pyx_k99[] = "df <= 0";
+static char __pyx_k100[] = "nonc <= 0";
+static char __pyx_k101[] = "df <= 1";
+static char __pyx_k102[] = "nonc < 0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = "Noncentral Chi^2 distribution.\n\n noncentral_chisquare(df, nonc, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_df = 0;
PyObject *__pyx_v_nonc = 0;
PyObject *__pyx_v_size = 0;
@@ -7317,271 +4366,157 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 921; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k27;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_df);
+ Py_INCREF(__pyx_v_nonc);
+ Py_INCREF(__pyx_v_size);
__pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":928
- * cdef ndarray odf, ononc
- * cdef double fdf, fnonc
- * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<<
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":928 */
__pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":929
- * cdef double fdf, fnonc
- * fdf = PyFloat_AsDouble(df)
- * fnonc = PyFloat_AsDouble(nonc) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdf <= 1:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":929 */
__pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":930
- * fdf = PyFloat_AsDouble(df)
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdf <= 1:
- * raise ValueError("df <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":930 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":931
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- * if fdf <= 1: # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * if fnonc <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":931 */
__pyx_1 = (__pyx_v_fdf <= 1);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":932
- * if not PyErr_Occurred():
- * if fdf <= 1:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * if fnonc <= 0:
- * raise ValueError("nonc <= 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_56p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_56p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}
+ Py_INCREF(__pyx_k99p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k99p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":933
- * if fdf <= 1:
- * raise ValueError("df <= 0")
- * if fnonc <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("nonc <= 0")
- * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":933 */
__pyx_1 = (__pyx_v_fnonc <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":934
- * raise ValueError("df <= 0")
- * if fnonc <= 0:
- * raise ValueError("nonc <= 0") # <<<<<<<<<<<<<<
- * 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 = 934; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_57p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_57p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}
+ Py_INCREF(__pyx_k100p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k100p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":936
- * raise ValueError("nonc <= 0")
- * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
- * size, fdf, fnonc) # <<<<<<<<<<<<<<
- *
- * 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 = 935; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":935 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":938
- * size, fdf, fnonc)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":938 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":940
- * PyErr_Clear()
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 940; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":940 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":941
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 941; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":941 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":942
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odf, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("df <= 1")
- * if _sp.any(_sp.less_equal(ononc, 0.0)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":942 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":943
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odf, 0.0)):
- * raise ValueError("df <= 1") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 943; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_58p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_58p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}
+ Py_INCREF(__pyx_k101p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":944
- * if _sp.any(_sp.less_equal(odf, 0.0)):
- * raise ValueError("df <= 1")
- * if _sp.any(_sp.less_equal(ononc, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("nonc < 0")
- * return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":944 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
- __pyx_3 = PyObject_Call(__pyx_5, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
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 = 944; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":945
- * raise ValueError("df <= 1")
- * if _sp.any(_sp.less_equal(ononc, 0.0)):
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * 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 = 945; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_59p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k_59p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}
+ Py_INCREF(__pyx_k102p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k102p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":947
- * raise ValueError("nonc < 0")
- * return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
- * odf, ononc) # <<<<<<<<<<<<<<
- *
- * 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 = 946; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":946 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -7594,51 +4529,29 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_noncentral_chisquare(PyObject *_
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_odf);
Py_DECREF(__pyx_v_ononc);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_df);
+ Py_DECREF(__pyx_v_nonc);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":949
- * odf, ononc)
- *
- * def standard_cauchy(self, size=None): # <<<<<<<<<<<<<<
- * """Standard Cauchy with mode=0.
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = "Standard Cauchy with mode=0.\n\n standard_cauchy(size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_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);
- }
- }
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_cauchy");
- return NULL;
- __pyx_L3:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":954
- * standard_cauchy(size=None)
- * """
- * return cont0_array(self.internal_state, rk_standard_cauchy, size) # <<<<<<<<<<<<<<
- *
- * 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 = 954; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_v_size = __pyx_k28;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_size);
+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -7648,28 +4561,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("mtrand.RandomState.standard_cauchy");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":956
- * return cont0_array(self.internal_state, rk_standard_cauchy, size)
- *
- * def standard_t(self, df, size=None): # <<<<<<<<<<<<<<
- * """Standard Student's t distribution with df degrees of freedom.
- *
- */
+static PyObject *__pyx_k103p;
+static PyObject *__pyx_k104p;
-static PyObject *__pyx_k_60p;
-static PyObject *__pyx_k_61p;
+static char __pyx_k103[] = "df <= 0";
+static char __pyx_k104[] = "df <= 0";
-static char __pyx_k_60[] = "df <= 0";
-static char __pyx_k_61[] = "df <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_standard_t[] = "Standard Student\'s t distribution with df degrees of freedom.\n\n standard_t(df, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_df = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_odf;
@@ -7681,167 +4588,93 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel
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);
- }
- }
- 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 = 956; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_t");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k29;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_df);
+ Py_INCREF(__pyx_v_size);
__pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":964
- * cdef double fdf
- *
- * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdf <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":964 */
__pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":965
- *
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":965 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":966
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred():
- * if fdf <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":966 */
__pyx_1 = (__pyx_v_fdf <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":967
- * if not PyErr_Occurred():
- * if fdf <= 0:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * 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 = 967; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_60p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_60p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;}
+ Py_INCREF(__pyx_k103p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k103p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":968
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf) # <<<<<<<<<<<<<<
- *
- * 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 = 968; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":968 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":970
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":970 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":972
- * PyErr_Clear()
- *
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 972; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":972 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":973
- *
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odf, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_standard_t, size, odf)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":973 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":974
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * 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 = 974; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_61p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_61p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;}
+ Py_INCREF(__pyx_k104p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k104p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":975
- * if _sp.any(_sp.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_standard_t, size, odf) # <<<<<<<<<<<<<<
- *
- * 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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":975 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -7854,29 +4687,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_sel
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.standard_t");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_odf);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_df);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":977
- * return cont1_array(self.internal_state, rk_standard_t, size, odf)
- *
- * def vonmises(self, mu, kappa, size=None): # <<<<<<<<<<<<<<
- * """von Mises circular distribution with mode mu and dispersion parameter
- * kappa on [-pi, pi].
- */
-
-static PyObject *__pyx_k_62p;
-static PyObject *__pyx_k_63p;
+static PyObject *__pyx_k105p;
+static PyObject *__pyx_k106p;
-static char __pyx_k_62[] = "kappa < 0";
-static char __pyx_k_63[] = "kappa < 0";
+static char __pyx_k105[] = "kappa < 0";
+static char __pyx_k106[] = "kappa < 0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_vonmises[] = "von Mises circular distribution with mode mu and dispersion parameter\n kappa on [-pi, pi].\n\n vonmises(mu, kappa, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mu = 0;
PyObject *__pyx_v_kappa = 0;
PyObject *__pyx_v_size = 0;
@@ -7891,191 +4719,105 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 977; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.vonmises");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k30;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_mu);
+ Py_INCREF(__pyx_v_kappa);
+ Py_INCREF(__pyx_v_size);
__pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":986
- * cdef double fmu, fkappa
- *
- * fmu = PyFloat_AsDouble(mu) # <<<<<<<<<<<<<<
- * fkappa = PyFloat_AsDouble(kappa)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":986 */
__pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":987
- *
- * fmu = PyFloat_AsDouble(mu)
- * fkappa = PyFloat_AsDouble(kappa) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fkappa < 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":987 */
__pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":988
- * fmu = PyFloat_AsDouble(mu)
- * fkappa = PyFloat_AsDouble(kappa)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fkappa < 0:
- * raise ValueError("kappa < 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":988 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":989
- * fkappa = PyFloat_AsDouble(kappa)
- * if not PyErr_Occurred():
- * if fkappa < 0: # <<<<<<<<<<<<<<
- * raise ValueError("kappa < 0")
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":989 */
__pyx_1 = (__pyx_v_fkappa < 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":990
- * if not PyErr_Occurred():
- * if fkappa < 0:
- * raise ValueError("kappa < 0") # <<<<<<<<<<<<<<
- * 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 = 990; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_62p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_62p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;}
+ Py_INCREF(__pyx_k105p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k105p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":991
- * if fkappa < 0:
- * raise ValueError("kappa < 0")
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa) # <<<<<<<<<<<<<<
- *
- * 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 = 991; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":991 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":993
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":993 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":995
- * PyErr_Clear()
- *
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 995; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":995 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":996
- *
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED)
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 996; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":996 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":997
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED)
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(okappa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("kappa < 0")
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa)
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":997 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":998
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(okappa, 0.0)):
- * raise ValueError("kappa < 0") # <<<<<<<<<<<<<<
- * 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 = 998; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_63p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_63p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;}
+ Py_INCREF(__pyx_k106p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":999
- * if _sp.any(_sp.less(okappa, 0.0)):
- * raise ValueError("kappa < 0")
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) # <<<<<<<<<<<<<<
- *
- * 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 = 999; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":999 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -8088,30 +4830,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.vonmises");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_omu);
Py_DECREF(__pyx_v_okappa);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_mu);
+ Py_DECREF(__pyx_v_kappa);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1001
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa)
- *
- * def pareto(self, a, size=None): # <<<<<<<<<<<<<<
- * """Pareto distribution.
- *
- */
+static PyObject *__pyx_k107p;
+static PyObject *__pyx_k108p;
-static PyObject *__pyx_k_64p;
-static PyObject *__pyx_k_65p;
+static char __pyx_k107[] = "a <= 0";
+static char __pyx_k108[] = "a <= 0";
-static char __pyx_k_64[] = "a <= 0";
-static char __pyx_k_65[] = "a <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_pareto[] = "Pareto distribution.\n\n pareto(a, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_a = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_oa;
@@ -8123,167 +4861,93 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P
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);
- }
- }
- 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 = 1001; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.pareto");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k31;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_a);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1009
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1009 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1010
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1010 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1011
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1011 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1012
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * 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 = 1012; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_64p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_64p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; goto __pyx_L1;}
+ Py_INCREF(__pyx_k107p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k107p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1013
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa) # <<<<<<<<<<<<<<
- *
- * 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 = 1013; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1013 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1015
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1015 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1017
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1017; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1017 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1018
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_pareto, size, oa)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1018 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1019
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * 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 = 1019; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_65p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_65p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;}
+ Py_INCREF(__pyx_k108p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k108p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1020
- * if _sp.any(_sp.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_pareto, size, oa) # <<<<<<<<<<<<<<
- *
- * 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 = 1020; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1020 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -8296,29 +4960,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, P
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.pareto");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oa);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1022
- * return cont1_array(self.internal_state, rk_pareto, size, oa)
- *
- * def weibull(self, a, size=None): # <<<<<<<<<<<<<<
- * """Weibull distribution.
- *
- */
+static PyObject *__pyx_k109p;
+static PyObject *__pyx_k110p;
-static PyObject *__pyx_k_66p;
-static PyObject *__pyx_k_67p;
+static char __pyx_k109[] = "a <= 0";
+static char __pyx_k110[] = "a <= 0";
-static char __pyx_k_66[] = "a <= 0";
-static char __pyx_k_67[] = "a <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_weibull[] = "Weibull distribution.\n\n weibull(a, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_a = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_oa;
@@ -8330,167 +4989,93 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self,
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);
- }
- }
- 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 = 1022; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.weibull");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k32;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_a);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1030
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1030 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1031
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1031 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1032
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1032 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1033
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * 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 = 1033; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_66p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_66p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; goto __pyx_L1;}
+ Py_INCREF(__pyx_k109p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k109p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1034
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa) # <<<<<<<<<<<<<<
- *
- * 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 = 1034; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1034 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1036
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1036 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1038
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1038; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1038 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1039
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_weibull, size, oa)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1039 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1040
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * 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 = 1040; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_67p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_67p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;}
+ Py_INCREF(__pyx_k110p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k110p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1041
- * if _sp.any(_sp.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_weibull, size, oa) # <<<<<<<<<<<<<<
- *
- * 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 = 1041; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1041 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -8503,29 +5088,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.weibull");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oa);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1043
- * return cont1_array(self.internal_state, rk_weibull, size, oa)
- *
- * def power(self, a, size=None): # <<<<<<<<<<<<<<
- * """Power distribution.
- *
- */
-
-static PyObject *__pyx_k_68p;
-static PyObject *__pyx_k_69p;
+static PyObject *__pyx_k111p;
+static PyObject *__pyx_k112p;
-static char __pyx_k_68[] = "a <= 0";
-static char __pyx_k_69[] = "a <= 0";
+static char __pyx_k111[] = "a <= 0";
+static char __pyx_k112[] = "a <= 0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_power[] = "Power distribution.\n\n power(a, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_a = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_oa;
@@ -8537,167 +5117,93 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py
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);
- }
- }
- 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 = 1043; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.power");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k33;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_a);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1051
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1051 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1052
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1052 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1053
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_power, size, fa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1053 */
__pyx_1 = (__pyx_v_fa <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1054
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * 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 = 1054; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_68p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_68p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;}
+ Py_INCREF(__pyx_k111p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k111p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1055
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_power, size, fa) # <<<<<<<<<<<<<<
- *
- * 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 = 1055; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1055 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1057
- * return cont1_array_sc(self.internal_state, rk_power, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1057 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1059
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1059; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1059 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1060
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_power, size, oa)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1060 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1061
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * 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 = 1061; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_69p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_69p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;}
+ Py_INCREF(__pyx_k112p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1062
- * if _sp.any(_sp.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_power, size, oa) # <<<<<<<<<<<<<<
- *
- * 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 = 1062; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1062 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -8710,29 +5216,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_power(PyObject *__pyx_v_self, Py
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.power");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oa);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1064
- * return cont1_array(self.internal_state, rk_power, size, oa)
- *
- * def laplace(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Laplace distribution.
- *
- */
+static PyObject *__pyx_k113p;
+static PyObject *__pyx_k114p;
-static PyObject *__pyx_k_70p;
-static PyObject *__pyx_k_71p;
+static char __pyx_k113[] = "scale <= 0";
+static char __pyx_k114[] = "scale <= 0";
-static char __pyx_k_70[] = "scale <= 0";
-static char __pyx_k_71[] = "scale <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_laplace[] = "Laplace distribution.\n\n laplace(loc=0.0, scale=1.0, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_loc = 0;
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
@@ -8747,197 +5248,107 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self,
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"loc","scale","size",0};
- __pyx_v_loc = __pyx_k_8;
- __pyx_v_scale = __pyx_k_9;
- __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);
- }
- }
- }
- }
- 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 = 1064; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.laplace");
- return NULL;
- __pyx_L3:;
+ __pyx_v_loc = __pyx_k34;
+ __pyx_v_scale = __pyx_k35;
+ __pyx_v_size = __pyx_k36;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_loc);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1072
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1072 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1073
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1073 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1074
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1074 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1075
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1075 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1076
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1076; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_70p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_70p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
+ Py_INCREF(__pyx_k113p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1077
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1077; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1077 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1079
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1079 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1080
- *
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1080; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1080 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oloc));
__pyx_v_oloc = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1081
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1081; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1081 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
__pyx_v_oscale = ((PyArrayObject *)__pyx_2);
__pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1082
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1082 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1083
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1083; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_71p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_71p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;}
+ Py_INCREF(__pyx_k114p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1084
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1084; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1084 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -8950,30 +5361,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.laplace");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oloc);
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_loc);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1086
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- *
- * def gumbel(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Gumbel distribution.
- *
- */
+static PyObject *__pyx_k115p;
+static PyObject *__pyx_k116p;
-static PyObject *__pyx_k_72p;
-static PyObject *__pyx_k_73p;
+static char __pyx_k115[] = "scale <= 0";
+static char __pyx_k116[] = "scale <= 0";
-static char __pyx_k_72[] = "scale <= 0";
-static char __pyx_k_73[] = "scale <= 0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_gumbel[] = "Gumbel distribution.\n\n gumbel(loc=0.0, scale=1.0, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_loc = 0;
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
@@ -8988,197 +5395,107 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"loc","scale","size",0};
- __pyx_v_loc = __pyx_k_10;
- __pyx_v_scale = __pyx_k_11;
- __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);
- }
- }
- }
- }
- 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 = 1086; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.gumbel");
- return NULL;
- __pyx_L3:;
+ __pyx_v_loc = __pyx_k37;
+ __pyx_v_scale = __pyx_k38;
+ __pyx_v_size = __pyx_k39;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_loc);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1094
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1094 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1095
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1095 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1096
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1096 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1097
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1097 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1098
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1098; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_72p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_72p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;}
+ Py_INCREF(__pyx_k115p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k115p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1099
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1099; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1099 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1101
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1101 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1102
- *
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1102; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1102 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oloc));
__pyx_v_oloc = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1103
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1103; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1103 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
__pyx_v_oscale = ((PyArrayObject *)__pyx_2);
__pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1104
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1104 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1105
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1105; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_73p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_73p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
+ Py_INCREF(__pyx_k116p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1106
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1106; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1106 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -9191,30 +5508,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, P
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.gumbel");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oloc);
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_loc);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1108
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- *
- * def logistic(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Logistic distribution.
- *
- */
-
-static PyObject *__pyx_k_74p;
-static PyObject *__pyx_k_75p;
+static PyObject *__pyx_k117p;
+static PyObject *__pyx_k118p;
-static char __pyx_k_74[] = "scale <= 0";
-static char __pyx_k_75[] = "scale <= 0";
+static char __pyx_k117[] = "scale <= 0";
+static char __pyx_k118[] = "scale <= 0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_logistic[] = "Logistic distribution.\n\n logistic(loc=0.0, scale=1.0, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_loc = 0;
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
@@ -9229,197 +5542,107 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"loc","scale","size",0};
- __pyx_v_loc = __pyx_k_12;
- __pyx_v_scale = __pyx_k_13;
- __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);
- }
- }
- }
- }
- 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 = 1108; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.logistic");
- return NULL;
- __pyx_L3:;
+ __pyx_v_loc = __pyx_k40;
+ __pyx_v_scale = __pyx_k41;
+ __pyx_v_size = __pyx_k42;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_loc);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1116
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1116 */
__pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1117
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1117 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1118
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1118 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1119
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1119 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1120
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1120; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_74p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_74p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;}
+ Py_INCREF(__pyx_k117p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k117p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1121
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1121; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1121 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1123
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1123 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1124
- *
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1124; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1124 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oloc));
__pyx_v_oloc = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1125
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1125; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1125 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
__pyx_v_oscale = ((PyArrayObject *)__pyx_2);
__pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1126
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1126 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1127
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1127; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_75p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_75p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;}
+ Py_INCREF(__pyx_k118p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1128
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1128; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1128 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -9432,30 +5655,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.logistic");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oloc);
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_loc);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1130
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- *
- * def lognormal(self, mean=0.0, sigma=1.0, size=None): # <<<<<<<<<<<<<<
- * """Log-normal distribution.
- *
- */
-
-static PyObject *__pyx_k_76p;
-static PyObject *__pyx_k_77p;
+static PyObject *__pyx_k119p;
+static PyObject *__pyx_k120p;
-static char __pyx_k_76[] = "sigma <= 0";
-static char __pyx_k_77[] = "sigma <= 0.0";
+static char __pyx_k119[] = "sigma <= 0";
+static char __pyx_k120[] = "sigma <= 0.0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_lognormal[] = "Log-normal distribution.\n\n Note that the mean parameter is not the mean of this distribution, but\n the underlying normal distribution.\n\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\n\n lognormal(mean=0.0, sigma=1.0, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mean = 0;
PyObject *__pyx_v_sigma = 0;
PyObject *__pyx_v_size = 0;
@@ -9470,197 +5689,107 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"mean","sigma","size",0};
- __pyx_v_mean = __pyx_k_14;
- __pyx_v_sigma = __pyx_k_15;
- __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);
- }
- }
- }
- }
- 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 = 1130; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.lognormal");
- return NULL;
- __pyx_L3:;
+ __pyx_v_mean = __pyx_k43;
+ __pyx_v_sigma = __pyx_k44;
+ __pyx_v_size = __pyx_k45;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_mean);
+ Py_INCREF(__pyx_v_sigma);
+ Py_INCREF(__pyx_v_size);
__pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1143
- * cdef double fmean, fsigma
- *
- * fmean = PyFloat_AsDouble(mean) # <<<<<<<<<<<<<<
- * fsigma = PyFloat_AsDouble(sigma)
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1143 */
__pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1144
- *
- * fmean = PyFloat_AsDouble(mean)
- * fsigma = PyFloat_AsDouble(sigma) # <<<<<<<<<<<<<<
- *
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1144 */
__pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1146
- * fsigma = PyFloat_AsDouble(sigma)
- *
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fsigma <= 0:
- * raise ValueError("sigma <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1146 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1147
- *
- * if not PyErr_Occurred():
- * if fsigma <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("sigma <= 0")
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1147 */
__pyx_1 = (__pyx_v_fsigma <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1148
- * if not PyErr_Occurred():
- * if fsigma <= 0:
- * raise ValueError("sigma <= 0") # <<<<<<<<<<<<<<
- * 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 = 1148; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_76p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_76p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;}
+ Py_INCREF(__pyx_k119p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k119p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1149
- * if fsigma <= 0:
- * raise ValueError("sigma <= 0")
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma) # <<<<<<<<<<<<<<
- *
- * 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 = 1149; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1149 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1151
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1151 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1153
- * PyErr_Clear()
- *
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1153; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1153 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_omean));
__pyx_v_omean = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1154
- *
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED)
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1154; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1154 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_osigma));
__pyx_v_osigma = ((PyArrayObject *)__pyx_2);
__pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1155
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED)
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(osigma, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("sigma <= 0.0")
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1155 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1156
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(osigma, 0.0)):
- * raise ValueError("sigma <= 0.0") # <<<<<<<<<<<<<<
- * 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 = 1156; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_77p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_77p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;}
+ Py_INCREF(__pyx_k120p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1157
- * if _sp.any(_sp.less_equal(osigma, 0.0)):
- * raise ValueError("sigma <= 0.0")
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) # <<<<<<<<<<<<<<
- *
- * 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 = 1157; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1157 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -9673,30 +5802,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.lognormal");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_omean);
Py_DECREF(__pyx_v_osigma);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_mean);
+ Py_DECREF(__pyx_v_sigma);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1159
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- *
- * def rayleigh(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Rayleigh distribution.
- *
- */
+static PyObject *__pyx_k121p;
+static PyObject *__pyx_k122p;
-static PyObject *__pyx_k_78p;
-static PyObject *__pyx_k_79p;
+static char __pyx_k121[] = "scale <= 0";
+static char __pyx_k122[] = "scale <= 0.0";
-static char __pyx_k_78[] = "scale <= 0";
-static char __pyx_k_79[] = "scale <= 0.0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_rayleigh[] = "Rayleigh distribution.\n\n rayleigh(scale=1.0, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_oscale;
@@ -9708,170 +5833,94 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"scale","size",0};
- __pyx_v_scale = __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) <= 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);
- }
- }
- }
- 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 = 1159; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.rayleigh");
- return NULL;
- __pyx_L3:;
+ __pyx_v_scale = __pyx_k46;
+ __pyx_v_size = __pyx_k47;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1167
- * cdef double fscale
- *
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- *
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1167 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1169
- * fscale = PyFloat_AsDouble(scale)
- *
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1169 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1170
- *
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1170 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1171
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1171; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_78p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_78p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; goto __pyx_L1;}
+ Py_INCREF(__pyx_k121p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k121p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1172
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1172; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1172 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1174
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1174 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1176
- * PyErr_Clear()
- *
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1176; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1176 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1177
- *
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0.0")
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1177 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1178
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<<
- * 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 = 1178; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_79p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_79p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;}
+ Py_INCREF(__pyx_k122p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k122p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1179
- * if _sp.any(_sp.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0.0")
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1179; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1179 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -9884,33 +5933,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.rayleigh");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1181
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale)
- *
- * def wald(self, mean, scale, size=None): # <<<<<<<<<<<<<<
- * """Wald (inverse Gaussian) distribution.
- *
- */
-
-static PyObject *__pyx_k_80p;
-static PyObject *__pyx_k_81p;
-static PyObject *__pyx_k_82p;
-static PyObject *__pyx_k_83p;
-
-static char __pyx_k_80[] = "mean <= 0";
-static char __pyx_k_81[] = "scale <= 0";
-static char __pyx_k_82[] = "mean <= 0.0";
-static char __pyx_k_83[] = "scale <= 0.0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k123p;
+static PyObject *__pyx_k124p;
+static PyObject *__pyx_k125p;
+static PyObject *__pyx_k126p;
+
+static char __pyx_k123[] = "mean <= 0";
+static char __pyx_k124[] = "scale <= 0";
+static char __pyx_k125[] = "mean <= 0.0";
+static char __pyx_k126[] = "scale <= 0.0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_wald[] = "Wald (inverse Gaussian) distribution.\n\n wald(mean, scale, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mean = 0;
PyObject *__pyx_v_scale = 0;
PyObject *__pyx_v_size = 0;
@@ -9925,270 +5969,154 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 1181; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.wald");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k48;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_mean);
+ Py_INCREF(__pyx_v_scale);
+ Py_INCREF(__pyx_v_size);
__pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1189
- * cdef double fmean, fscale
- *
- * fmean = PyFloat_AsDouble(mean) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1189 */
__pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1190
- *
- * fmean = PyFloat_AsDouble(mean)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fmean <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1190 */
__pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1191
- * fmean = PyFloat_AsDouble(mean)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fmean <= 0:
- * raise ValueError("mean <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1191 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1192
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fmean <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("mean <= 0")
- * if fscale <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1192 */
__pyx_1 = (__pyx_v_fmean <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1193
- * if not PyErr_Occurred():
- * if fmean <= 0:
- * raise ValueError("mean <= 0") # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_80p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_80p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;}
+ Py_INCREF(__pyx_k123p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k123p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1194
- * if fmean <= 0:
- * raise ValueError("mean <= 0")
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1194 */
__pyx_1 = (__pyx_v_fscale <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1195
- * raise ValueError("mean <= 0")
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * 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 = 1195; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_81p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_81p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
+ Py_INCREF(__pyx_k124p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k124p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1196
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale) # <<<<<<<<<<<<<<
- *
- * 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 = 1196; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1196 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1198
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1198 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1199
- *
- * PyErr_Clear()
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1199; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1199 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_omean));
__pyx_v_omean = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1200
- * PyErr_Clear()
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1200; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1200 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_oscale));
__pyx_v_oscale = ((PyArrayObject *)__pyx_2);
__pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1201
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(omean,0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("mean <= 0.0")
- * elif _sp.any(_sp.less_equal(oscale,0.0)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1201 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1202
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(omean,0.0)):
- * raise ValueError("mean <= 0.0") # <<<<<<<<<<<<<<
- * elif _sp.any(_sp.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 = 1202; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_82p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_82p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;}
+ Py_INCREF(__pyx_k125p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;}
+ goto __pyx_L5;
}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1203
- * if _sp.any(_sp.less_equal(omean,0.0)):
- * raise ValueError("mean <= 0.0")
- * elif _sp.any(_sp.less_equal(oscale,0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0.0")
- * return cont2_array(self.internal_state, rk_wald, size, omean, oscale)
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
- __pyx_3 = PyObject_Call(__pyx_5, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
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 = 1203; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1204
- * raise ValueError("mean <= 0.0")
- * elif _sp.any(_sp.less_equal(oscale,0.0)):
- * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<<
- * 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 = 1204; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_83p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k_83p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;}
+ Py_INCREF(__pyx_k126p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k126p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1205
- * elif _sp.any(_sp.less_equal(oscale,0.0)):
- * raise ValueError("scale <= 0.0")
- * return cont2_array(self.internal_state, rk_wald, size, omean, oscale) # <<<<<<<<<<<<<<
- *
- *
- */
- __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 = 1205; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1205 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -10201,41 +6129,37 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyO
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.wald");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_omean);
Py_DECREF(__pyx_v_oscale);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_mean);
+ Py_DECREF(__pyx_v_scale);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1209
- *
- *
- * def triangular(self, left, mode, right, size=None): # <<<<<<<<<<<<<<
- * """Triangular distribution starting at left, peaking at mode, and
- * ending at right (left <= mode <= right).
- */
-
static PyObject *__pyx_n_greater;
static PyObject *__pyx_n_equal;
-static PyObject *__pyx_k_84p;
-static PyObject *__pyx_k_85p;
-static PyObject *__pyx_k_86p;
-static PyObject *__pyx_k_87p;
-static PyObject *__pyx_k_88p;
-static PyObject *__pyx_k_89p;
-
-static char __pyx_k_84[] = "left > mode";
-static char __pyx_k_85[] = "mode > right";
-static char __pyx_k_86[] = "left == right";
-static char __pyx_k_87[] = "left > mode";
-static char __pyx_k_88[] = "mode > right";
-static char __pyx_k_89[] = "left == right";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k127p;
+static PyObject *__pyx_k128p;
+static PyObject *__pyx_k129p;
+static PyObject *__pyx_k130p;
+static PyObject *__pyx_k131p;
+static PyObject *__pyx_k132p;
+
+static char __pyx_k127[] = "left > mode";
+static char __pyx_k128[] = "mode > right";
+static char __pyx_k129[] = "left == right";
+static char __pyx_k130[] = "left > mode";
+static char __pyx_k131[] = "mode > right";
+static char __pyx_k132[] = "left == right";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_triangular[] = "Triangular distribution starting at left, peaking at mode, and\n ending at right (left <= mode <= right).\n\n triangular(left, mode, right, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_left = 0;
PyObject *__pyx_v_mode = 0;
PyObject *__pyx_v_right = 0;
@@ -10253,372 +6177,218 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3);
- }
- }
- 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 = 1209; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.triangular");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k49;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_left);
+ Py_INCREF(__pyx_v_mode);
+ Py_INCREF(__pyx_v_right);
+ Py_INCREF(__pyx_v_size);
__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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1218
- * cdef double fleft, fmode, fright
- *
- * fleft = PyFloat_AsDouble(left) # <<<<<<<<<<<<<<
- * fright = PyFloat_AsDouble(right)
- * fmode = PyFloat_AsDouble(mode)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1218 */
__pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1219
- *
- * fleft = PyFloat_AsDouble(left)
- * fright = PyFloat_AsDouble(right) # <<<<<<<<<<<<<<
- * fmode = PyFloat_AsDouble(mode)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1219 */
__pyx_v_fright = PyFloat_AsDouble(__pyx_v_right);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1220
- * fleft = PyFloat_AsDouble(left)
- * fright = PyFloat_AsDouble(right)
- * fmode = PyFloat_AsDouble(mode) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fleft > fmode:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1220 */
__pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1221
- * fright = PyFloat_AsDouble(right)
- * fmode = PyFloat_AsDouble(mode)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fleft > fmode:
- * raise ValueError("left > mode")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1221 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1222
- * fmode = PyFloat_AsDouble(mode)
- * if not PyErr_Occurred():
- * if fleft > fmode: # <<<<<<<<<<<<<<
- * raise ValueError("left > mode")
- * if fmode > fright:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1222 */
__pyx_1 = (__pyx_v_fleft > __pyx_v_fmode);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1223
- * if not PyErr_Occurred():
- * if fleft > fmode:
- * raise ValueError("left > mode") # <<<<<<<<<<<<<<
- * if fmode > fright:
- * raise ValueError("mode > right")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_84p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_84p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
+ Py_INCREF(__pyx_k127p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k127p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1224
- * if fleft > fmode:
- * raise ValueError("left > mode")
- * if fmode > fright: # <<<<<<<<<<<<<<
- * raise ValueError("mode > right")
- * if fleft == fright:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1224 */
__pyx_1 = (__pyx_v_fmode > __pyx_v_fright);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1225
- * raise ValueError("left > mode")
- * if fmode > fright:
- * raise ValueError("mode > right") # <<<<<<<<<<<<<<
- * if fleft == fright:
- * raise ValueError("left == right")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_85p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_85p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;}
+ Py_INCREF(__pyx_k128p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k128p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1226
- * if fmode > fright:
- * raise ValueError("mode > right")
- * if fleft == fright: # <<<<<<<<<<<<<<
- * raise ValueError("left == right")
- * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft,
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1226 */
__pyx_1 = (__pyx_v_fleft == __pyx_v_fright);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1227
- * raise ValueError("mode > right")
- * if fleft == fright:
- * raise ValueError("left == right") # <<<<<<<<<<<<<<
- * 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 = 1227; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_86p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_86p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;}
+ Py_INCREF(__pyx_k129p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k129p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1229
- * raise ValueError("left == right")
- * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft,
- * fmode, fright) # <<<<<<<<<<<<<<
- *
- * 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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1228 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1231
- * fmode, fright)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED)
- * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1231 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1232
- *
- * PyErr_Clear()
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * 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 = 1232; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1232 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1233
- * PyErr_Clear()
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED)
- * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * 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 = 1233; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1233 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1234
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED)
- * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ALIGNED)
- * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- *
- * if _sp.any(_sp.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 = 1234; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1234 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1236
- * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ALIGNED)
- *
- * if _sp.any(_sp.greater(oleft, omode)): # <<<<<<<<<<<<<<
- * raise ValueError("left > mode")
- * if _sp.any(_sp.greater(omode, oright)):
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1236 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
__pyx_5 = 0;
- __pyx_2 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1237
- *
- * if _sp.any(_sp.greater(oleft, omode)):
- * raise ValueError("left > mode") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.greater(omode, oright)):
- * raise ValueError("mode > right")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_87p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_87p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;}
+ Py_INCREF(__pyx_k130p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k130p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1238
- * if _sp.any(_sp.greater(oleft, omode)):
- * raise ValueError("left > mode")
- * if _sp.any(_sp.greater(omode, oright)): # <<<<<<<<<<<<<<
- * raise ValueError("mode > right")
- * if _sp.any(_sp.equal(oleft, oright)):
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1238 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
__pyx_5 = 0;
- __pyx_4 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1239
- * raise ValueError("left > mode")
- * if _sp.any(_sp.greater(omode, oright)):
- * raise ValueError("mode > right") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.equal(oleft, oright)):
- * raise ValueError("left == right")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_88p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_88p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;}
+ Py_INCREF(__pyx_k131p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k131p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L9;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;}
+ goto __pyx_L7;
}
- __pyx_L9:;
+ __pyx_L7:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1240
- * if _sp.any(_sp.greater(omode, oright)):
- * raise ValueError("mode > right")
- * if _sp.any(_sp.equal(oleft, oright)): # <<<<<<<<<<<<<<
- * raise ValueError("left == right")
- * return cont3_array(self.internal_state, rk_triangular, size, oleft,
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1240 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
__pyx_5 = 0;
- __pyx_3 = PyObject_Call(__pyx_4, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
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 = 1240; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1241
- * raise ValueError("mode > right")
- * if _sp.any(_sp.equal(oleft, oright)):
- * raise ValueError("left == right") # <<<<<<<<<<<<<<
- * 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 = 1241; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_89p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_89p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;}
+ Py_INCREF(__pyx_k132p);
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k132p);
+ __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L10;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;}
+ goto __pyx_L8;
}
- __pyx_L10:;
+ __pyx_L8:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1243
- * raise ValueError("left == right")
- * return cont3_array(self.internal_state, rk_triangular, size, oleft,
- * omode, oright) # <<<<<<<<<<<<<<
- *
- * # 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 = 1242; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1242 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
@@ -10631,39 +6401,36 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_triangular(PyObject *__pyx_v_sel
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.triangular");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oleft);
Py_DECREF(__pyx_v_omode);
Py_DECREF(__pyx_v_oright);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_left);
+ Py_DECREF(__pyx_v_mode);
+ Py_DECREF(__pyx_v_right);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1246
- *
- * # Complicated, discrete distributions:
- * def binomial(self, n, p, size=None): # <<<<<<<<<<<<<<
- * """Binomial distribution of n trials and p probability of success.
- *
- */
-
-static PyObject *__pyx_k_90p;
-static PyObject *__pyx_k_91p;
-static PyObject *__pyx_k_92p;
-static PyObject *__pyx_k_93p;
-static PyObject *__pyx_k_94p;
-static PyObject *__pyx_k_95p;
-
-static char __pyx_k_90[] = "n <= 0";
-static char __pyx_k_91[] = "p < 0";
-static char __pyx_k_92[] = "p > 1";
-static char __pyx_k_93[] = "n <= 0";
-static char __pyx_k_94[] = "p < 0";
-static char __pyx_k_95[] = "p > 1";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k133p;
+static PyObject *__pyx_k134p;
+static PyObject *__pyx_k135p;
+static PyObject *__pyx_k136p;
+static PyObject *__pyx_k137p;
+static PyObject *__pyx_k138p;
+
+static char __pyx_k133[] = "n <= 0";
+static char __pyx_k134[] = "p < 0";
+static char __pyx_k135[] = "p > 1";
+static char __pyx_k136[] = "n <= 0";
+static char __pyx_k137[] = "p < 0";
+static char __pyx_k138[] = "p > 1";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_binomial[] = "Binomial distribution of n trials and p probability of success.\n\n binomial(n, p, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_n = 0;
PyObject *__pyx_v_p = 0;
PyObject *__pyx_v_size = 0;
@@ -10678,349 +6445,208 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 1246; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.binomial");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k50;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_n);
+ Py_INCREF(__pyx_v_p);
+ Py_INCREF(__pyx_v_size);
__pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1255
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1255 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1256
- *
- * fp = PyFloat_AsDouble(p)
- * ln = PyInt_AsLong(n) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if ln <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1256 */
__pyx_v_ln = PyInt_AsLong(__pyx_v_n);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1257
- * fp = PyFloat_AsDouble(p)
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if ln <= 0:
- * raise ValueError("n <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1257 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1258
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred():
- * if ln <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("n <= 0")
- * if fp < 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1258 */
__pyx_1 = (__pyx_v_ln <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1259
- * if not PyErr_Occurred():
- * if ln <= 0:
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if fp < 0:
- * raise ValueError("p < 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_90p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_90p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;}
+ Py_INCREF(__pyx_k133p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k133p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1260
- * if ln <= 0:
- * raise ValueError("n <= 0")
- * if fp < 0: # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * elif fp > 1:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1260 */
__pyx_1 = (__pyx_v_fp < 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1261
- * raise ValueError("n <= 0")
- * if fp < 0:
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * elif fp > 1:
- * raise ValueError("p > 1")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_91p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_91p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;}
+ Py_INCREF(__pyx_k134p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k134p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;}
+ goto __pyx_L4;
}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1262
- * if fp < 0:
- * raise ValueError("p < 0")
- * elif fp > 1: # <<<<<<<<<<<<<<
- * 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) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1263
- * raise ValueError("p < 0")
- * elif fp > 1:
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * 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 = 1263; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_92p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_92p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;}
+ Py_INCREF(__pyx_k135p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k135p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1264
- * elif fp > 1:
- * raise ValueError("p > 1")
- * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp) # <<<<<<<<<<<<<<
- *
- * 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 = 1264; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1264 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1266
- * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1266 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1268
- * PyErr_Clear()
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1268; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1268 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1269
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1269; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1269 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1270
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(n, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("n <= 0")
- * if _sp.any(_sp.less(p, 0)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1270 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1271
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(n, 0)):
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.less(p, 0)):
- * raise ValueError("p < 0")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_93p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_93p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;}
+ Py_INCREF(__pyx_k136p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1272
- * if _sp.any(_sp.less_equal(n, 0)):
- * raise ValueError("n <= 0")
- * if _sp.any(_sp.less(p, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * if _sp.any(_sp.greater(p, 1)):
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1272 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p);
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1273
- * raise ValueError("n <= 0")
- * if _sp.any(_sp.less(p, 0)):
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.greater(p, 1)):
- * raise ValueError("p > 1")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_94p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_94p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;}
+ Py_INCREF(__pyx_k137p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k137p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1274
- * if _sp.any(_sp.less(p, 0)):
- * raise ValueError("p < 0")
- * if _sp.any(_sp.greater(p, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("p > 1")
- * return discnp_array(self.internal_state, rk_binomial, size, on, op)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1274 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_2 = PyObject_Call(__pyx_4, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1275
- * raise ValueError("p < 0")
- * if _sp.any(_sp.greater(p, 1)):
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * 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 = 1275; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_95p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_95p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L9;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;}
+ Py_INCREF(__pyx_k138p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k138p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;}
+ goto __pyx_L7;
}
- __pyx_L9:;
+ __pyx_L7:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1276
- * if _sp.any(_sp.greater(p, 1)):
- * raise ValueError("p > 1")
- * return discnp_array(self.internal_state, rk_binomial, size, on, op) # <<<<<<<<<<<<<<
- *
- * 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 = 1276; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1276 */
+ __pyx_5 = __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 (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -11031,38 +6657,34 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.binomial");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_on);
Py_DECREF(__pyx_v_op);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_n);
+ Py_DECREF(__pyx_v_p);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1278
- * return discnp_array(self.internal_state, rk_binomial, size, on, op)
- *
- * def negative_binomial(self, n, p, size=None): # <<<<<<<<<<<<<<
- * """Negative Binomial distribution.
- *
- */
-
-static PyObject *__pyx_k_96p;
-static PyObject *__pyx_k_97p;
-static PyObject *__pyx_k_98p;
-static PyObject *__pyx_k_99p;
-static PyObject *__pyx_k_100p;
-static PyObject *__pyx_k_101p;
-
-static char __pyx_k_96[] = "n <= 0";
-static char __pyx_k_97[] = "p < 0";
-static char __pyx_k_98[] = "p > 1";
-static char __pyx_k_99[] = "n <= 0";
-static char __pyx_k_100[] = "p < 0";
-static char __pyx_k_101[] = "p > 1";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k139p;
+static PyObject *__pyx_k140p;
+static PyObject *__pyx_k141p;
+static PyObject *__pyx_k142p;
+static PyObject *__pyx_k143p;
+static PyObject *__pyx_k144p;
+
+static char __pyx_k139[] = "n <= 0";
+static char __pyx_k140[] = "p < 0";
+static char __pyx_k141[] = "p > 1";
+static char __pyx_k142[] = "n <= 0";
+static char __pyx_k143[] = "p < 0";
+static char __pyx_k144[] = "p > 1";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = "Negative Binomial distribution.\n\n negative_binomial(n, p, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_n = 0;
PyObject *__pyx_v_p = 0;
PyObject *__pyx_v_size = 0;
@@ -11077,349 +6699,208 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 1278; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.negative_binomial");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k51;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_n);
+ Py_INCREF(__pyx_v_p);
+ Py_INCREF(__pyx_v_size);
__pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1288
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1288 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1289
- *
- * fp = PyFloat_AsDouble(p)
- * ln = PyInt_AsLong(n) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if ln <= 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1289 */
__pyx_v_ln = PyInt_AsLong(__pyx_v_n);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1290
- * fp = PyFloat_AsDouble(p)
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if ln <= 0:
- * raise ValueError("n <= 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1290 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1291
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred():
- * if ln <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("n <= 0")
- * if fp < 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1291 */
__pyx_1 = (__pyx_v_ln <= 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1292
- * if not PyErr_Occurred():
- * if ln <= 0:
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if fp < 0:
- * raise ValueError("p < 0")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_96p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_96p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
+ Py_INCREF(__pyx_k139p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k139p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1293
- * if ln <= 0:
- * raise ValueError("n <= 0")
- * if fp < 0: # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * elif fp > 1:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1293 */
__pyx_1 = (__pyx_v_fp < 0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1294
- * raise ValueError("n <= 0")
- * if fp < 0:
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * elif fp > 1:
- * raise ValueError("p > 1")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_97p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_97p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
+ Py_INCREF(__pyx_k140p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k140p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
+ goto __pyx_L4;
}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1295
- * if fp < 0:
- * raise ValueError("p < 0")
- * elif fp > 1: # <<<<<<<<<<<<<<
- * raise ValueError("p > 1")
- * return discnp_array_sc(self.internal_state, rk_negative_binomial,
- */
__pyx_1 = (__pyx_v_fp > 1);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1296
- * raise ValueError("p < 0")
- * elif fp > 1:
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discnp_array_sc(self.internal_state, rk_negative_binomial,
- * size, ln, fp)
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_98p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_98p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;}
+ Py_INCREF(__pyx_k141p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k141p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1298
- * raise ValueError("p > 1")
- * return discnp_array_sc(self.internal_state, rk_negative_binomial,
- * size, ln, fp) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_ln, __pyx_v_fp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1297 */
+ __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1300
- * size, ln, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1300 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1302
- * PyErr_Clear()
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1302; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1302 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1303
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1303; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1303 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1304
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(n, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("n <= 0")
- * if _sp.any(_sp.less(p, 0)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1304 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
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, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1305
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(n, 0)):
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.less(p, 0)):
- * raise ValueError("p < 0")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_99p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_99p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;}
+ Py_INCREF(__pyx_k142p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1306
- * if _sp.any(_sp.less_equal(n, 0)):
- * raise ValueError("n <= 0")
- * if _sp.any(_sp.less(p, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * if _sp.any(_sp.greater(p, 1)):
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1306 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p);
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1307
- * raise ValueError("n <= 0")
- * if _sp.any(_sp.less(p, 0)):
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.greater(p, 1)):
- * raise ValueError("p > 1")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_100p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_100p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;}
+ Py_INCREF(__pyx_k143p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k143p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1308
- * if _sp.any(_sp.less(p, 0)):
- * raise ValueError("p < 0")
- * if _sp.any(_sp.greater(p, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("p > 1")
- * return discnp_array(self.internal_state, rk_negative_binomial, size,
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1308 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_2 = PyObject_Call(__pyx_4, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p);
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1309
- * raise ValueError("p < 0")
- * if _sp.any(_sp.greater(p, 1)):
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discnp_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 = 1309; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_101p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_101p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L9;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
+ Py_INCREF(__pyx_k144p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k144p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
+ goto __pyx_L7;
}
- __pyx_L9:;
+ __pyx_L7:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1311
- * raise ValueError("p > 1")
- * return discnp_array(self.internal_state, rk_negative_binomial, size,
- * on, op) # <<<<<<<<<<<<<<
- *
- * def poisson(self, lam=1.0, size=None):
- */
- __pyx_3 = __pyx_f_6mtrand_discnp_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 = 1310; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1310 */
+ __pyx_5 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;}
+ __pyx_r = __pyx_5;
+ __pyx_5 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -11430,30 +6911,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_negative_binomial(PyObject *__py
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.negative_binomial");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_on);
Py_DECREF(__pyx_v_op);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_n);
+ Py_DECREF(__pyx_v_p);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1313
- * on, op)
- *
- * def poisson(self, lam=1.0, size=None): # <<<<<<<<<<<<<<
- * """Poisson distribution.
- *
- */
-
-static PyObject *__pyx_k_102p;
-static PyObject *__pyx_k_103p;
+static PyObject *__pyx_k145p;
+static PyObject *__pyx_k146p;
-static char __pyx_k_102[] = "lam < 0";
-static char __pyx_k_103[] = "lam < 0";
+static char __pyx_k145[] = "lam < 0";
+static char __pyx_k146[] = "lam < 0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_poisson[] = "Poisson distribution.\n\n poisson(lam=1.0, size=None) -> random values\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_lam = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_olam;
@@ -11465,171 +6942,97 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self,
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"lam","size",0};
- __pyx_v_lam = __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_lam = PyTuple_GET_ITEM(__pyx_args, 0);
- if (PyTuple_GET_SIZE(__pyx_args) > 1) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1);
- }
- }
- }
- 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 = 1313; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.poisson");
- return NULL;
- __pyx_L3:;
+ __pyx_v_lam = __pyx_k52;
+ __pyx_v_size = __pyx_k53;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_lam);
+ Py_INCREF(__pyx_v_size);
__pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1320
- * cdef ndarray olam
- * cdef double flam
- * flam = PyFloat_AsDouble(lam) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if lam < 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1320 */
__pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1321
- * cdef double flam
- * flam = PyFloat_AsDouble(lam)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if lam < 0:
- * raise ValueError("lam < 0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1321 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1322
- * flam = PyFloat_AsDouble(lam)
- * if not PyErr_Occurred():
- * if lam < 0: # <<<<<<<<<<<<<<
- * 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 = 1322; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1322 */
+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;}
+ __pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1323
- * if not PyErr_Occurred():
- * if lam < 0:
- * raise ValueError("lam < 0") # <<<<<<<<<<<<<<
- * 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 = 1323; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_102p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_102p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;}
+ Py_INCREF(__pyx_k145p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k145p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1324
- * if lam < 0:
- * raise ValueError("lam < 0")
- * return discd_array_sc(self.internal_state, rk_poisson, size, flam) # <<<<<<<<<<<<<<
- *
- * 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 = 1324; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1324 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1326
- * return discd_array_sc(self.internal_state, rk_poisson, size, flam)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1326 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1328
- * PyErr_Clear()
- *
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1328; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1328 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1329
- *
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(olam, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("lam < 0")
- * return discd_array(self.internal_state, rk_poisson, size, olam)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1329 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_olam));
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_2 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1330
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(olam, 0)):
- * raise ValueError("lam < 0") # <<<<<<<<<<<<<<
- * 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 = 1330; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_103p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_103p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ Py_INCREF(__pyx_k146p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k146p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1331
- * if _sp.any(_sp.less(olam, 0)):
- * raise ValueError("lam < 0")
- * return discd_array(self.internal_state, rk_poisson, size, olam) # <<<<<<<<<<<<<<
- *
- * 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 = 1331; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1331 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -11642,29 +7045,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.poisson");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_olam);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_lam);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1333
- * return discd_array(self.internal_state, rk_poisson, size, olam)
- *
- * def zipf(self, a, size=None): # <<<<<<<<<<<<<<
- * """Zipf distribution.
- *
- */
-
-static PyObject *__pyx_k_104p;
-static PyObject *__pyx_k_105p;
+static PyObject *__pyx_k147p;
+static PyObject *__pyx_k148p;
-static char __pyx_k_104[] = "a <= 1.0";
-static char __pyx_k_105[] = "a <= 1.0";
+static char __pyx_k147[] = "a <= 1.0";
+static char __pyx_k148[] = "a <= 1.0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_zipf[] = "Zipf distribution.\n\n zipf(a, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_a = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_oa;
@@ -11676,167 +7074,93 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO
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);
- }
- }
- 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 = 1333; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.zipf");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k54;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_a);
+ Py_INCREF(__pyx_v_size);
__pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1341
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 1.0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1341 */
__pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1342
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 1.0:
- * raise ValueError("a <= 1.0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1342 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1343
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 1.0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 1.0")
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1343 */
__pyx_1 = (__pyx_v_fa <= 1.0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1344
- * if not PyErr_Occurred():
- * if fa <= 1.0:
- * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<<
- * 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 = 1344; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_104p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_104p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; goto __pyx_L1;}
+ Py_INCREF(__pyx_k147p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k147p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1345
- * if fa <= 1.0:
- * raise ValueError("a <= 1.0")
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa) # <<<<<<<<<<<<<<
- *
- * 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 = 1345; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1345 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1347
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1347 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1349
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1349; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1349 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1350
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 1.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 1.0")
- * return discd_array(self.internal_state, rk_zipf, size, oa)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1350 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1351
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less_equal(oa, 1.0)):
- * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<<
- * 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 = 1351; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_105p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_105p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;}
+ Py_INCREF(__pyx_k148p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k148p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1352
- * if _sp.any(_sp.less_equal(oa, 1.0)):
- * raise ValueError("a <= 1.0")
- * return discd_array(self.internal_state, rk_zipf, size, oa) # <<<<<<<<<<<<<<
- *
- * 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 = 1352; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1352 */
+ __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;}
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
@@ -11849,33 +7173,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyO
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.zipf");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_oa);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1354
- * return discd_array(self.internal_state, rk_zipf, size, oa)
- *
- * def geometric(self, p, size=None): # <<<<<<<<<<<<<<
- * """Geometric distribution with p being the probability of "success" on
- * an individual trial.
- */
-
-static PyObject *__pyx_k_106p;
-static PyObject *__pyx_k_107p;
-static PyObject *__pyx_k_108p;
-static PyObject *__pyx_k_109p;
-
-static char __pyx_k_106[] = "p < 0.0";
-static char __pyx_k_107[] = "p > 1.0";
-static char __pyx_k_108[] = "p < 0.0";
-static char __pyx_k_109[] = "p > 1.0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k149p;
+static PyObject *__pyx_k150p;
+static PyObject *__pyx_k151p;
+static PyObject *__pyx_k152p;
+
+static char __pyx_k149[] = "p < 0.0";
+static char __pyx_k150[] = "p > 1.0";
+static char __pyx_k151[] = "p < 0.0";
+static char __pyx_k152[] = "p > 1.0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_geometric[] = "Geometric distribution with p being the probability of \"success\" on\n an individual trial.\n\n geometric(p, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_p = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_op;
@@ -11887,247 +7206,145 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self
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);
- }
- }
- 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 = 1354; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.geometric");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k55;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_p);
+ Py_INCREF(__pyx_v_size);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1363
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fp < 0.0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1363 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1364
- *
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fp < 0.0:
- * raise ValueError("p < 0.0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1364 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1365
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred():
- * if fp < 0.0: # <<<<<<<<<<<<<<
- * raise ValueError("p < 0.0")
- * if fp > 1.0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1365 */
__pyx_1 = (__pyx_v_fp < 0.0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1366
- * if not PyErr_Occurred():
- * if fp < 0.0:
- * raise ValueError("p < 0.0") # <<<<<<<<<<<<<<
- * 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 = 1366; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_106p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_106p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;}
+ Py_INCREF(__pyx_k149p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k149p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1367
- * if fp < 0.0:
- * raise ValueError("p < 0.0")
- * if fp > 1.0: # <<<<<<<<<<<<<<
- * raise ValueError("p > 1.0")
- * return discd_array_sc(self.internal_state, rk_geometric, size, fp)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1367 */
__pyx_1 = (__pyx_v_fp > 1.0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1368
- * raise ValueError("p < 0.0")
- * if fp > 1.0:
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * 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 = 1368; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_107p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_107p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; goto __pyx_L1;}
+ Py_INCREF(__pyx_k150p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k150p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1369
- * if fp > 1.0:
- * raise ValueError("p > 1.0")
- * return discd_array_sc(self.internal_state, rk_geometric, size, fp) # <<<<<<<<<<<<<<
- *
- * 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 = 1369; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1369 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1371
- * return discd_array_sc(self.internal_state, rk_geometric, size, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1371 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1374
- *
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1374; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1374 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1375
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(op, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("p < 0.0")
- * if _sp.any(_sp.greater(op, 1.0)):
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1375 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1376
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(op, 0.0)):
- * raise ValueError("p < 0.0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1376; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_108p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_108p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;}
+ Py_INCREF(__pyx_k151p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k151p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1377
- * if _sp.any(_sp.less(op, 0.0)):
- * raise ValueError("p < 0.0")
- * if _sp.any(_sp.greater(op, 1.0)): # <<<<<<<<<<<<<<
- * raise ValueError("p > 1.0")
- * return discd_array(self.internal_state, rk_geometric, size, op)
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1377 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
__pyx_4 = 0;
- __pyx_2 = PyObject_Call(__pyx_5, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1378
- * raise ValueError("p < 0.0")
- * if _sp.any(_sp.greater(op, 1.0)):
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * 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 = 1378; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_109p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k_109p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;}
+ Py_INCREF(__pyx_k152p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k152p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1379
- * if _sp.any(_sp.greater(op, 1.0)):
- * raise ValueError("p > 1.0")
- * return discd_array(self.internal_state, rk_geometric, size, op) # <<<<<<<<<<<<<<
- *
- * 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 = 1379; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1379 */
+ __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 (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; goto __pyx_L1;}
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;
@@ -12140,43 +7357,38 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.geometric");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_op);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_p);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1381
- * return discd_array(self.internal_state, rk_geometric, size, op)
- *
- * def hypergeometric(self, ngood, nbad, nsample, size=None): # <<<<<<<<<<<<<<
- * """Hypergeometric distribution.
- *
- */
-
static PyObject *__pyx_n_add;
-static PyObject *__pyx_k_110p;
-static PyObject *__pyx_k_111p;
-static PyObject *__pyx_k_112p;
-static PyObject *__pyx_k_113p;
-static PyObject *__pyx_k_114p;
-static PyObject *__pyx_k_115p;
-static PyObject *__pyx_k_116p;
-static PyObject *__pyx_k_117p;
-
-static char __pyx_k_110[] = "ngood < 1";
-static char __pyx_k_111[] = "nbad < 1";
-static char __pyx_k_112[] = "nsample < 1";
-static char __pyx_k_113[] = "ngood + nbad < nsample";
-static char __pyx_k_114[] = "ngood < 1";
-static char __pyx_k_115[] = "nbad < 1";
-static char __pyx_k_116[] = "nsample < 1";
-static char __pyx_k_117[] = "ngood + nbad < nsample";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k153p;
+static PyObject *__pyx_k154p;
+static PyObject *__pyx_k155p;
+static PyObject *__pyx_k156p;
+static PyObject *__pyx_k157p;
+static PyObject *__pyx_k158p;
+static PyObject *__pyx_k159p;
+static PyObject *__pyx_k160p;
+
+static char __pyx_k153[] = "ngood < 1";
+static char __pyx_k154[] = "nbad < 1";
+static char __pyx_k155[] = "nsample < 1";
+static char __pyx_k156[] = "ngood + nbad < nsample";
+static char __pyx_k157[] = "ngood < 1";
+static char __pyx_k158[] = "nbad < 1";
+static char __pyx_k159[] = "nsample < 1";
+static char __pyx_k160[] = "ngood + nbad < nsample";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = "Hypergeometric distribution.\n\n Consider an urn with ngood \"good\" balls and nbad \"bad\" balls. If one\n were to draw nsample balls from the urn without replacement, then\n the hypergeometric distribution describes the distribution of \"good\"\n balls in the sample.\n\n hypergeometric(ngood, nbad, nsample, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ngood = 0;
PyObject *__pyx_v_nbad = 0;
PyObject *__pyx_v_nsample = 0;
@@ -12195,474 +7407,297 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v
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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3);
- }
- }
- 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 = 1381; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.hypergeometric");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k56;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_ngood);
+ Py_INCREF(__pyx_v_nbad);
+ Py_INCREF(__pyx_v_nsample);
+ Py_INCREF(__pyx_v_size);
__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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1394
- * cdef long lngood, lnbad, lnsample
- *
- * lngood = PyInt_AsLong(ngood) # <<<<<<<<<<<<<<
- * lnbad = PyInt_AsLong(nbad)
- * lnsample = PyInt_AsLong(nsample)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1394 */
__pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1395
- *
- * lngood = PyInt_AsLong(ngood)
- * lnbad = PyInt_AsLong(nbad) # <<<<<<<<<<<<<<
- * lnsample = PyInt_AsLong(nsample)
- * if not PyErr_Occurred():
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1395 */
__pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1396
- * lngood = PyInt_AsLong(ngood)
- * lnbad = PyInt_AsLong(nbad)
- * lnsample = PyInt_AsLong(nsample) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if ngood < 1:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1396 */
__pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1397
- * lnbad = PyInt_AsLong(nbad)
- * lnsample = PyInt_AsLong(nsample)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if ngood < 1:
- * raise ValueError("ngood < 1")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1397 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1398
- * lnsample = PyInt_AsLong(nsample)
- * if not PyErr_Occurred():
- * if ngood < 1: # <<<<<<<<<<<<<<
- * 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 = 1398; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1398 */
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;}
+ __pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1399
- * if not PyErr_Occurred():
- * if ngood < 1:
- * raise ValueError("ngood < 1") # <<<<<<<<<<<<<<
- * if nbad < 1:
- * raise ValueError("nbad < 1")
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_110p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_110p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;}
+ Py_INCREF(__pyx_k153p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k153p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1400
- * if ngood < 1:
- * raise ValueError("ngood < 1")
- * if nbad < 1: # <<<<<<<<<<<<<<
- * 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 = 1400; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1400 */
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;}
+ __pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1401
- * raise ValueError("ngood < 1")
- * if nbad < 1:
- * raise ValueError("nbad < 1") # <<<<<<<<<<<<<<
- * if nsample < 1:
- * raise ValueError("nsample < 1")
- */
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_111p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_111p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
+ Py_INCREF(__pyx_k154p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k154p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1402
- * if nbad < 1:
- * raise ValueError("nbad < 1")
- * if nsample < 1: # <<<<<<<<<<<<<<
- * 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 = 1402; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1402 */
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
+ __pyx_1 = __pyx_1 < 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1403
- * raise ValueError("nbad < 1")
- * if nsample < 1:
- * raise ValueError("nsample < 1") # <<<<<<<<<<<<<<
- * 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 = 1403; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_112p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_112p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
+ Py_INCREF(__pyx_k155p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k155p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1404
- * if nsample < 1:
- * raise ValueError("nsample < 1")
- * if ngood + nbad < nsample: # <<<<<<<<<<<<<<
- * 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 = 1404; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_RichCompare(__pyx_2, __pyx_v_nsample, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1404 */
+ __pyx_2 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_2, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
+ __pyx_1 = __pyx_1 < 0;
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 = 1404; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1405
- * raise ValueError("nsample < 1")
- * if ngood + nbad < nsample:
- * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<<
- * 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 = 1405; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_113p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_113p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
+ Py_INCREF(__pyx_k156p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k156p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1407
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size,
- * lngood, lnbad, lnsample) # <<<<<<<<<<<<<<
- *
- *
- */
- __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 = 1406; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_r = __pyx_2;
- __pyx_2 = 0;
+ __pyx_L6:;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1406 */
+ __pyx_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 (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;}
+ __pyx_r = __pyx_3;
+ __pyx_3 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1410
- *
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1410 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1412
- * PyErr_Clear()
- *
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * 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 = 1412; __pyx_clineno = __LINE__; goto __pyx_L1;}
- 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;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1413
- *
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED)
- * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED)
- * if _sp.any(_sp.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 = 1413; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1412 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
- Py_DECREF(((PyObject *)__pyx_v_onbad));
- __pyx_v_onbad = ((PyArrayObject *)__pyx_2);
+ Py_DECREF(((PyObject *)__pyx_v_ongood));
+ __pyx_v_ongood = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1414
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED)
- * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED)
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1414; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1413 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
- Py_DECREF(((PyObject *)__pyx_v_onsample));
- __pyx_v_onsample = ((PyArrayObject *)__pyx_3);
+ Py_DECREF(((PyObject *)__pyx_v_onbad));
+ __pyx_v_onbad = ((PyArrayObject *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1415
- * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED)
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED)
- * if _sp.any(_sp.less(ongood, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("ngood < 1")
- * if _sp.any(_sp.less(onbad, 1)):
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1414 */
+ __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
+ Py_DECREF(((PyObject *)__pyx_v_onsample));
+ __pyx_v_onsample = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1415 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_ongood));
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_2 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1416
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED)
- * if _sp.any(_sp.less(ongood, 1)):
- * raise ValueError("ngood < 1") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.less(onbad, 1)):
- * raise ValueError("nbad < 1")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_114p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_114p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;}
+ Py_INCREF(__pyx_k157p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k157p);
+ __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L9;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;}
+ goto __pyx_L7;
}
- __pyx_L9:;
+ __pyx_L7:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1417
- * if _sp.any(_sp.less(ongood, 1)):
- * raise ValueError("ngood < 1")
- * if _sp.any(_sp.less(onbad, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("nbad < 1")
- * if _sp.any(_sp.less(onsample, 1)):
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1417 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_onbad));
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_4 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1418
- * raise ValueError("ngood < 1")
- * if _sp.any(_sp.less(onbad, 1)):
- * raise ValueError("nbad < 1") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.less(onsample, 1)):
- * raise ValueError("nsample < 1")
- */
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_115p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_115p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;}
+ Py_INCREF(__pyx_k158p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k158p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L10;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;}
+ goto __pyx_L8;
}
- __pyx_L10:;
+ __pyx_L8:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1419
- * if _sp.any(_sp.less(onbad, 1)):
- * raise ValueError("nbad < 1")
- * if _sp.any(_sp.less(onsample, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("nsample < 1")
- * if _sp.any(_sp.less(_sp.add(ongood, onbad),onsample)):
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
- 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, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1419 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_3 = PyObject_Call(__pyx_4, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- 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 = 1419; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)__pyx_v_onsample));
+ PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_onsample));
+ PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1420
- * raise ValueError("nbad < 1")
- * if _sp.any(_sp.less(onsample, 1)):
- * raise ValueError("nsample < 1") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.less(_sp.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 = 1420; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_116p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_116p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L11;
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;}
+ Py_INCREF(__pyx_k159p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k159p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;}
+ goto __pyx_L9;
}
- __pyx_L11:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1421
- * if _sp.any(_sp.less(onsample, 1)):
- * raise ValueError("nsample < 1")
- * if _sp.any(_sp.less(_sp.add(ongood, onbad),onsample)): # <<<<<<<<<<<<<<
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array(self.internal_state, rk_hypergeometric, size,
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_L9:;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1421 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_add); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_ongood));
- PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood));
+ PyTuple_SET_ITEM(__pyx_5, 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, __pyx_2, NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onbad));
+ __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6);
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
Py_INCREF(((PyObject *)__pyx_v_onsample));
- PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onsample));
+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_onsample));
__pyx_6 = 0;
- __pyx_2 = PyObject_Call(__pyx_4, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_4 = PyObject_Call(__pyx_3, __pyx_6, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
+ __pyx_5 = 0;
+ __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1422
- * raise ValueError("nsample < 1")
- * if _sp.any(_sp.less(_sp.add(ongood, onbad),onsample)):
- * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<<
- * 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 = 1422; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_117p);
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k_117p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;}
+ Py_INCREF(__pyx_k160p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k160p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L12;
+ __Pyx_Raise(__pyx_5, 0, 0);
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;}
+ goto __pyx_L10;
}
- __pyx_L12:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1424
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array(self.internal_state, rk_hypergeometric, size,
- * ongood, onbad, onsample) # <<<<<<<<<<<<<<
- *
- * 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 = 1423; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
+ __pyx_L10:;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1423 */
+ __pyx_4 = __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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;}
+ __pyx_r = __pyx_4;
+ __pyx_4 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -12674,35 +7709,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("mtrand.RandomState.hypergeometric");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ongood);
Py_DECREF(__pyx_v_onbad);
Py_DECREF(__pyx_v_onsample);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_ngood);
+ Py_DECREF(__pyx_v_nbad);
+ Py_DECREF(__pyx_v_nsample);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1426
- * ongood, onbad, onsample)
- *
- * def logseries(self, p, size=None): # <<<<<<<<<<<<<<
- * """Logarithmic series distribution.
- *
- */
-
-static PyObject *__pyx_k_118p;
-static PyObject *__pyx_k_119p;
-static PyObject *__pyx_k_120p;
-static PyObject *__pyx_k_121p;
-
-static char __pyx_k_118[] = "p < 0.0";
-static char __pyx_k_119[] = "p > 1.0";
-static char __pyx_k_120[] = "p < 0.0";
-static char __pyx_k_121[] = "p > 1.0";
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_k161p;
+static PyObject *__pyx_k162p;
+static PyObject *__pyx_k163p;
+static PyObject *__pyx_k164p;
+
+static char __pyx_k161[] = "p < 0.0";
+static char __pyx_k162[] = "p > 1.0";
+static char __pyx_k163[] = "p < 0.0";
+static char __pyx_k164[] = "p > 1.0";
+
+static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_logseries[] = "Logarithmic series distribution.\n\n logseries(p, size=None)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_p = 0;
PyObject *__pyx_v_size = 0;
PyArrayObject *__pyx_v_op;
@@ -12714,247 +7746,145 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self
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);
- }
- }
- 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 = 1426; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.logseries");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k57;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_p);
+ Py_INCREF(__pyx_v_size);
__pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1434
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fp < 0.0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1434 */
__pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1435
- *
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fp < 0.0:
- * raise ValueError("p < 0.0")
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1435 */
__pyx_1 = (!PyErr_Occurred());
if (__pyx_1) {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1436
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred():
- * if fp < 0.0: # <<<<<<<<<<<<<<
- * raise ValueError("p < 0.0")
- * if fp > 1.0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1436 */
__pyx_1 = (__pyx_v_fp < 0.0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1437
- * if not PyErr_Occurred():
- * if fp < 0.0:
- * raise ValueError("p < 0.0") # <<<<<<<<<<<<<<
- * 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 = 1437; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_118p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_118p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; goto __pyx_L1;}
+ Py_INCREF(__pyx_k161p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k161p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1438
- * if fp < 0.0:
- * raise ValueError("p < 0.0")
- * if fp > 1.0: # <<<<<<<<<<<<<<
- * raise ValueError("p > 1.0")
- * return discd_array_sc(self.internal_state, rk_logseries, size, fp)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1438 */
__pyx_1 = (__pyx_v_fp > 1.0);
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1439
- * raise ValueError("p < 0.0")
- * if fp > 1.0:
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * 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 = 1439; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_119p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_119p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; goto __pyx_L1;}
+ Py_INCREF(__pyx_k162p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k162p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1440
- * if fp > 1.0:
- * raise ValueError("p > 1.0")
- * return discd_array_sc(self.internal_state, rk_logseries, size, fp) # <<<<<<<<<<<<<<
- *
- * 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 = 1440; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1440 */
+ __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1442
- * return discd_array_sc(self.internal_state, rk_logseries, size, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1442 */
PyErr_Clear();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1444
- * PyErr_Clear()
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1444; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1444 */
+ __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1445
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(op, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("p < 0.0")
- * if _sp.any(_sp.greater(op, 1.0)):
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1445 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
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, __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_5 = PyObject_Call(__pyx_3, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1446
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED)
- * if _sp.any(_sp.less(op, 0.0)):
- * raise ValueError("p < 0.0") # <<<<<<<<<<<<<<
- * if _sp.any(_sp.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 = 1446; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_120p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_120p);
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;}
+ Py_INCREF(__pyx_k163p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k163p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1447
- * if _sp.any(_sp.less(op, 0.0)):
- * raise ValueError("p < 0.0")
- * if _sp.any(_sp.greater(op, 1.0)): # <<<<<<<<<<<<<<
- * raise ValueError("p > 1.0")
- * return discd_array(self.internal_state, rk_logseries, size, op)
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1447 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
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, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
__pyx_4 = 0;
- __pyx_2 = PyObject_Call(__pyx_5, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1448
- * raise ValueError("p < 0.0")
- * if _sp.any(_sp.greater(op, 1.0)):
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * 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 = 1448; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_121p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k_121p);
- __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;}
+ Py_INCREF(__pyx_k164p);
+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k164p);
+ __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;}
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1449
- * if _sp.any(_sp.greater(op, 1.0)):
- * raise ValueError("p > 1.0")
- * return discd_array(self.internal_state, rk_logseries, size, op) # <<<<<<<<<<<<<<
- *
- * # 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 = 1449; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1449 */
+ __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 (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;}
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;
@@ -12967,20 +7897,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.logseries");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_op);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_p);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1452
- *
- * # Multivariate distributions:
- * def multivariate_normal(self, mean, cov, size=None): # <<<<<<<<<<<<<<
- * """Return an array containing multivariate normally distributed random numbers
- * with specified mean and covariance.
- */
-
static PyObject *__pyx_n_array;
static PyObject *__pyx_n_shape;
static PyObject *__pyx_n_append;
@@ -12990,19 +7915,19 @@ static PyObject *__pyx_n_svd;
static PyObject *__pyx_n_dot;
static PyObject *__pyx_n_sqrt;
-static PyObject *__pyx_k_122p;
-static PyObject *__pyx_k_123p;
-static PyObject *__pyx_k_124p;
-static PyObject *__pyx_k_125p;
+static PyObject *__pyx_k165p;
+static PyObject *__pyx_k166p;
+static PyObject *__pyx_k167p;
+static PyObject *__pyx_k168p;
-static char __pyx_k_122[] = "mean must be 1 dimensional";
-static char __pyx_k_123[] = "cov must be 2 dimensional and square";
-static char __pyx_k_124[] = "mean and cov must have same length";
-static char __pyx_k_125[] = "numpy.dual";
+static char __pyx_k165[] = "mean must be 1 dimensional";
+static char __pyx_k166[] = "cov must be 2 dimensional and square";
+static char __pyx_k167[] = "mean and cov must have same length";
+static char __pyx_k168[] = "numpy.dual";
-static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = "Return an array containing multivariate normally distributed random numbers\n with specified mean and covariance.\n\n multivariate_normal(mean, cov) -> random values\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\n\n mean must be a 1 dimensional array. cov must be a square two dimensional\n array with the same number of rows and columns as mean has elements.\n\n The first form returns a single 1-D array containing a multivariate\n normal.\n\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\n normal.\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mean = 0;
PyObject *__pyx_v_cov = 0;
PyObject *__pyx_v_size = 0;
@@ -13018,28 +7943,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
- Py_ssize_t __pyx_5 = 0;
+ Py_ssize_t __pyx_5;
PyObject *__pyx_6 = 0;
- PyObject *__pyx_7 = 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) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 1452; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k58;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_mean);
Py_INCREF(__pyx_v_cov);
+ Py_INCREF(__pyx_v_size);
__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);
@@ -13048,534 +7960,295 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__
__pyx_v_s = Py_None; Py_INCREF(Py_None);
__pyx_v_v = Py_None; Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1470
- * """
- * # Check preconditions on arguments
- * mean = _sp.array(mean) # <<<<<<<<<<<<<<
- * cov = _sp.array(cov)
- * if size is None:
- */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1470 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; goto __pyx_L1;}
Py_INCREF(__pyx_v_mean);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_1, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_mean);
__pyx_v_mean = __pyx_3;
__pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1471
- * # Check preconditions on arguments
- * mean = _sp.array(mean)
- * cov = _sp.array(cov) # <<<<<<<<<<<<<<
- * if size is None:
- * shape = []
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1471 */
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
Py_INCREF(__pyx_v_cov);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);
- __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_cov);
__pyx_v_cov = __pyx_2;
__pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1472
- * mean = _sp.array(mean)
- * cov = _sp.array(cov)
- * if size is None: # <<<<<<<<<<<<<<
- * shape = []
- * else:
- */
- __pyx_4 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1472 */
+ __pyx_4 = __pyx_v_size == Py_None;
if (__pyx_4) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1473
- * cov = _sp.array(cov)
- * if size is None:
- * shape = [] # <<<<<<<<<<<<<<
- * else:
- * shape = size
- */
- __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; goto __pyx_L1;}
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_1;
__pyx_1 = 0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
/*else*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1475
- * shape = []
- * else:
- * shape = size # <<<<<<<<<<<<<<
- * if len(mean.shape) != 1:
- * raise ValueError("mean must be 1 dimensional")
- */
Py_INCREF(__pyx_v_size);
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_v_size;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1476
- * else:
- * shape = size
- * if len(mean.shape) != 1: # <<<<<<<<<<<<<<
- * 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_n_shape); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_Length(__pyx_3); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1476 */
+ __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
+ __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_4 = (__pyx_5 != 1);
if (__pyx_4) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1477
- * shape = size
- * if len(mean.shape) != 1:
- * raise ValueError("mean must be 1 dimensional") # <<<<<<<<<<<<<<
- * 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 = 1477; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_122p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_122p);
- __pyx_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
+ Py_INCREF(__pyx_k165p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k165p);
+ __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_1, 0, 0);
Py_DECREF(__pyx_1); __pyx_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1478
- * if len(mean.shape) != 1:
- * raise ValueError("mean must be 1 dimensional")
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): # <<<<<<<<<<<<<<
- * raise ValueError("cov must be 2 dimensional and square")
- * if mean.shape[0] != cov.shape[0]:
- */
- __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_Length(__pyx_2); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- 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 = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1478 */
+ __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
+ __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = (__pyx_5 != 2);
if (!__pyx_4) {
+ __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
+ __pyx_1 = __Pyx_GetItemInt(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetItemInt(__pyx_3, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyList_CheckExact(__pyx_1) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_1)) {
- __pyx_6 = PyList_GET_ITEM(__pyx_1, 0); Py_INCREF(__pyx_6);
- } else if (PyTuple_CheckExact(__pyx_1) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_1)) {
- __pyx_6 = PyTuple_GET_ITEM(__pyx_1, 0); Py_INCREF(__pyx_6);
- } else {
- __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyList_CheckExact(__pyx_1) && 0 <= 1 && 1 < PyList_GET_SIZE(__pyx_1)) {
- __pyx_7 = PyList_GET_ITEM(__pyx_1, 1); Py_INCREF(__pyx_7);
- } else if (PyTuple_CheckExact(__pyx_1) && 0 <= 1 && 1 < PyTuple_GET_SIZE(__pyx_1)) {
- __pyx_7 = PyTuple_GET_ITEM(__pyx_1, 1); Py_INCREF(__pyx_7);
- } else {
- __pyx_2 = PyInt_FromLong(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_7 = PyObject_GetItem(__pyx_1, __pyx_2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
+ if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
+ __pyx_4 = __pyx_4 != 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = PyObject_RichCompare(__pyx_6, __pyx_7, Py_NE); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- Py_DECREF(__pyx_7); __pyx_7 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
}
- __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_4) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1479
- * raise ValueError("mean must be 1 dimensional")
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- * raise ValueError("cov must be 2 dimensional and square") # <<<<<<<<<<<<<<
- * 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 = 1479; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_123p);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k_123p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;}
+ Py_INCREF(__pyx_k166p);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k166p);
+ __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_1, 0, 0);
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;}
+ goto __pyx_L4;
}
- __pyx_L6:;
+ __pyx_L4:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1480
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- * raise ValueError("cov must be 2 dimensional and square")
- * if mean.shape[0] != cov.shape[0]: # <<<<<<<<<<<<<<
- * raise ValueError("mean and cov must have same length")
- * # Compute shape of output
- */
- __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyList_CheckExact(__pyx_6) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_6)) {
- __pyx_3 = PyList_GET_ITEM(__pyx_6, 0); Py_INCREF(__pyx_3);
- } else if (PyTuple_CheckExact(__pyx_6) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_6)) {
- __pyx_3 = PyTuple_GET_ITEM(__pyx_6, 0); Py_INCREF(__pyx_3);
- } else {
- __pyx_7 = PyInt_FromLong(0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_7); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- }
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyList_CheckExact(__pyx_1) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_1)) {
- __pyx_6 = PyList_GET_ITEM(__pyx_1, 0); Py_INCREF(__pyx_6);
- } else if (PyTuple_CheckExact(__pyx_1) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_1)) {
- __pyx_6 = PyTuple_GET_ITEM(__pyx_1, 0); Py_INCREF(__pyx_6);
- } else {
- __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1480 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetItemInt(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetItemInt(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_7 = PyObject_RichCompare(__pyx_3, __pyx_6, Py_NE); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_Cmp(__pyx_3, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;}
+ __pyx_4 = __pyx_4 != 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_7); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_4) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1481
- * raise ValueError("cov must be 2 dimensional and square")
- * if mean.shape[0] != cov.shape[0]:
- * raise ValueError("mean and cov must have same length") # <<<<<<<<<<<<<<
- * # Compute shape of output
- * if isinstance(shape, int):
- */
- __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_124p);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k_124p);
- __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;}
+ Py_INCREF(__pyx_k167p);
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k167p);
+ __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;}
+ goto __pyx_L5;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1483
- * raise ValueError("mean and cov must have same length")
- * # Compute shape of output
- * if isinstance(shape, int): # <<<<<<<<<<<<<<
- * 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 = 1483; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1483 */
+ __pyx_4 = PyObject_IsInstance(__pyx_v_shape,((PyObject *)(&PyInt_Type))); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; goto __pyx_L1;}
if (__pyx_4) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1484
- * # Compute shape of output
- * if isinstance(shape, int):
- * shape = [shape] # <<<<<<<<<<<<<<
- * final_shape = list(shape[:])
- * final_shape.append(mean.shape[0])
- */
- __pyx_3 = PyList_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; goto __pyx_L1;}
Py_INCREF(__pyx_v_shape);
- PyList_SET_ITEM(__pyx_3, 0, __pyx_v_shape);
+ PyList_SET_ITEM(__pyx_2, 0, __pyx_v_shape);
Py_DECREF(__pyx_v_shape);
- __pyx_v_shape = __pyx_3;
- __pyx_3 = 0;
- goto __pyx_L8;
+ __pyx_v_shape = __pyx_2;
+ __pyx_2 = 0;
+ goto __pyx_L6;
}
- __pyx_L8:;
+ __pyx_L6:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1485
- * if isinstance(shape, int):
- * shape = [shape]
- * final_shape = list(shape[:]) # <<<<<<<<<<<<<<
- * 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 = 1485; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_7, 0, __pyx_6);
- __pyx_6 = 0;
- __pyx_1 = PyObject_Call(((PyObject*)&PyList_Type), __pyx_7, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- Py_DECREF(__pyx_v_final_shape);
- __pyx_v_final_shape = __pyx_1;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1485 */
+ __pyx_1 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
__pyx_1 = 0;
+ __pyx_2 = PyObject_CallObject(((PyObject *)(&PyList_Type)), __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_v_final_shape);
+ __pyx_v_final_shape = __pyx_2;
+ __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1486
- * shape = [shape]
- * final_shape = list(shape[:])
- * final_shape.append(mean.shape[0]) # <<<<<<<<<<<<<<
- * # 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_final_shape, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyList_CheckExact(__pyx_3) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_3)) {
- __pyx_7 = PyList_GET_ITEM(__pyx_3, 0); Py_INCREF(__pyx_7);
- } else if (PyTuple_CheckExact(__pyx_3) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_3)) {
- __pyx_7 = PyTuple_GET_ITEM(__pyx_3, 0); Py_INCREF(__pyx_7);
- } else {
- __pyx_6 = PyInt_FromLong(0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_7 = PyObject_GetItem(__pyx_3, __pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- }
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1486 */
+ __pyx_1 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetItemInt(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_7);
- __pyx_7 = 0;
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_1, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1490
- * # numbers. The matrix has rows with the same length as mean and as
- * # many rows are necessary to form a matrix of shape final_shape.
- * x = self.standard_normal(_sp.multiply.reduce(final_shape)) # <<<<<<<<<<<<<<
- * x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]),
- * mean.shape[0])
- */
- __pyx_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_7, __pyx_n_multiply); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1490 */
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
Py_INCREF(__pyx_v_final_shape);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);
- __pyx_7 = PyObject_Call(__pyx_1, __pyx_3, NULL); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_final_shape);
+ __pyx_6 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_7);
- __pyx_7 = 0;
- __pyx_1 = PyObject_Call(__pyx_6, __pyx_2, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_v_x);
- __pyx_v_x = __pyx_1;
- __pyx_1 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1491
- * # many rows are necessary to form a matrix of shape final_shape.
- * x = self.standard_normal(_sp.multiply.reduce(final_shape))
- * x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]), # <<<<<<<<<<<<<<
- * mean.shape[0])
- * # Transform matrix of standard normals into matrix where each row
- */
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_7 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_6);
+ __pyx_6 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_6 = PyObject_GetAttr(__pyx_7, __pyx_n_reduce); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
+ Py_DECREF(__pyx_v_x);
+ __pyx_v_x = __pyx_2;
__pyx_2 = 0;
- __pyx_3 = PyObject_Call(__pyx_6, __pyx_1, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1491 */
+ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1492
- * x = self.standard_normal(_sp.multiply.reduce(final_shape))
- * x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]),
- * mean.shape[0]) # <<<<<<<<<<<<<<
- * # Transform matrix of standard normals into matrix where each row
- * # contains multivariate normals with the desired covariance.
- */
- __pyx_7 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyList_CheckExact(__pyx_7) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_7)) {
- __pyx_6 = PyList_GET_ITEM(__pyx_7, 0); Py_INCREF(__pyx_6);
- } else if (PyTuple_CheckExact(__pyx_7) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_7)) {
- __pyx_6 = PyTuple_GET_ITEM(__pyx_7, 0); Py_INCREF(__pyx_6);
- } else {
- __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_6 = PyObject_GetItem(__pyx_7, __pyx_2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_6);
+ __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
+ __pyx_2 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetItemInt(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1);
+ PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3);
+ __pyx_1 = 0;
__pyx_3 = 0;
- __pyx_6 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1491
- * # many rows are necessary to form a matrix of shape final_shape.
- * x = self.standard_normal(_sp.multiply.reduce(final_shape))
- * x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]), # <<<<<<<<<<<<<<
- * mean.shape[0])
- * # Transform matrix of standard normals into matrix where each row
- */
- if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1500
- * # decomposition of cov is such an A.
- *
- * from numpy.dual import svd # <<<<<<<<<<<<<<
- * # XXX: we really should be doing this by Cholesky decomposition
- * (u,s,v) = svd(cov)
- */
- __pyx_7 = PyList_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1500 */
+ __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;}
Py_INCREF(__pyx_n_svd);
- PyList_SET_ITEM(__pyx_7, 0, __pyx_n_svd);
- __pyx_2 = __Pyx_Import(__pyx_k_125p, __pyx_7); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_svd); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);
+ __pyx_1 = __Pyx_Import(__pyx_k168p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_svd); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;}
Py_DECREF(__pyx_v_svd);
__pyx_v_svd = __pyx_3;
__pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1502
- * from numpy.dual import svd
- * # XXX: we really should be doing this by Cholesky decomposition
- * (u,s,v) = svd(cov) # <<<<<<<<<<<<<<
- * x = _sp.dot(x*_sp.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 = 1502; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1502 */
+ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
Py_INCREF(__pyx_v_cov);
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_cov);
- __pyx_1 = PyObject_Call(__pyx_v_svd, __pyx_6, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
- if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
- PyObject* tuple = __pyx_1;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_u);
- __pyx_v_u = __pyx_2;
- __pyx_2 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_s);
- __pyx_v_s = __pyx_3;
- __pyx_3 = 0;
- __pyx_6 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_6);
- Py_DECREF(__pyx_v_v);
- __pyx_v_v = __pyx_6;
- __pyx_6 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- }
- else {
- __pyx_7 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_7, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_v_u);
- __pyx_v_u = __pyx_2;
- __pyx_2 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_7, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_v_s);
- __pyx_v_s = __pyx_3;
- __pyx_3 = 0;
- __pyx_6 = __Pyx_UnpackItem(__pyx_7, 2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_v_v);
- __pyx_v_v = __pyx_6;
- __pyx_6 = 0;
- if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- }
+ __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_u);
+ __pyx_v_u = __pyx_3;
+ __pyx_3 = 0;
+ __pyx_6 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_s);
+ __pyx_v_s = __pyx_6;
+ __pyx_6 = 0;
+ __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_v);
+ __pyx_v_v = __pyx_2;
+ __pyx_2 = 0;
+ if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1503
- * # XXX: we really should be doing this by Cholesky decomposition
- * (u,s,v) = svd(cov)
- * x = _sp.dot(x*_sp.sqrt(s),v) # <<<<<<<<<<<<<<
- * # 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_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_dot); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1503 */
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
+ __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_dot); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_sqrt); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_sqrt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
Py_INCREF(__pyx_v_s);
- PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_s);
- __pyx_2 = PyObject_Call(__pyx_1, __pyx_7, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_6 = PyNumber_Multiply(__pyx_v_x, __pyx_2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_1 = PyNumber_Multiply(__pyx_v_x, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
Py_INCREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_v);
- __pyx_6 = 0;
- __pyx_7 = PyObject_Call(__pyx_3, __pyx_1, NULL); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);
+ __pyx_1 = 0;
+ __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_x);
- __pyx_v_x = __pyx_7;
- __pyx_7 = 0;
+ __pyx_v_x = __pyx_2;
+ __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1506
- * # The rows of x now have the correct covariance but mean 0. Add
- * # mean to each row. Then each row will have mean mean.
- * _sp.add(mean,x,x) # <<<<<<<<<<<<<<
- * x.shape = tuple(final_shape)
- * return x
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_6 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1506 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
+ __pyx_6 = PyObject_GetAttr(__pyx_1, __pyx_n_add); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
Py_INCREF(__pyx_v_mean);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);
Py_INCREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);
Py_INCREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);
- __pyx_1 = PyObject_Call(__pyx_6, __pyx_3, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1507
- * # mean to each row. Then each row will have mean mean.
- * _sp.add(mean,x,x)
- * x.shape = tuple(final_shape) # <<<<<<<<<<<<<<
- * return x
- *
- */
- __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1507 */
+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;}
Py_INCREF(__pyx_v_final_shape);
- PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_final_shape);
- __pyx_2 = PyObject_Call(((PyObject*)&PyTuple_Type), __pyx_7, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_final_shape);
+ __pyx_6 = PyObject_CallObject(((PyObject *)(&PyTuple_Type)), __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1508
- * _sp.add(mean,x,x)
- * x.shape = tuple(final_shape)
- * return x # <<<<<<<<<<<<<<
- *
- * def multinomial(self, long n, object pvals, size=None):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1508 */
Py_INCREF(__pyx_v_x);
__pyx_r = __pyx_v_x;
goto __pyx_L0;
@@ -13587,9 +8260,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_6);
- Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("mtrand.RandomState.multivariate_normal");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_shape);
Py_DECREF(__pyx_v_final_shape);
@@ -13598,28 +8270,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multivariate_normal(PyObject *__
Py_DECREF(__pyx_v_u);
Py_DECREF(__pyx_v_s);
Py_DECREF(__pyx_v_v);
+ Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_mean);
Py_DECREF(__pyx_v_cov);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1510
- * return x
- *
- * def multinomial(self, long n, object pvals, size=None): # <<<<<<<<<<<<<<
- * """Multinomial distribution.
- *
- */
-
static PyObject *__pyx_n_zeros;
-static PyObject *__pyx_k_127p;
+static PyObject *__pyx_k170p;
-static char __pyx_k_127[] = "sum(pvals[:-1]) > 1.0";
+static char __pyx_k170[] = "sum(pvals[:-1]) > 1.0";
-static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_multinomial[] = "Multinomial distribution.\n\n multinomial(n, pvals, size=None) -> random values\n\n pvals is a sequence of probabilities that should sum to 1 (however, the\n last element is always assumed to account for the remaining probability\n as long as sum(pvals[:-1]) <= 1).\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
long __pyx_v_n;
PyObject *__pyx_v_pvals = 0;
PyObject *__pyx_v_size = 0;
@@ -13635,147 +8301,74 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se
PyObject *__pyx_v_shape;
PyObject *__pyx_v_multin;
PyObject *__pyx_r;
- Py_ssize_t __pyx_1 = 0;
+ Py_ssize_t __pyx_1;
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 = 1510; __pyx_clineno = __LINE__; goto __pyx_L2;}
- __pyx_v_pvals = PyTuple_GET_ITEM(__pyx_args, 1);
- if (PyTuple_GET_SIZE(__pyx_args) > 2) {
- __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- }
- 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 = 1510; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.multinomial");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k59;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lO|O", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_pvals);
+ Py_INCREF(__pyx_v_size);
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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1526
- * cdef double Sum
- *
- * d = len(pvals) # <<<<<<<<<<<<<<
- * 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 = 1526; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1526 */
+ __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;}
__pyx_v_d = __pyx_1;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1527
- *
- * d = len(pvals)
- * parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1) # <<<<<<<<<<<<<<
- * 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 = 1527; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1527 */
+ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; goto __pyx_L1;}
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
Py_DECREF(((PyObject *)arrayObject_parr));
arrayObject_parr = ((PyArrayObject *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1528
- * d = len(pvals)
- * parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1)
- * pix = <double*>parr.data # <<<<<<<<<<<<<<
- *
- * if kahan_sum(pix, d-1) > (1.0 + 1e-12):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1528 */
__pyx_v_pix = ((double *)arrayObject_parr->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1530
- * pix = <double*>parr.data
- *
- * if kahan_sum(pix, d-1) > (1.0 + 1e-12): # <<<<<<<<<<<<<<
- * 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));
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1530 */
+ __pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > (1.0 + 1e-12));
if (__pyx_3) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1531
- *
- * if kahan_sum(pix, d-1) > (1.0 + 1e-12):
- * raise ValueError("sum(pvals[:-1]) > 1.0") # <<<<<<<<<<<<<<
- *
- * if size is None:
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_k_127p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k_127p);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; goto __pyx_L1;}
+ Py_INCREF(__pyx_k170p);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k170p);
+ __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L4;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; goto __pyx_L1;}
+ goto __pyx_L2;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1533
- * raise ValueError("sum(pvals[:-1]) > 1.0")
- *
- * if size is None: # <<<<<<<<<<<<<<
- * shape = (d,)
- * elif type(size) is int:
- */
- __pyx_3 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1533 */
+ __pyx_3 = __pyx_v_size == Py_None;
if (__pyx_3) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1534
- *
- * if size is None:
- * shape = (d,) # <<<<<<<<<<<<<<
- * 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 = 1534; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_4;
__pyx_4 = 0;
- goto __pyx_L5;
+ goto __pyx_L3;
}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1535
- * if size is None:
- * shape = (d,)
- * elif type(size) is int: # <<<<<<<<<<<<<<
- * shape = (size, d)
- * else:
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- __pyx_4 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = (__pyx_4 == ((PyObject*)&PyInt_Type));
+ __pyx_3 = __pyx_4 == ((PyObject *)(&PyInt_Type));
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_3) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1536
- * shape = (d,)
- * elif type(size) is int:
- * shape = (size, d) # <<<<<<<<<<<<<<
- * else:
- * shape = size + (d,)
- */
- __pyx_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
@@ -13783,201 +8376,95 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_4;
__pyx_4 = 0;
- goto __pyx_L5;
+ goto __pyx_L3;
}
/*else*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1538
- * shape = (size, d)
- * else:
- * shape = size + (d,) # <<<<<<<<<<<<<<
- *
- * multin = _sp.zeros(shape, int)
- */
- __pyx_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_2;
__pyx_2 = 0;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1540
- * shape = size + (d,)
- *
- * multin = _sp.zeros(shape, int) # <<<<<<<<<<<<<<
- * mnarr = <ndarray>multin
- * mnix = <long*>mnarr.data
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1540 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_INCREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)(&PyInt_Type)));
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_multin);
__pyx_v_multin = __pyx_5;
__pyx_5 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1541
- *
- * multin = _sp.zeros(shape, int)
- * mnarr = <ndarray>multin # <<<<<<<<<<<<<<
- * mnix = <long*>mnarr.data
- * i = 0
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1541 */
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin)));
Py_DECREF(((PyObject *)arrayObject_mnarr));
arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1542
- * multin = _sp.zeros(shape, int)
- * mnarr = <ndarray>multin
- * mnix = <long*>mnarr.data # <<<<<<<<<<<<<<
- * i = 0
- * while i < PyArray_SIZE(mnarr):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1542 */
__pyx_v_mnix = ((long *)arrayObject_mnarr->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1543
- * mnarr = <ndarray>multin
- * mnix = <long*>mnarr.data
- * i = 0 # <<<<<<<<<<<<<<
- * while i < PyArray_SIZE(mnarr):
- * Sum = 1.0
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1543 */
__pyx_v_i = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1544
- * mnix = <long*>mnarr.data
- * i = 0
- * while i < PyArray_SIZE(mnarr): # <<<<<<<<<<<<<<
- * Sum = 1.0
- * dn = n
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1544 */
while (1) {
__pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));
if (!__pyx_3) break;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1545
- * i = 0
- * while i < PyArray_SIZE(mnarr):
- * Sum = 1.0 # <<<<<<<<<<<<<<
- * dn = n
- * for j from 0 <= j < d-1:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1545 */
__pyx_v_Sum = 1.0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1546
- * while i < PyArray_SIZE(mnarr):
- * Sum = 1.0
- * dn = n # <<<<<<<<<<<<<<
- * for j from 0 <= j < d-1:
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1546 */
__pyx_v_dn = __pyx_v_n;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1547
- * Sum = 1.0
- * dn = n
- * for j from 0 <= j < d-1: # <<<<<<<<<<<<<<
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- * dn = dn - mnix[i+j]
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1547 */
__pyx_6 = (__pyx_v_d - 1);
- for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; __pyx_v_j++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1548
- * dn = n
- * for j from 0 <= j < d-1:
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum) # <<<<<<<<<<<<<<
- * dn = dn - mnix[i+j]
- * if dn <= 0:
- */
- (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, __pyx_v_dn, ((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1549
- * for j from 0 <= j < d-1:
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- * dn = dn - mnix[i+j] # <<<<<<<<<<<<<<
- * if dn <= 0:
- * break
- */
+ for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; ++__pyx_v_j) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1548 */
+ (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1549 */
__pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1550
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- * dn = dn - mnix[i+j]
- * if dn <= 0: # <<<<<<<<<<<<<<
- * break
- * Sum = Sum - pix[j]
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1550 */
__pyx_3 = (__pyx_v_dn <= 0);
if (__pyx_3) {
- goto __pyx_L9;
- goto __pyx_L10;
+ goto __pyx_L7;
+ goto __pyx_L8;
}
- __pyx_L10:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1552
- * if dn <= 0:
- * break
- * Sum = Sum - pix[j] # <<<<<<<<<<<<<<
- * if dn > 0:
- * mnix[i+d-1] = dn
- */
+ __pyx_L8:;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1552 */
__pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));
}
- __pyx_L9:;
+ __pyx_L7:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1553
- * break
- * Sum = Sum - pix[j]
- * if dn > 0: # <<<<<<<<<<<<<<
- * mnix[i+d-1] = dn
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1553 */
__pyx_3 = (__pyx_v_dn > 0);
if (__pyx_3) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1554
- * Sum = Sum - pix[j]
- * if dn > 0:
- * mnix[i+d-1] = dn # <<<<<<<<<<<<<<
- *
- * i = i + d
- */
(__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;
- goto __pyx_L11;
+ goto __pyx_L9;
}
- __pyx_L11:;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1556
- * mnix[i+d-1] = dn
- *
- * i = i + d # <<<<<<<<<<<<<<
- *
- * return multin
- */
+ __pyx_L9:;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1556 */
__pyx_v_i = (__pyx_v_i + __pyx_v_d);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1558
- * i = i + d
- *
- * return multin # <<<<<<<<<<<<<<
- *
- * def dirichlet(self, object alpha, size=None):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1558 */
Py_INCREF(__pyx_v_multin);
__pyx_r = __pyx_v_multin;
goto __pyx_L0;
@@ -13989,26 +8476,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_se
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.multinomial");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(arrayObject_parr);
Py_DECREF(arrayObject_mnarr);
Py_DECREF(__pyx_v_shape);
Py_DECREF(__pyx_v_multin);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_pvals);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1560
- * return multin
- *
- * def dirichlet(self, object alpha, size=None): # <<<<<<<<<<<<<<
- * """dirichlet(alpha, size=None)
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_dirichlet[] = "dirichlet(alpha, size=None)\n\n Draw `size` samples of dimension k from a Dirichlet distribution. A\n Dirichlet-distributed random variable can be seen as a multivariate\n generalization of a Beta distribution. Dirichlet pdf is the conjugate\n prior of a multinomial in Bayesian inference.\n\n Parameters\n ----------\n alpha : array\n Parameter of the distribution (k dimension for sample of\n dimension k).\n size : array\n Number of samples to draw.\n\n Notes\n -----\n .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}\n\n Uses the following property for computation: for each dimension,\n draw a random sample y_i from a standard gamma generator of shape\n `alpha_i`, then\n :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldot, y_n)` is\n Dirichlet distributed.\n\n References\n ----------\n .. [1] David McKay, \"Information Theory, Inference and Learning\n Algorithms,\" chapter 23,\n http://www.inference.phy.cam.ac.uk/mackay/\n\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_f_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 0;
PyObject *__pyx_v_size = 0;
long __pyx_v_k;
@@ -14024,116 +8506,58 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self
PyObject *__pyx_v_shape;
PyObject *__pyx_v_diric;
PyObject *__pyx_r;
- Py_ssize_t __pyx_1 = 0;
+ Py_ssize_t __pyx_1;
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);
- }
- }
- 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 = 1560; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
- __Pyx_AddTraceback("mtrand.RandomState.dirichlet");
- return NULL;
- __pyx_L3:;
+ __pyx_v_size = __pyx_k60;
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_alpha, &__pyx_v_size)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_alpha);
+ Py_INCREF(__pyx_v_size);
__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);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1621
- * cdef double acc, invacc
- *
- * k = len(alpha) # <<<<<<<<<<<<<<
- * 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 = 1621; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1621 */
+ __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; goto __pyx_L1;}
__pyx_v_k = __pyx_1;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1622
- *
- * k = len(alpha)
- * alpha_arr = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1) # <<<<<<<<<<<<<<
- * 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 = 1622; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1622 */
+ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; goto __pyx_L1;}
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;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1623
- * k = len(alpha)
- * alpha_arr = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
- * alpha_data = <double*>alpha_arr.data # <<<<<<<<<<<<<<
- *
- * if size is None:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1623 */
__pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1625
- * alpha_data = <double*>alpha_arr.data
- *
- * if size is None: # <<<<<<<<<<<<<<
- * shape = (k,)
- * elif type(size) is int:
- */
- __pyx_3 = (__pyx_v_size == Py_None);
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1625 */
+ __pyx_3 = __pyx_v_size == Py_None;
if (__pyx_3) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1626
- *
- * if size is None:
- * shape = (k,) # <<<<<<<<<<<<<<
- * 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 = 1626; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_4;
__pyx_4 = 0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1627
- * if size is None:
- * shape = (k,)
- * elif type(size) is int: # <<<<<<<<<<<<<<
- * shape = (size, k)
- * else:
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
- __pyx_4 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = (__pyx_4 == ((PyObject*)&PyInt_Type));
+ __pyx_3 = __pyx_4 == ((PyObject *)(&PyInt_Type));
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_3) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1628
- * shape = (k,)
- * elif type(size) is int:
- * shape = (size, k) # <<<<<<<<<<<<<<
- * else:
- * shape = size + (k,)
- */
- __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; goto __pyx_L1;}
Py_INCREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
@@ -14141,185 +8565,85 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_4;
__pyx_4 = 0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
/*else*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1630
- * shape = (size, k)
- * else:
- * shape = size + (k,) # <<<<<<<<<<<<<<
- *
- * diric = _sp.zeros(shape, _sp.float64)
- */
- __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_shape);
__pyx_v_shape = __pyx_2;
__pyx_2 = 0;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1632
- * shape = size + (k,)
- *
- * diric = _sp.zeros(shape, _sp.float64) # <<<<<<<<<<<<<<
- * val_arr = <ndarray>diric
- * val_data= <double*>val_arr.data
- */
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1632 */
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;}
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, __pyx_4, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_diric);
__pyx_v_diric = __pyx_5;
__pyx_5 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1633
- *
- * diric = _sp.zeros(shape, _sp.float64)
- * val_arr = <ndarray>diric # <<<<<<<<<<<<<<
- * val_data= <double*>val_arr.data
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1633 */
Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric)));
Py_DECREF(((PyObject *)__pyx_v_val_arr));
__pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1634
- * diric = _sp.zeros(shape, _sp.float64)
- * val_arr = <ndarray>diric
- * val_data= <double*>val_arr.data # <<<<<<<<<<<<<<
- *
- * i = 0
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1634 */
__pyx_v_val_data = ((double *)__pyx_v_val_arr->data);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1636
- * val_data= <double*>val_arr.data
- *
- * i = 0 # <<<<<<<<<<<<<<
- * totsize = PyArray_SIZE(val_arr)
- * while i < totsize:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1636 */
__pyx_v_i = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1637
- *
- * i = 0
- * totsize = PyArray_SIZE(val_arr) # <<<<<<<<<<<<<<
- * while i < totsize:
- * acc = 0.0
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1637 */
__pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1638
- * i = 0
- * totsize = PyArray_SIZE(val_arr)
- * while i < totsize: # <<<<<<<<<<<<<<
- * acc = 0.0
- * for j from 0 <= j < k:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1638 */
while (1) {
__pyx_3 = (__pyx_v_i < __pyx_v_totsize);
if (!__pyx_3) break;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1639
- * totsize = PyArray_SIZE(val_arr)
- * while i < totsize:
- * acc = 0.0 # <<<<<<<<<<<<<<
- * for j from 0 <= j < k:
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1639 */
__pyx_v_acc = 0.0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1640
- * while i < totsize:
- * acc = 0.0
- * for j from 0 <= j < k: # <<<<<<<<<<<<<<
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- * acc = acc + val_data[i+j]
- */
- for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; __pyx_v_j++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1641
- * acc = 0.0
- * for j from 0 <= j < k:
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j]) # <<<<<<<<<<<<<<
- * acc = acc + val_data[i+j]
- * invacc = 1/acc
- */
- (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, (__pyx_v_alpha_data[__pyx_v_j]));
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1642
- * for j from 0 <= j < k:
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- * acc = acc + val_data[i+j] # <<<<<<<<<<<<<<
- * invacc = 1/acc
- * for j from 0 <= j < k:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1640 */
+ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) {
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1641 */
+ (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,(__pyx_v_alpha_data[__pyx_v_j]));
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1642 */
__pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]));
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1643
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- * acc = acc + val_data[i+j]
- * invacc = 1/acc # <<<<<<<<<<<<<<
- * for j from 0 <= j < k:
- * val_data[i+j] = val_data[i+j] * invacc
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1643 */
__pyx_v_invacc = (1 / __pyx_v_acc);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1644
- * acc = acc + val_data[i+j]
- * invacc = 1/acc
- * for j from 0 <= j < k: # <<<<<<<<<<<<<<
- * val_data[i+j] = val_data[i+j] * invacc
- * i = i + k
- */
- for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; __pyx_v_j++) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1645
- * invacc = 1/acc
- * for j from 0 <= j < k:
- * val_data[i+j] = val_data[i+j] * invacc # <<<<<<<<<<<<<<
- * i = i + k
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1644 */
+ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) {
(__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = ((__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) * __pyx_v_invacc);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1646
- * for j from 0 <= j < k:
- * val_data[i+j] = val_data[i+j] * invacc
- * i = i + k # <<<<<<<<<<<<<<
- *
- * return diric
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1646 */
__pyx_v_i = (__pyx_v_i + __pyx_v_k);
}
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1648
- * i = i + k
- *
- * return diric # <<<<<<<<<<<<<<
- *
- * # Shuffling and permutations:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1648 */
Py_INCREF(__pyx_v_diric);
__pyx_r = __pyx_v_diric;
goto __pyx_L0;
@@ -14331,393 +8655,155 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("mtrand.RandomState.dirichlet");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_alpha_arr);
Py_DECREF(__pyx_v_val_arr);
Py_DECREF(__pyx_v_shape);
Py_DECREF(__pyx_v_diric);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_alpha);
+ Py_DECREF(__pyx_v_size);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1651
- *
- * # Shuffling and permutations:
- * def shuffle(self, object x): # <<<<<<<<<<<<<<
- * """Modify a sequence in-place by shuffling its contents.
- *
- */
-
static PyObject *__pyx_n_copy;
-static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_shuffle[] = "Modify a sequence in-place by shuffling its contents.\n\n shuffle(x)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_x = 0;
long __pyx_v_i;
long __pyx_v_j;
int __pyx_v_copy;
PyObject *__pyx_r;
- Py_ssize_t __pyx_1 = 0;
+ Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
- int __pyx_6;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1659
- * cdef int copy
- *
- * i = len(x) - 1 # <<<<<<<<<<<<<<
- * try:
- * j = len(x[0])
- */
- __pyx_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ static char *__pyx_argnames[] = {"x",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_x);
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1659 */
+ __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;}
__pyx_v_i = (__pyx_1 - 1);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1660
- *
- * i = len(x) - 1
- * try: # <<<<<<<<<<<<<<
- * j = len(x[0])
- * except:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1660 */
/*try:*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1661
- * i = len(x) - 1
- * try:
- * j = len(x[0]) # <<<<<<<<<<<<<<
- * except:
- * j = 0
- */
- if (PyList_CheckExact(__pyx_v_x) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_3 = PyList_GET_ITEM(__pyx_v_x, 0); Py_INCREF(__pyx_3);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_3 = PyTuple_GET_ITEM(__pyx_v_x, 0); Py_INCREF(__pyx_3);
- } else {
- __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L4;}
- __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L4;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- __pyx_1 = PyObject_Length(__pyx_3); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L4;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L2;}
+ __pyx_1 = PyObject_Length(__pyx_2); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L2;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_v_j = __pyx_1;
}
- goto __pyx_L5;
- __pyx_L4:;
+ goto __pyx_L3;
+ __pyx_L2:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
- Py_XDECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1662
- * try:
- * j = len(x[0])
- * except: # <<<<<<<<<<<<<<
- * j = 0
- *
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1662 */
/*except:*/ {
__Pyx_AddTraceback("mtrand.shuffle");
- if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1;}
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1663
- * j = len(x[0])
- * except:
- * j = 0 # <<<<<<<<<<<<<<
- *
- * if (j == 0):
- */
+ if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
__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_L5;
+ goto __pyx_L3;
}
- __pyx_L5:;
+ __pyx_L3:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1665
- * j = 0
- *
- * if (j == 0): # <<<<<<<<<<<<<<
- * # adaptation of random.shuffle()
- * while i > 0:
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1665 */
__pyx_5 = (__pyx_v_j == 0);
if (__pyx_5) {
while (1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1667
- * if (j == 0):
- * # adaptation of random.shuffle()
- * while i > 0: # <<<<<<<<<<<<<<
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j], x[i]
- */
__pyx_5 = (__pyx_v_i > 0);
if (!__pyx_5) break;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1668
- * # adaptation of random.shuffle()
- * while i > 0:
- * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
- * x[i], x[j] = x[j], x[i]
- * i = i - 1
- */
- __pyx_v_j = rk_interval(__pyx_v_i, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1669
- * while i > 0:
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j], x[i] # <<<<<<<<<<<<<<
- * i = i - 1
- * else:
- */
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_3 = PyList_GET_ITEM(__pyx_v_x, __pyx_v_j); Py_INCREF(__pyx_3);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_3 = PyTuple_GET_ITEM(__pyx_v_x, __pyx_v_j); Py_INCREF(__pyx_3);
- } else {
- __pyx_2 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyList_GET_ITEM(__pyx_v_x, __pyx_v_i); Py_INCREF(__pyx_2);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyTuple_GET_ITEM(__pyx_v_x, __pyx_v_i); Py_INCREF(__pyx_2);
- } else {
- __pyx_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_v_x)) {
- Py_DECREF(PyList_GET_ITEM(__pyx_v_x, __pyx_v_i)); Py_INCREF(__pyx_3);
- PyList_SET_ITEM(__pyx_v_x, __pyx_v_i, __pyx_3);
- } else {
- __pyx_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyList_GET_SIZE(__pyx_v_x)) {
- Py_DECREF(PyList_GET_ITEM(__pyx_v_x, __pyx_v_j)); Py_INCREF(__pyx_2);
- PyList_SET_ITEM(__pyx_v_x, __pyx_v_j, __pyx_2);
- } else {
- __pyx_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1668 */
+ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1669 */
+ __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; goto __pyx_L1;}
+ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
+ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1670
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j], x[i]
- * i = i - 1 # <<<<<<<<<<<<<<
- * else:
- * # make copies
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1670 */
__pyx_v_i = (__pyx_v_i - 1);
}
- goto __pyx_L6;
+ goto __pyx_L4;
}
/*else*/ {
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1673
- * else:
- * # make copies
- * copy = hasattr(x[0], 'copy') # <<<<<<<<<<<<<<
- * if copy:
- * while(i > 0):
- */
- if (PyList_CheckExact(__pyx_v_x) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyList_GET_ITEM(__pyx_v_x, 0); Py_INCREF(__pyx_2);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyTuple_GET_ITEM(__pyx_v_x, 0); Py_INCREF(__pyx_2);
- } else {
- __pyx_4 = PyInt_FromLong(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- __pyx_5 = PyObject_HasAttr(__pyx_2, __pyx_n_copy); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1673 */
+ __pyx_4 = __Pyx_GetItemInt(__pyx_v_x, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;}
+ __pyx_5 = PyObject_HasAttr(__pyx_4,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_v_copy = __pyx_5;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1674
- * # make copies
- * copy = hasattr(x[0], 'copy')
- * if copy: # <<<<<<<<<<<<<<
- * while(i > 0):
- * j = rk_interval(i, self.internal_state)
- */
- __pyx_6 = __pyx_v_copy;
- if (__pyx_6) {
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1674 */
+ __pyx_5 = __pyx_v_copy;
+ if (__pyx_5) {
while (1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1675
- * copy = hasattr(x[0], 'copy')
- * if copy:
- * while(i > 0): # <<<<<<<<<<<<<<
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j].copy(), x[i].copy()
- */
__pyx_5 = (__pyx_v_i > 0);
if (!__pyx_5) break;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1676
- * if copy:
- * while(i > 0):
- * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
- * x[i], x[j] = x[j].copy(), x[i].copy()
- * i = i - 1
- */
- __pyx_v_j = rk_interval(__pyx_v_i, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1677
- * while(i > 0):
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j].copy(), x[i].copy() # <<<<<<<<<<<<<<
- * i = i - 1
- * else:
- */
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_4 = PyList_GET_ITEM(__pyx_v_x, __pyx_v_j); Py_INCREF(__pyx_4);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_4 = PyTuple_GET_ITEM(__pyx_v_x, __pyx_v_j); Py_INCREF(__pyx_4);
- } else {
- __pyx_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
- __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_3 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1676 */
+ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1677 */
+ __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyList_GET_ITEM(__pyx_v_x, __pyx_v_i); Py_INCREF(__pyx_2);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyTuple_GET_ITEM(__pyx_v_x, __pyx_v_i); Py_INCREF(__pyx_2);
- } else {
- __pyx_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyObject_Call(__pyx_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_v_x)) {
- Py_DECREF(PyList_GET_ITEM(__pyx_v_x, __pyx_v_i)); Py_INCREF(__pyx_3);
- PyList_SET_ITEM(__pyx_v_x, __pyx_v_i, __pyx_3);
- } else {
- __pyx_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
+ __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyList_GET_SIZE(__pyx_v_x)) {
- Py_DECREF(PyList_GET_ITEM(__pyx_v_x, __pyx_v_j)); Py_INCREF(__pyx_2);
- PyList_SET_ITEM(__pyx_v_x, __pyx_v_j, __pyx_2);
- } else {
- __pyx_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
+ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1678
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j].copy(), x[i].copy()
- * i = i - 1 # <<<<<<<<<<<<<<
- * else:
- * while(i > 0):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1678 */
__pyx_v_i = (__pyx_v_i - 1);
}
- goto __pyx_L9;
+ goto __pyx_L7;
}
/*else*/ {
while (1) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1680
- * i = i - 1
- * else:
- * while(i > 0): # <<<<<<<<<<<<<<
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j][:], x[i][:]
- */
__pyx_5 = (__pyx_v_i > 0);
if (!__pyx_5) break;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1681
- * else:
- * while(i > 0):
- * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
- * x[i], x[j] = x[j][:], x[i][:]
- * i = i - 1
- */
- __pyx_v_j = rk_interval(__pyx_v_i, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1682
- * while(i > 0):
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j][:], x[i][:] # <<<<<<<<<<<<<<
- * i = i - 1
- *
- */
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyList_GET_ITEM(__pyx_v_x, __pyx_v_j); Py_INCREF(__pyx_2);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyTuple_GET_ITEM(__pyx_v_x, __pyx_v_j); Py_INCREF(__pyx_2);
- } else {
- __pyx_4 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyList_GET_ITEM(__pyx_v_x, __pyx_v_i); Py_INCREF(__pyx_2);
- } else if (PyTuple_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyTuple_GET_SIZE(__pyx_v_x)) {
- __pyx_2 = PyTuple_GET_ITEM(__pyx_v_x, __pyx_v_i); Py_INCREF(__pyx_2);
- } else {
- __pyx_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_v_x)) {
- Py_DECREF(PyList_GET_ITEM(__pyx_v_x, __pyx_v_i)); Py_INCREF(__pyx_3);
- PyList_SET_ITEM(__pyx_v_x, __pyx_v_i, __pyx_3);
- } else {
- __pyx_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1681 */
+ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1682 */
+ __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
+ __pyx_4 = PySequence_GetSlice(__pyx_3, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- if (PyList_CheckExact(__pyx_v_x) && 0 <= __pyx_v_j && __pyx_v_j < PyList_GET_SIZE(__pyx_v_x)) {
- Py_DECREF(PyList_GET_ITEM(__pyx_v_x, __pyx_v_j)); Py_INCREF(__pyx_4);
- PyList_SET_ITEM(__pyx_v_x, __pyx_v_j, __pyx_4);
- } else {
- __pyx_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
+ __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
+ __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1683
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j][:], x[i][:]
- * i = i - 1 # <<<<<<<<<<<<<<
- *
- * def permutation(self, object x):
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1683 */
__pyx_v_i = (__pyx_v_i - 1);
}
}
- __pyx_L9:;
+ __pyx_L7:;
}
- __pyx_L6:;
+ __pyx_L4:;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
@@ -14726,119 +8812,84 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self,
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("mtrand.RandomState.shuffle");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_x);
return __pyx_r;
}
-/* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1685
- * i = i - 1
- *
- * def permutation(self, object x): # <<<<<<<<<<<<<<
- * """Given an integer, return a shuffled sequence of integers >= 0 and
- * < x; given a sequence, return a shuffled array copy.
- */
-
static PyObject *__pyx_n_arange;
-static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
+static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6mtrand_11RandomState_permutation[] = "Given an integer, return a shuffled sequence of integers >= 0 and\n < x; given a sequence, return a shuffled array copy.\n\n permutation(x)\n ";
-static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_arr;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
+ static char *__pyx_argnames[] = {"x",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
+ Py_INCREF(__pyx_v_self);
+ Py_INCREF(__pyx_v_x);
__pyx_v_arr = Py_None; Py_INCREF(Py_None);
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1691
- * permutation(x)
- * """
- * if isinstance(x, (int, _sp.integer)): # <<<<<<<<<<<<<<
- * arr = _sp.arange(x)
- * else:
- */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_integer); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1691 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_integer); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(((PyObject*)&PyInt_Type));
- PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject*)&PyInt_Type));
+ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;}
+ 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, __pyx_1); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_IsInstance(__pyx_v_x,__pyx_1); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1692
- * """
- * if isinstance(x, (int, _sp.integer)):
- * arr = _sp.arange(x) # <<<<<<<<<<<<<<
- * else:
- * arr = _sp.array(x)
- */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;}
Py_INCREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);
- __pyx_4 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_arr);
__pyx_v_arr = __pyx_4;
__pyx_4 = 0;
- goto __pyx_L4;
+ goto __pyx_L2;
}
/*else*/ {
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1694
- * arr = _sp.arange(x)
- * else:
- * arr = _sp.array(x) # <<<<<<<<<<<<<<
- * self.shuffle(arr)
- * return arr
- */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;}
Py_INCREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_x);
- __pyx_1 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_arr);
__pyx_v_arr = __pyx_1;
__pyx_1 = 0;
}
- __pyx_L4:;
+ __pyx_L2:;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1695
- * else:
- * arr = _sp.array(x)
- * self.shuffle(arr) # <<<<<<<<<<<<<<
- * return arr
- *
- */
- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1695 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;}
Py_INCREF(__pyx_v_arr);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_arr);
- __pyx_1 = PyObject_Call(__pyx_2, __pyx_4, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1696
- * arr = _sp.array(x)
- * self.shuffle(arr)
- * return arr # <<<<<<<<<<<<<<
- *
- * _rand = RandomState()
- */
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1696 */
Py_INCREF(__pyx_v_arr);
__pyx_r = __pyx_v_arr;
goto __pyx_L0;
@@ -14850,22 +8901,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_se
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("mtrand.RandomState.permutation");
- __pyx_r = NULL;
+ __pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_arr);
+ Py_DECREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_x);
return __pyx_r;
}
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_MT19937, "MT19937"},
- {&__pyx_n_TypeError, "TypeError"},
- {&__pyx_n_ValueError, "ValueError"},
{&__pyx_n___RandomState_ctor, "__RandomState_ctor"},
- {&__pyx_n___dealloc__, "__dealloc__"},
- {&__pyx_n___getstate__, "__getstate__"},
- {&__pyx_n___init__, "__init__"},
- {&__pyx_n___reduce__, "__reduce__"},
- {&__pyx_n___setstate__, "__setstate__"},
{&__pyx_n__rand, "_rand"},
{&__pyx_n__sp, "_sp"},
{&__pyx_n_add, "add"},
@@ -14932,7 +8978,6 @@ static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_standard_t, "standard_t"},
{&__pyx_n_subtract, "subtract"},
{&__pyx_n_svd, "svd"},
- {&__pyx_n_tomaxint, "tomaxint"},
{&__pyx_n_triangular, "triangular"},
{&__pyx_n_uint, "uint"},
{&__pyx_n_uint32, "uint32"},
@@ -14946,113 +8991,113 @@ static __Pyx_InternTabEntry __pyx_intern_tab[] = {
};
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_k_18p, __pyx_k_18, sizeof(__pyx_k_18), 0},
- {&__pyx_k_19p, __pyx_k_19, sizeof(__pyx_k_19), 0},
- {&__pyx_k_20p, __pyx_k_20, sizeof(__pyx_k_20), 0},
- {&__pyx_k_21p, __pyx_k_21, sizeof(__pyx_k_21), 0},
- {&__pyx_k_22p, __pyx_k_22, sizeof(__pyx_k_22), 0},
- {&__pyx_k_23p, __pyx_k_23, sizeof(__pyx_k_23), 0},
- {&__pyx_k_26p, __pyx_k_26, sizeof(__pyx_k_26), 0},
- {&__pyx_k_27p, __pyx_k_27, sizeof(__pyx_k_27), 0},
- {&__pyx_k_28p, __pyx_k_28, sizeof(__pyx_k_28), 0},
- {&__pyx_k_30p, __pyx_k_30, sizeof(__pyx_k_30), 0},
- {&__pyx_k_31p, __pyx_k_31, sizeof(__pyx_k_31), 0},
- {&__pyx_k_32p, __pyx_k_32, sizeof(__pyx_k_32), 0},
- {&__pyx_k_33p, __pyx_k_33, sizeof(__pyx_k_33), 0},
- {&__pyx_k_34p, __pyx_k_34, sizeof(__pyx_k_34), 0},
- {&__pyx_k_35p, __pyx_k_35, sizeof(__pyx_k_35), 0},
- {&__pyx_k_36p, __pyx_k_36, sizeof(__pyx_k_36), 0},
- {&__pyx_k_37p, __pyx_k_37, sizeof(__pyx_k_37), 0},
- {&__pyx_k_38p, __pyx_k_38, sizeof(__pyx_k_38), 0},
- {&__pyx_k_39p, __pyx_k_39, sizeof(__pyx_k_39), 0},
- {&__pyx_k_40p, __pyx_k_40, sizeof(__pyx_k_40), 0},
- {&__pyx_k_41p, __pyx_k_41, sizeof(__pyx_k_41), 0},
- {&__pyx_k_42p, __pyx_k_42, sizeof(__pyx_k_42), 0},
- {&__pyx_k_43p, __pyx_k_43, sizeof(__pyx_k_43), 0},
- {&__pyx_k_44p, __pyx_k_44, sizeof(__pyx_k_44), 0},
- {&__pyx_k_45p, __pyx_k_45, sizeof(__pyx_k_45), 0},
- {&__pyx_k_46p, __pyx_k_46, sizeof(__pyx_k_46), 0},
- {&__pyx_k_47p, __pyx_k_47, sizeof(__pyx_k_47), 0},
- {&__pyx_k_48p, __pyx_k_48, sizeof(__pyx_k_48), 0},
- {&__pyx_k_49p, __pyx_k_49, sizeof(__pyx_k_49), 0},
- {&__pyx_k_50p, __pyx_k_50, sizeof(__pyx_k_50), 0},
- {&__pyx_k_51p, __pyx_k_51, sizeof(__pyx_k_51), 0},
- {&__pyx_k_52p, __pyx_k_52, sizeof(__pyx_k_52), 0},
- {&__pyx_k_53p, __pyx_k_53, sizeof(__pyx_k_53), 0},
- {&__pyx_k_54p, __pyx_k_54, sizeof(__pyx_k_54), 0},
- {&__pyx_k_55p, __pyx_k_55, sizeof(__pyx_k_55), 0},
- {&__pyx_k_56p, __pyx_k_56, sizeof(__pyx_k_56), 0},
- {&__pyx_k_57p, __pyx_k_57, sizeof(__pyx_k_57), 0},
- {&__pyx_k_58p, __pyx_k_58, sizeof(__pyx_k_58), 0},
- {&__pyx_k_59p, __pyx_k_59, sizeof(__pyx_k_59), 0},
- {&__pyx_k_60p, __pyx_k_60, sizeof(__pyx_k_60), 0},
- {&__pyx_k_61p, __pyx_k_61, sizeof(__pyx_k_61), 0},
- {&__pyx_k_62p, __pyx_k_62, sizeof(__pyx_k_62), 0},
- {&__pyx_k_63p, __pyx_k_63, sizeof(__pyx_k_63), 0},
- {&__pyx_k_64p, __pyx_k_64, sizeof(__pyx_k_64), 0},
- {&__pyx_k_65p, __pyx_k_65, sizeof(__pyx_k_65), 0},
- {&__pyx_k_66p, __pyx_k_66, sizeof(__pyx_k_66), 0},
- {&__pyx_k_67p, __pyx_k_67, sizeof(__pyx_k_67), 0},
- {&__pyx_k_68p, __pyx_k_68, sizeof(__pyx_k_68), 0},
- {&__pyx_k_69p, __pyx_k_69, sizeof(__pyx_k_69), 0},
- {&__pyx_k_70p, __pyx_k_70, sizeof(__pyx_k_70), 0},
- {&__pyx_k_71p, __pyx_k_71, sizeof(__pyx_k_71), 0},
- {&__pyx_k_72p, __pyx_k_72, sizeof(__pyx_k_72), 0},
- {&__pyx_k_73p, __pyx_k_73, sizeof(__pyx_k_73), 0},
- {&__pyx_k_74p, __pyx_k_74, sizeof(__pyx_k_74), 0},
- {&__pyx_k_75p, __pyx_k_75, sizeof(__pyx_k_75), 0},
- {&__pyx_k_76p, __pyx_k_76, sizeof(__pyx_k_76), 0},
- {&__pyx_k_77p, __pyx_k_77, sizeof(__pyx_k_77), 0},
- {&__pyx_k_78p, __pyx_k_78, sizeof(__pyx_k_78), 0},
- {&__pyx_k_79p, __pyx_k_79, sizeof(__pyx_k_79), 0},
- {&__pyx_k_80p, __pyx_k_80, sizeof(__pyx_k_80), 0},
- {&__pyx_k_81p, __pyx_k_81, sizeof(__pyx_k_81), 0},
- {&__pyx_k_82p, __pyx_k_82, sizeof(__pyx_k_82), 0},
- {&__pyx_k_83p, __pyx_k_83, sizeof(__pyx_k_83), 0},
- {&__pyx_k_84p, __pyx_k_84, sizeof(__pyx_k_84), 0},
- {&__pyx_k_85p, __pyx_k_85, sizeof(__pyx_k_85), 0},
- {&__pyx_k_86p, __pyx_k_86, sizeof(__pyx_k_86), 0},
- {&__pyx_k_87p, __pyx_k_87, sizeof(__pyx_k_87), 0},
- {&__pyx_k_88p, __pyx_k_88, sizeof(__pyx_k_88), 0},
- {&__pyx_k_89p, __pyx_k_89, sizeof(__pyx_k_89), 0},
- {&__pyx_k_90p, __pyx_k_90, sizeof(__pyx_k_90), 0},
- {&__pyx_k_91p, __pyx_k_91, sizeof(__pyx_k_91), 0},
- {&__pyx_k_92p, __pyx_k_92, sizeof(__pyx_k_92), 0},
- {&__pyx_k_93p, __pyx_k_93, sizeof(__pyx_k_93), 0},
- {&__pyx_k_94p, __pyx_k_94, sizeof(__pyx_k_94), 0},
- {&__pyx_k_95p, __pyx_k_95, sizeof(__pyx_k_95), 0},
- {&__pyx_k_96p, __pyx_k_96, sizeof(__pyx_k_96), 0},
- {&__pyx_k_97p, __pyx_k_97, sizeof(__pyx_k_97), 0},
- {&__pyx_k_98p, __pyx_k_98, sizeof(__pyx_k_98), 0},
- {&__pyx_k_99p, __pyx_k_99, sizeof(__pyx_k_99), 0},
- {&__pyx_k_100p, __pyx_k_100, sizeof(__pyx_k_100), 0},
- {&__pyx_k_101p, __pyx_k_101, sizeof(__pyx_k_101), 0},
- {&__pyx_k_102p, __pyx_k_102, sizeof(__pyx_k_102), 0},
- {&__pyx_k_103p, __pyx_k_103, sizeof(__pyx_k_103), 0},
- {&__pyx_k_104p, __pyx_k_104, sizeof(__pyx_k_104), 0},
- {&__pyx_k_105p, __pyx_k_105, sizeof(__pyx_k_105), 0},
- {&__pyx_k_106p, __pyx_k_106, sizeof(__pyx_k_106), 0},
- {&__pyx_k_107p, __pyx_k_107, sizeof(__pyx_k_107), 0},
- {&__pyx_k_108p, __pyx_k_108, sizeof(__pyx_k_108), 0},
- {&__pyx_k_109p, __pyx_k_109, sizeof(__pyx_k_109), 0},
- {&__pyx_k_110p, __pyx_k_110, sizeof(__pyx_k_110), 0},
- {&__pyx_k_111p, __pyx_k_111, sizeof(__pyx_k_111), 0},
- {&__pyx_k_112p, __pyx_k_112, sizeof(__pyx_k_112), 0},
- {&__pyx_k_113p, __pyx_k_113, sizeof(__pyx_k_113), 0},
- {&__pyx_k_114p, __pyx_k_114, sizeof(__pyx_k_114), 0},
- {&__pyx_k_115p, __pyx_k_115, sizeof(__pyx_k_115), 0},
- {&__pyx_k_116p, __pyx_k_116, sizeof(__pyx_k_116), 0},
- {&__pyx_k_117p, __pyx_k_117, sizeof(__pyx_k_117), 0},
- {&__pyx_k_118p, __pyx_k_118, sizeof(__pyx_k_118), 0},
- {&__pyx_k_119p, __pyx_k_119, sizeof(__pyx_k_119), 0},
- {&__pyx_k_120p, __pyx_k_120, sizeof(__pyx_k_120), 0},
- {&__pyx_k_121p, __pyx_k_121, sizeof(__pyx_k_121), 0},
- {&__pyx_k_122p, __pyx_k_122, sizeof(__pyx_k_122), 0},
- {&__pyx_k_123p, __pyx_k_123, sizeof(__pyx_k_123), 0},
- {&__pyx_k_124p, __pyx_k_124, sizeof(__pyx_k_124), 0},
- {&__pyx_k_125p, __pyx_k_125, sizeof(__pyx_k_125), 0},
- {&__pyx_k_127p, __pyx_k_127, sizeof(__pyx_k_127), 0},
- {0, 0, 0, 0}
+ {&__pyx_k61p, __pyx_k61, sizeof(__pyx_k61)},
+ {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},
+ {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},
+ {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},
+ {&__pyx_k65p, __pyx_k65, sizeof(__pyx_k65)},
+ {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},
+ {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},
+ {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},
+ {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},
+ {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},
+ {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},
+ {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},
+ {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},
+ {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},
+ {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},
+ {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},
+ {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},
+ {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},
+ {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},
+ {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},
+ {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},
+ {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},
+ {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},
+ {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},
+ {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},
+ {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},
+ {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},
+ {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},
+ {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},
+ {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},
+ {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},
+ {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},
+ {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},
+ {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},
+ {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},
+ {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},
+ {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},
+ {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},
+ {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},
+ {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},
+ {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},
+ {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},
+ {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},
+ {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},
+ {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},
+ {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},
+ {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},
+ {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},
+ {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},
+ {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},
+ {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},
+ {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},
+ {&__pyx_k116p, __pyx_k116, sizeof(__pyx_k116)},
+ {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},
+ {&__pyx_k118p, __pyx_k118, sizeof(__pyx_k118)},
+ {&__pyx_k119p, __pyx_k119, sizeof(__pyx_k119)},
+ {&__pyx_k120p, __pyx_k120, sizeof(__pyx_k120)},
+ {&__pyx_k121p, __pyx_k121, sizeof(__pyx_k121)},
+ {&__pyx_k122p, __pyx_k122, sizeof(__pyx_k122)},
+ {&__pyx_k123p, __pyx_k123, sizeof(__pyx_k123)},
+ {&__pyx_k124p, __pyx_k124, sizeof(__pyx_k124)},
+ {&__pyx_k125p, __pyx_k125, sizeof(__pyx_k125)},
+ {&__pyx_k126p, __pyx_k126, sizeof(__pyx_k126)},
+ {&__pyx_k127p, __pyx_k127, sizeof(__pyx_k127)},
+ {&__pyx_k128p, __pyx_k128, sizeof(__pyx_k128)},
+ {&__pyx_k129p, __pyx_k129, sizeof(__pyx_k129)},
+ {&__pyx_k130p, __pyx_k130, sizeof(__pyx_k130)},
+ {&__pyx_k131p, __pyx_k131, sizeof(__pyx_k131)},
+ {&__pyx_k132p, __pyx_k132, sizeof(__pyx_k132)},
+ {&__pyx_k133p, __pyx_k133, sizeof(__pyx_k133)},
+ {&__pyx_k134p, __pyx_k134, sizeof(__pyx_k134)},
+ {&__pyx_k135p, __pyx_k135, sizeof(__pyx_k135)},
+ {&__pyx_k136p, __pyx_k136, sizeof(__pyx_k136)},
+ {&__pyx_k137p, __pyx_k137, sizeof(__pyx_k137)},
+ {&__pyx_k138p, __pyx_k138, sizeof(__pyx_k138)},
+ {&__pyx_k139p, __pyx_k139, sizeof(__pyx_k139)},
+ {&__pyx_k140p, __pyx_k140, sizeof(__pyx_k140)},
+ {&__pyx_k141p, __pyx_k141, sizeof(__pyx_k141)},
+ {&__pyx_k142p, __pyx_k142, sizeof(__pyx_k142)},
+ {&__pyx_k143p, __pyx_k143, sizeof(__pyx_k143)},
+ {&__pyx_k144p, __pyx_k144, sizeof(__pyx_k144)},
+ {&__pyx_k145p, __pyx_k145, sizeof(__pyx_k145)},
+ {&__pyx_k146p, __pyx_k146, sizeof(__pyx_k146)},
+ {&__pyx_k147p, __pyx_k147, sizeof(__pyx_k147)},
+ {&__pyx_k148p, __pyx_k148, sizeof(__pyx_k148)},
+ {&__pyx_k149p, __pyx_k149, sizeof(__pyx_k149)},
+ {&__pyx_k150p, __pyx_k150, sizeof(__pyx_k150)},
+ {&__pyx_k151p, __pyx_k151, sizeof(__pyx_k151)},
+ {&__pyx_k152p, __pyx_k152, sizeof(__pyx_k152)},
+ {&__pyx_k153p, __pyx_k153, sizeof(__pyx_k153)},
+ {&__pyx_k154p, __pyx_k154, sizeof(__pyx_k154)},
+ {&__pyx_k155p, __pyx_k155, sizeof(__pyx_k155)},
+ {&__pyx_k156p, __pyx_k156, sizeof(__pyx_k156)},
+ {&__pyx_k157p, __pyx_k157, sizeof(__pyx_k157)},
+ {&__pyx_k158p, __pyx_k158, sizeof(__pyx_k158)},
+ {&__pyx_k159p, __pyx_k159, sizeof(__pyx_k159)},
+ {&__pyx_k160p, __pyx_k160, sizeof(__pyx_k160)},
+ {&__pyx_k161p, __pyx_k161, sizeof(__pyx_k161)},
+ {&__pyx_k162p, __pyx_k162, sizeof(__pyx_k162)},
+ {&__pyx_k163p, __pyx_k163, sizeof(__pyx_k163)},
+ {&__pyx_k164p, __pyx_k164, sizeof(__pyx_k164)},
+ {&__pyx_k165p, __pyx_k165, sizeof(__pyx_k165)},
+ {&__pyx_k166p, __pyx_k166, sizeof(__pyx_k166)},
+ {&__pyx_k167p, __pyx_k167, sizeof(__pyx_k167)},
+ {&__pyx_k168p, __pyx_k168, sizeof(__pyx_k168)},
+ {&__pyx_k170p, __pyx_k170, sizeof(__pyx_k170)},
+ {0, 0, 0}
};
static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {
@@ -15066,7 +9111,7 @@ static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
++o->ob_refcnt;
- __pyx_pf_6mtrand_11RandomState___dealloc__(o);
+ __pyx_f_6mtrand_11RandomState___dealloc__(o);
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
--o->ob_refcnt;
PyErr_Restore(etype, eval, etb);
@@ -15075,56 +9120,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},
+ {"seed", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},
+ {"get_state", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},
+ {"set_state", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},
+ {"__getstate__", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},
+ {"__setstate__", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},
+ {"__reduce__", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},
+ {"random_sample", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},
+ {"tomaxint", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},
+ {"randint", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},
+ {"bytes", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},
+ {"uniform", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},
+ {"rand", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},
+ {"randn", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},
+ {"random_integers", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},
+ {"standard_normal", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},
+ {"normal", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},
+ {"beta", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},
+ {"exponential", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},
+ {"standard_exponential", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},
+ {"standard_gamma", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},
+ {"gamma", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},
+ {"f", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},
+ {"noncentral_f", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},
+ {"chisquare", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},
+ {"noncentral_chisquare", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},
+ {"standard_cauchy", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},
+ {"standard_t", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},
+ {"vonmises", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},
+ {"pareto", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},
+ {"weibull", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},
+ {"power", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},
+ {"laplace", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},
+ {"gumbel", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},
+ {"logistic", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},
+ {"lognormal", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},
+ {"rayleigh", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},
+ {"wald", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},
+ {"triangular", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},
+ {"binomial", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},
+ {"negative_binomial", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},
+ {"poisson", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},
+ {"zipf", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},
+ {"geometric", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},
+ {"hypergeometric", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},
+ {"logseries", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},
+ {"multivariate_normal", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},
+ {"multinomial", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},
+ {"dirichlet", (PyCFunction)__pyx_f_6mtrand_11RandomState_dirichlet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_dirichlet},
+ {"shuffle", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},
+ {"permutation", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},
{0, 0, 0, 0}
};
@@ -15235,7 +9280,7 @@ PyTypeObject __pyx_type_6mtrand_RandomState = {
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
- __pyx_pf_6mtrand_11RandomState___init__, /*tp_init*/
+ __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_6mtrand_RandomState, /*tp_new*/
0, /*tp_free*/
@@ -15273,792 +9318,572 @@ PyMODINIT_FUNC initmtrand(void) {
PyObject *__pyx_16 = 0;
PyObject *__pyx_17 = 0;
PyObject *__pyx_18 = 0;
- /*--- Libary function declarations ---*/
__pyx_init_filenames();
- /*--- Module creation code ---*/
__pyx_m = Py_InitModule4("mtrand", __pyx_methods, 0, 0, PYTHON_API_VERSION);
- if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
+ if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};
+ Py_INCREF(__pyx_m);
__pyx_b = PyImport_AddModule("__builtin__");
- if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
- /*--- Intern code ---*/
- __pyx_int_624 = PyInt_FromLong(624); if (unlikely(!__pyx_int_624)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
- if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
- /*--- String init code ---*/
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;};
- /*--- Builtin init code ---*/
- __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_skip_dispatch = 0;
- /*--- Global init code ---*/
- /*--- Function export code ---*/
- /*--- Function import code ---*/
- /*--- Type init code ---*/
- __pyx_ptype_6mtrand_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_6mtrand_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __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;}
- __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;}
- if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};
+ if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};
+ __pyx_ptype_6mtrand_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtype) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; goto __pyx_L1;}
+ __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; goto __pyx_L1;}
+ __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (!__pyx_ptype_6mtrand_flatiter) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; goto __pyx_L1;}
+ __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (!__pyx_ptype_6mtrand_broadcast) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; goto __pyx_L1;}
+ if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;}
+ if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;}
__pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;
- /*--- Type import code ---*/
- /*--- Execution code ---*/
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":120
- *
- * # Initialize numpy
- * import_array() # <<<<<<<<<<<<<<
- *
- * import numpy as _sp
- */
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":120 */
import_array();
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":122
- * import_array()
- *
- * import numpy as _sp # <<<<<<<<<<<<<<
- *
- * cdef object cont0_array(rk_state *state, rk_cont0 func, object size):
- */
- __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":122 */
+ __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":640
- * return bytestring
- *
- * def uniform(self, low=0.0, high=1.0, size=None): # <<<<<<<<<<<<<<
- * """Uniform distribution over [low, high).
- *
- */
- __pyx_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_2 = __pyx_1;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":489 */
+ Py_INCREF(Py_None);
+ __pyx_k2 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":499 */
+ Py_INCREF(Py_None);
+ __pyx_k3 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":581 */
+ Py_INCREF(Py_None);
+ __pyx_k4 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":588 */
+ Py_INCREF(Py_None);
+ __pyx_k5 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":595 */
+ Py_INCREF(Py_None);
+ __pyx_k6 = Py_None;
+ Py_INCREF(Py_None);
+ __pyx_k7 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":640 */
+ __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;}
+ __pyx_k8 = __pyx_1;
__pyx_1 = 0;
- __pyx_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_3 = __pyx_2;
+ __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;}
+ __pyx_k9 = __pyx_2;
__pyx_2 = 0;
-
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":713
- * return cont0_array(self.internal_state, rk_gauss, size)
- *
- * def normal(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Normal distribution (mean=loc, stdev=scale).
- *
- */
- __pyx_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_4 = __pyx_3;
+ Py_INCREF(Py_None);
+ __pyx_k10 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":693 */
+ Py_INCREF(Py_None);
+ __pyx_k11 = Py_None;
+ Py_INCREF(Py_None);
+ __pyx_k12 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":706 */
+ Py_INCREF(Py_None);
+ __pyx_k13 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":713 */
+ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}
+ __pyx_k14 = __pyx_3;
__pyx_3 = 0;
- __pyx_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_5 = __pyx_4;
+ __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}
+ __pyx_k15 = __pyx_4;
__pyx_4 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k16 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":763
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- *
- * def exponential(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Exponential distribution.
- *
- */
- __pyx_5 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_6 = __pyx_5;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":736 */
+ Py_INCREF(Py_None);
+ __pyx_k17 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":763 */
+ __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; goto __pyx_L1;}
+ __pyx_k18 = __pyx_5;
__pyx_5 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k19 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":784 */
+ Py_INCREF(Py_None);
+ __pyx_k20 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":811
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- *
- * def gamma(self, shape, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Gamma distribution.
- *
- */
- __pyx_6 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_7 = __pyx_6;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":791 */
+ Py_INCREF(Py_None);
+ __pyx_k21 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":811 */
+ __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}
+ __pyx_k22 = __pyx_6;
__pyx_6 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k23 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":837 */
+ Py_INCREF(Py_None);
+ __pyx_k24 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":864 */
+ Py_INCREF(Py_None);
+ __pyx_k25 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":900 */
+ Py_INCREF(Py_None);
+ __pyx_k26 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":921 */
+ Py_INCREF(Py_None);
+ __pyx_k27 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":949 */
+ Py_INCREF(Py_None);
+ __pyx_k28 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":956 */
+ Py_INCREF(Py_None);
+ __pyx_k29 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":977 */
+ Py_INCREF(Py_None);
+ __pyx_k30 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1001 */
+ Py_INCREF(Py_None);
+ __pyx_k31 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1022 */
+ Py_INCREF(Py_None);
+ __pyx_k32 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1043 */
+ Py_INCREF(Py_None);
+ __pyx_k33 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1064
- * return cont1_array(self.internal_state, rk_power, size, oa)
- *
- * def laplace(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Laplace distribution.
- *
- */
- __pyx_7 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_8 = __pyx_7;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1064 */
+ __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;}
+ __pyx_k34 = __pyx_7;
__pyx_7 = 0;
- __pyx_8 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_9 = __pyx_8;
+ __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;}
+ __pyx_k35 = __pyx_8;
__pyx_8 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k36 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1086
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- *
- * def gumbel(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Gumbel distribution.
- *
- */
- __pyx_9 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_10 = __pyx_9;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1086 */
+ __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;}
+ __pyx_k37 = __pyx_9;
__pyx_9 = 0;
- __pyx_10 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_11 = __pyx_10;
+ __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;}
+ __pyx_k38 = __pyx_10;
__pyx_10 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k39 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1108
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- *
- * def logistic(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Logistic distribution.
- *
- */
- __pyx_11 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_12 = __pyx_11;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1108 */
+ __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;}
+ __pyx_k40 = __pyx_11;
__pyx_11 = 0;
- __pyx_12 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_13 = __pyx_12;
+ __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;}
+ __pyx_k41 = __pyx_12;
__pyx_12 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k42 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1130
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- *
- * def lognormal(self, mean=0.0, sigma=1.0, size=None): # <<<<<<<<<<<<<<
- * """Log-normal distribution.
- *
- */
- __pyx_13 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_14 = __pyx_13;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1130 */
+ __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; goto __pyx_L1;}
+ __pyx_k43 = __pyx_13;
__pyx_13 = 0;
- __pyx_14 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_15 = __pyx_14;
+ __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; goto __pyx_L1;}
+ __pyx_k44 = __pyx_14;
__pyx_14 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k45 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1159
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- *
- * def rayleigh(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """Rayleigh distribution.
- *
- */
- __pyx_15 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_16 = __pyx_15;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1159 */
+ __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;}
+ __pyx_k46 = __pyx_15;
__pyx_15 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k47 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1313
- * on, op)
- *
- * def poisson(self, lam=1.0, size=None): # <<<<<<<<<<<<<<
- * """Poisson distribution.
- *
- */
- __pyx_16 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_k_17 = __pyx_16;
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1181 */
+ Py_INCREF(Py_None);
+ __pyx_k48 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1209 */
+ Py_INCREF(Py_None);
+ __pyx_k49 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1246 */
+ Py_INCREF(Py_None);
+ __pyx_k50 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1278 */
+ Py_INCREF(Py_None);
+ __pyx_k51 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1313 */
+ __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; goto __pyx_L1;}
+ __pyx_k52 = __pyx_16;
__pyx_16 = 0;
+ Py_INCREF(Py_None);
+ __pyx_k53 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1333 */
+ Py_INCREF(Py_None);
+ __pyx_k54 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1354 */
+ Py_INCREF(Py_None);
+ __pyx_k55 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1381 */
+ Py_INCREF(Py_None);
+ __pyx_k56 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1426 */
+ Py_INCREF(Py_None);
+ __pyx_k57 = Py_None;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1698
- * return arr
- *
- * _rand = RandomState() # <<<<<<<<<<<<<<
- * seed = _rand.seed
- * get_state = _rand.get_state
- */
- __pyx_17 = PyObject_Call(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1;}
- if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1452 */
+ Py_INCREF(Py_None);
+ __pyx_k58 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1510 */
+ Py_INCREF(Py_None);
+ __pyx_k59 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1560 */
+ Py_INCREF(Py_None);
+ __pyx_k60 = Py_None;
+
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1698 */
+ __pyx_17 = PyObject_CallObject(((PyObject *)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1699
- *
- * _rand = RandomState()
- * seed = _rand.seed # <<<<<<<<<<<<<<
- * get_state = _rand.get_state
- * set_state = _rand.set_state
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1699 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1700
- * _rand = RandomState()
- * seed = _rand.seed
- * get_state = _rand.get_state # <<<<<<<<<<<<<<
- * set_state = _rand.set_state
- * random_sample = _rand.random_sample
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1700 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1701
- * seed = _rand.seed
- * get_state = _rand.get_state
- * set_state = _rand.set_state # <<<<<<<<<<<<<<
- * random_sample = _rand.random_sample
- * randint = _rand.randint
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1701 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1702
- * get_state = _rand.get_state
- * set_state = _rand.set_state
- * random_sample = _rand.random_sample # <<<<<<<<<<<<<<
- * randint = _rand.randint
- * bytes = _rand.bytes
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1702 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1703
- * set_state = _rand.set_state
- * random_sample = _rand.random_sample
- * randint = _rand.randint # <<<<<<<<<<<<<<
- * bytes = _rand.bytes
- * uniform = _rand.uniform
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1703 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1704
- * random_sample = _rand.random_sample
- * randint = _rand.randint
- * bytes = _rand.bytes # <<<<<<<<<<<<<<
- * uniform = _rand.uniform
- * rand = _rand.rand
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1704 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1705
- * randint = _rand.randint
- * bytes = _rand.bytes
- * uniform = _rand.uniform # <<<<<<<<<<<<<<
- * rand = _rand.rand
- * randn = _rand.randn
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1705 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1706
- * bytes = _rand.bytes
- * uniform = _rand.uniform
- * rand = _rand.rand # <<<<<<<<<<<<<<
- * randn = _rand.randn
- * random_integers = _rand.random_integers
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1706 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1707
- * uniform = _rand.uniform
- * rand = _rand.rand
- * randn = _rand.randn # <<<<<<<<<<<<<<
- * random_integers = _rand.random_integers
- * standard_normal = _rand.standard_normal
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1707 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1708
- * rand = _rand.rand
- * randn = _rand.randn
- * random_integers = _rand.random_integers # <<<<<<<<<<<<<<
- * standard_normal = _rand.standard_normal
- * normal = _rand.normal
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1708 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1709
- * randn = _rand.randn
- * random_integers = _rand.random_integers
- * standard_normal = _rand.standard_normal # <<<<<<<<<<<<<<
- * normal = _rand.normal
- * beta = _rand.beta
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1709 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1710
- * random_integers = _rand.random_integers
- * standard_normal = _rand.standard_normal
- * normal = _rand.normal # <<<<<<<<<<<<<<
- * beta = _rand.beta
- * exponential = _rand.exponential
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1710 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1711
- * standard_normal = _rand.standard_normal
- * normal = _rand.normal
- * beta = _rand.beta # <<<<<<<<<<<<<<
- * exponential = _rand.exponential
- * standard_exponential = _rand.standard_exponential
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1711 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1712
- * normal = _rand.normal
- * beta = _rand.beta
- * exponential = _rand.exponential # <<<<<<<<<<<<<<
- * standard_exponential = _rand.standard_exponential
- * standard_gamma = _rand.standard_gamma
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1712 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1713
- * beta = _rand.beta
- * exponential = _rand.exponential
- * standard_exponential = _rand.standard_exponential # <<<<<<<<<<<<<<
- * standard_gamma = _rand.standard_gamma
- * gamma = _rand.gamma
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1713 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1714
- * exponential = _rand.exponential
- * standard_exponential = _rand.standard_exponential
- * standard_gamma = _rand.standard_gamma # <<<<<<<<<<<<<<
- * gamma = _rand.gamma
- * f = _rand.f
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1714 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1715
- * standard_exponential = _rand.standard_exponential
- * standard_gamma = _rand.standard_gamma
- * gamma = _rand.gamma # <<<<<<<<<<<<<<
- * f = _rand.f
- * noncentral_f = _rand.noncentral_f
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1715 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1716
- * standard_gamma = _rand.standard_gamma
- * gamma = _rand.gamma
- * f = _rand.f # <<<<<<<<<<<<<<
- * noncentral_f = _rand.noncentral_f
- * chisquare = _rand.chisquare
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1716 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1717
- * gamma = _rand.gamma
- * f = _rand.f
- * noncentral_f = _rand.noncentral_f # <<<<<<<<<<<<<<
- * chisquare = _rand.chisquare
- * noncentral_chisquare = _rand.noncentral_chisquare
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1717 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1718
- * f = _rand.f
- * noncentral_f = _rand.noncentral_f
- * chisquare = _rand.chisquare # <<<<<<<<<<<<<<
- * noncentral_chisquare = _rand.noncentral_chisquare
- * standard_cauchy = _rand.standard_cauchy
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1718 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1719
- * noncentral_f = _rand.noncentral_f
- * chisquare = _rand.chisquare
- * noncentral_chisquare = _rand.noncentral_chisquare # <<<<<<<<<<<<<<
- * standard_cauchy = _rand.standard_cauchy
- * standard_t = _rand.standard_t
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1719 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1720
- * chisquare = _rand.chisquare
- * noncentral_chisquare = _rand.noncentral_chisquare
- * standard_cauchy = _rand.standard_cauchy # <<<<<<<<<<<<<<
- * standard_t = _rand.standard_t
- * vonmises = _rand.vonmises
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1720 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1721
- * noncentral_chisquare = _rand.noncentral_chisquare
- * standard_cauchy = _rand.standard_cauchy
- * standard_t = _rand.standard_t # <<<<<<<<<<<<<<
- * vonmises = _rand.vonmises
- * pareto = _rand.pareto
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1721 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1722
- * standard_cauchy = _rand.standard_cauchy
- * standard_t = _rand.standard_t
- * vonmises = _rand.vonmises # <<<<<<<<<<<<<<
- * pareto = _rand.pareto
- * weibull = _rand.weibull
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1722 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1723
- * standard_t = _rand.standard_t
- * vonmises = _rand.vonmises
- * pareto = _rand.pareto # <<<<<<<<<<<<<<
- * weibull = _rand.weibull
- * power = _rand.power
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1723 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1724
- * vonmises = _rand.vonmises
- * pareto = _rand.pareto
- * weibull = _rand.weibull # <<<<<<<<<<<<<<
- * power = _rand.power
- * laplace = _rand.laplace
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1724 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1725
- * pareto = _rand.pareto
- * weibull = _rand.weibull
- * power = _rand.power # <<<<<<<<<<<<<<
- * laplace = _rand.laplace
- * gumbel = _rand.gumbel
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1725 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1726
- * weibull = _rand.weibull
- * power = _rand.power
- * laplace = _rand.laplace # <<<<<<<<<<<<<<
- * gumbel = _rand.gumbel
- * logistic = _rand.logistic
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1726 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1727
- * power = _rand.power
- * laplace = _rand.laplace
- * gumbel = _rand.gumbel # <<<<<<<<<<<<<<
- * logistic = _rand.logistic
- * lognormal = _rand.lognormal
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1727 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1728
- * laplace = _rand.laplace
- * gumbel = _rand.gumbel
- * logistic = _rand.logistic # <<<<<<<<<<<<<<
- * lognormal = _rand.lognormal
- * rayleigh = _rand.rayleigh
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1728 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1729
- * gumbel = _rand.gumbel
- * logistic = _rand.logistic
- * lognormal = _rand.lognormal # <<<<<<<<<<<<<<
- * rayleigh = _rand.rayleigh
- * wald = _rand.wald
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1729 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1730
- * logistic = _rand.logistic
- * lognormal = _rand.lognormal
- * rayleigh = _rand.rayleigh # <<<<<<<<<<<<<<
- * wald = _rand.wald
- * triangular = _rand.triangular
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1730 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1731
- * lognormal = _rand.lognormal
- * rayleigh = _rand.rayleigh
- * wald = _rand.wald # <<<<<<<<<<<<<<
- * triangular = _rand.triangular
- *
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1731 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1732
- * rayleigh = _rand.rayleigh
- * wald = _rand.wald
- * triangular = _rand.triangular # <<<<<<<<<<<<<<
- *
- * binomial = _rand.binomial
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1732 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1734
- * triangular = _rand.triangular
- *
- * binomial = _rand.binomial # <<<<<<<<<<<<<<
- * negative_binomial = _rand.negative_binomial
- * poisson = _rand.poisson
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1734 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1735
- *
- * binomial = _rand.binomial
- * negative_binomial = _rand.negative_binomial # <<<<<<<<<<<<<<
- * poisson = _rand.poisson
- * zipf = _rand.zipf
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1735 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1736
- * binomial = _rand.binomial
- * negative_binomial = _rand.negative_binomial
- * poisson = _rand.poisson # <<<<<<<<<<<<<<
- * zipf = _rand.zipf
- * geometric = _rand.geometric
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1736 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1737
- * negative_binomial = _rand.negative_binomial
- * poisson = _rand.poisson
- * zipf = _rand.zipf # <<<<<<<<<<<<<<
- * geometric = _rand.geometric
- * hypergeometric = _rand.hypergeometric
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1737 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1738
- * poisson = _rand.poisson
- * zipf = _rand.zipf
- * geometric = _rand.geometric # <<<<<<<<<<<<<<
- * hypergeometric = _rand.hypergeometric
- * logseries = _rand.logseries
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1738 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1739
- * zipf = _rand.zipf
- * geometric = _rand.geometric
- * hypergeometric = _rand.hypergeometric # <<<<<<<<<<<<<<
- * logseries = _rand.logseries
- *
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1739 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1740
- * geometric = _rand.geometric
- * hypergeometric = _rand.hypergeometric
- * logseries = _rand.logseries # <<<<<<<<<<<<<<
- *
- * multivariate_normal = _rand.multivariate_normal
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1740 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1742
- * logseries = _rand.logseries
- *
- * multivariate_normal = _rand.multivariate_normal # <<<<<<<<<<<<<<
- * multinomial = _rand.multinomial
- * dirichlet = _rand.dirichlet
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1742 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1743
- *
- * multivariate_normal = _rand.multivariate_normal
- * multinomial = _rand.multinomial # <<<<<<<<<<<<<<
- * dirichlet = _rand.dirichlet
- *
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1743 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1744
- * multivariate_normal = _rand.multivariate_normal
- * multinomial = _rand.multinomial
- * dirichlet = _rand.dirichlet # <<<<<<<<<<<<<<
- *
- * shuffle = _rand.shuffle
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1744 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1746
- * dirichlet = _rand.dirichlet
- *
- * shuffle = _rand.shuffle # <<<<<<<<<<<<<<
- * permutation = _rand.permutation
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1746 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
- /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1747
- *
- * shuffle = _rand.shuffle
- * permutation = _rand.permutation # <<<<<<<<<<<<<<
- */
- __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (unlikely(!__pyx_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (unlikely(!__pyx_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1747 */
+ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;}
+ __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;}
Py_DECREF(__pyx_17); __pyx_17 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;}
Py_DECREF(__pyx_18); __pyx_18 = 0;
return;
__pyx_L1:;
@@ -16094,60 +9919,101 @@ 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)
-{
- 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);
-}
-
-static INLINE int __Pyx_SplitStarArg(
+static int __Pyx_GetStarArgs(
PyObject **args,
+ PyObject **kwds,
+ char *kwd_list[],
Py_ssize_t nargs,
- PyObject **args2)
+ PyObject **args2,
+ PyObject **kwds2,
+ char rqd_kwds[])
{
- PyObject *args1 = 0;
- args1 = PyTuple_GetSlice(*args, 0, nargs);
- if (!args1) {
+ PyObject *x = 0, *args1 = 0, *kwds1 = 0;
+ int i;
+ char **p;
+
+ if (args2)
*args2 = 0;
- return -1;
+ if (kwds2)
+ *kwds2 = 0;
+
+ if (args2) {
+ args1 = PyTuple_GetSlice(*args, 0, nargs);
+ if (!args1)
+ goto bad;
+ *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args));
+ if (!*args2)
+ goto bad;
}
- *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args));
- if (!*args2) {
- Py_DECREF(args1);
- return -1;
+ else if (PyTuple_GET_SIZE(*args) > nargs) {
+ int m = nargs;
+ int n = PyTuple_GET_SIZE(*args);
+ PyErr_Format(PyExc_TypeError,
+ "function takes at most %d positional arguments (%d given)",
+ m, n);
+ goto bad;
+ }
+ else {
+ args1 = *args;
+ Py_INCREF(args1);
+ }
+
+ if (rqd_kwds && !*kwds)
+ for (i = 0, p = kwd_list; *p; i++, p++)
+ if (rqd_kwds[i])
+ goto missing_kwarg;
+
+ if (kwds2) {
+ if (*kwds) {
+ kwds1 = PyDict_New();
+ if (!kwds1)
+ goto bad;
+ *kwds2 = PyDict_Copy(*kwds);
+ if (!*kwds2)
+ goto bad;
+ for (i = 0, p = kwd_list; *p; i++, p++) {
+ x = PyDict_GetItemString(*kwds, *p);
+ if (x) {
+ if (PyDict_SetItemString(kwds1, *p, x) < 0)
+ goto bad;
+ if (PyDict_DelItemString(*kwds2, *p) < 0)
+ goto bad;
+ }
+ else if (rqd_kwds && rqd_kwds[i])
+ goto missing_kwarg;
+ }
+ }
+ else {
+ *kwds2 = PyDict_New();
+ if (!*kwds2)
+ goto bad;
+ }
+ }
+ else {
+ kwds1 = *kwds;
+ Py_XINCREF(kwds1);
+ if (rqd_kwds && *kwds)
+ for (i = 0, p = kwd_list; *p; i++, p++)
+ if (rqd_kwds[i] && !PyDict_GetItemString(*kwds, *p))
+ goto missing_kwarg;
}
+
*args = args1;
+ *kwds = kwds1;
return 0;
-}
-
-static int __Pyx_CheckKeywordStrings(
- PyObject *kwdict,
- const char* function_name,
- int kw_allowed)
-{
- PyObject* key = 0;
- Py_ssize_t pos = 0;
- while (PyDict_Next(kwdict, &pos, &key, 0)) {
- if (unlikely(!PyString_Check(key))) {
- PyErr_Format(PyExc_TypeError,
- "%s() keywords must be strings", function_name);
- return 0;
- }
+missing_kwarg:
+ PyErr_Format(PyExc_TypeError,
+ "required keyword argument '%s' is missing", *p);
+bad:
+ Py_XDECREF(args1);
+ Py_XDECREF(kwds1);
+ if (args2) {
+ Py_XDECREF(*args2);
}
- if (unlikely(!kw_allowed) && unlikely(key)) {
- PyErr_Format(PyExc_TypeError,
- "'%s' is an invalid keyword argument for this function",
- PyString_AsString(key));
- return 0;
+ if (kwds2) {
+ Py_XDECREF(*kwds2);
}
- return 1;
+ return -1;
}
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
@@ -16231,7 +10097,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
Py_INCREF(type);
}
else {
- type = 0;
PyErr_SetString(PyExc_TypeError,
"raise: exception must be an old-style class or instance");
goto raise_error;
@@ -16255,17 +10120,30 @@ raise_error:
return;
}
-static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
+static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) {
+ PyTypeObject *t = o->ob_type;
+ PyObject *r;
+ if (t->tp_as_sequence && t->tp_as_sequence->sq_item)
+ r = PySequence_GetItem(o, i);
+ else {
+ PyObject *j = PyInt_FromLong(i);
+ if (!j)
+ return 0;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ }
+ return r;
+}
+
+static void __Pyx_UnpackError(void) {
+ PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
+}
+
+static PyObject *__Pyx_UnpackItem(PyObject *iter) {
PyObject *item;
if (!(item = PyIter_Next(iter))) {
- if (!PyErr_Occurred()) {
- PyErr_Format(PyExc_ValueError,
- #if PY_VERSION_HEX < 0x02050000
- "need more than %d values to unpack", (int)index);
- #else
- "need more than %zd values to unpack", index);
- #endif
- }
+ if (!PyErr_Occurred())
+ __Pyx_UnpackError();
}
return item;
}
@@ -16274,7 +10152,7 @@ static int __Pyx_EndUnpack(PyObject *iter) {
PyObject *item;
if ((item = PyIter_Next(iter))) {
Py_DECREF(item);
- PyErr_SetString(PyExc_ValueError, "too many values to unpack");
+ __Pyx_UnpackError();
return -1;
}
else if (!PyErr_Occurred())
@@ -16284,7 +10162,6 @@ 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);
PyErr_NormalizeException(type, value, tb);
@@ -16293,17 +10170,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
Py_INCREF(*type);
Py_INCREF(*value);
Py_INCREF(*tb);
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
+ Py_XDECREF(tstate->exc_type);
+ Py_XDECREF(tstate->exc_value);
+ Py_XDECREF(tstate->exc_traceback);
tstate->exc_type = *type;
tstate->exc_value = *value;
tstate->exc_traceback = *tb;
- /* Make sure tstate is in a consistent state when we XDECREF
- these objects (XDECREF may run arbitrary code). */
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
return 0;
bad:
Py_XDECREF(*type);
@@ -16324,6 +10196,21 @@ static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
+static int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v) {
+ PyTypeObject *t = o->ob_type;
+ int r;
+ if (t->tp_as_sequence && t->tp_as_sequence->sq_item)
+ r = PySequence_SetItem(o, i, v);
+ else {
+ PyObject *j = PyInt_FromLong(i);
+ if (!j)
+ return -1;
+ r = PyObject_SetItem(o, j, v);
+ Py_DECREF(j);
+ }
+ return r;
+}
+
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
while (t->p) {
*t->p = PyString_InternFromString(t->s);
@@ -16336,11 +10223,7 @@ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
if (!*t->p)
return -1;
++t;
@@ -16350,17 +10233,12 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
- long size)
+static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
+ long size)
{
PyObject *py_module = 0;
PyObject *result = 0;
- PyObject *py_name = 0;
- py_name = PyString_FromString(module_name);
- if (!py_name)
- goto bad;
-
py_module = __Pyx_ImportModule(module_name);
if (!py_module)
goto bad;
@@ -16381,7 +10259,6 @@ static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
}
return (PyTypeObject *)result;
bad:
- Py_XDECREF(py_name);
Py_XDECREF(result);
return 0;
}
@@ -16391,14 +10268,11 @@ bad:
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(char *name) {
PyObject *py_name = 0;
- PyObject *py_module = 0;
py_name = PyString_FromString(name);
if (!py_name)
goto bad;
- py_module = PyImport_Import(py_name);
- Py_DECREF(py_name);
- return py_module;
+ return PyImport_Import(py_name);
bad:
Py_XDECREF(py_name);
return 0;
@@ -16413,21 +10287,19 @@ static void __Pyx_AddTraceback(char *funcname) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
+ PyObject *empty_tuple = 0;
PyObject *empty_string = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
py_srcfile = PyString_FromString(__pyx_filename);
if (!py_srcfile) goto bad;
- if (__pyx_clineno) {
- py_funcname = PyString_FromFormat( "%s (%s:%u)", funcname, __pyx_cfilenm, __pyx_clineno);
- }
- else {
- py_funcname = PyString_FromString(funcname);
- }
+ py_funcname = PyString_FromString(funcname);
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(__pyx_m);
if (!py_globals) goto bad;
+ empty_tuple = PyTuple_New(0);
+ if (!empty_tuple) goto bad;
empty_string = PyString_FromString("");
if (!empty_string) goto bad;
py_code = PyCode_New(
@@ -16436,11 +10308,11 @@ static void __Pyx_AddTraceback(char *funcname) {
0, /*int stacksize,*/
0, /*int flags,*/
empty_string, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
+ empty_tuple, /*PyObject *consts,*/
+ empty_tuple, /*PyObject *names,*/
+ empty_tuple, /*PyObject *varnames,*/
+ empty_tuple, /*PyObject *freevars,*/
+ empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
__pyx_lineno, /*int firstlineno,*/
@@ -16459,227 +10331,8 @@ static void __Pyx_AddTraceback(char *funcname) {
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
+ Py_XDECREF(empty_tuple);
Py_XDECREF(empty_string);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
-
-/* Type Conversion Functions */
-
-static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject* x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-
-static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- if (x == Py_True) return 1;
- else if (x == Py_False) return 0;
- else return PyObject_IsTrue(x);
-}
-
-static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
- if (PyInt_CheckExact(x)) {
- return PyInt_AS_LONG(x);
- }
- else 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;
- val = __pyx_PyInt_AsLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
- if (PyInt_CheckExact(x)) {
- long val = PyInt_AS_LONG(x);
- if (unlikely(val < 0)) {
- PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type.");
- return (unsigned PY_LONG_LONG)-1;
- }
- return val;
- }
- else 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;
- val = __pyx_PyInt_AsUnsignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-
-static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) {
- if (sizeof(unsigned char) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- unsigned char val = (unsigned char)long_val;
- if (unlikely((val != long_val) || (long_val < 0))) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char");
- return (unsigned char)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) {
- if (sizeof(unsigned short) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- unsigned short val = (unsigned short)long_val;
- if (unlikely((val != long_val) || (long_val < 0))) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short");
- return (unsigned short)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE char __pyx_PyInt_char(PyObject* x) {
- if (sizeof(char) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- char val = (char)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to char");
- return (char)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE short __pyx_PyInt_short(PyObject* x) {
- if (sizeof(short) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- short val = (short)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to short");
- return (short)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE int __pyx_PyInt_int(PyObject* x) {
- if (sizeof(int) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- int val = (int)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to int");
- return (int)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE long __pyx_PyInt_long(PyObject* x) {
- if (sizeof(long) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- long val = (long)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to long");
- return (long)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) {
- if (sizeof(signed char) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed char val = (signed char)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char");
- return (signed char)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) {
- if (sizeof(signed short) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed short val = (signed short)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short");
- return (signed short)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) {
- if (sizeof(signed int) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed int val = (signed int)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int");
- return (signed int)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) {
- if (sizeof(signed long) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed long val = (signed long)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long");
- return (signed long)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE long double __pyx_PyInt_long_double(PyObject* x) {
- if (sizeof(long double) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- long double val = (long double)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double");
- return (long double)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}