/* Generated by Pyrex 0.9.6.4 on Sat Mar 22 02:09:21 2008 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)	PyInt_AsLong(o)
#endif
#ifndef WIN32
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#include "string.h"
#include "math.h"
#include "numpy/arrayobject.h"
#include "randomkit.h"
#include "distributions.h"
#include "initarray.h"


typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/

static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;

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*/

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 *); /*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_InternStrings(__Pyx_InternTabEntry *t); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/

static PyObject *__Pyx_ImportModule(char *name); /*proto*/

static void __Pyx_AddTraceback(char *funcname); /*proto*/

/* Declarations from mtrand */

typedef double (*__pyx_t_6mtrand_rk_cont0)(rk_state *);

typedef double (*__pyx_t_6mtrand_rk_cont1)(rk_state *,double);

typedef double (*__pyx_t_6mtrand_rk_cont2)(rk_state *,double,double);

typedef double (*__pyx_t_6mtrand_rk_cont3)(rk_state *,double,double,double);

typedef long (*__pyx_t_6mtrand_rk_disc0)(rk_state *);

typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *,long,double);

typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *,long,long,long);

typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *,double);

struct __pyx_obj_6mtrand_RandomState {
  PyObject_HEAD
  rk_state *internal_state;
};


static PyTypeObject *__pyx_ptype_6mtrand_dtype = 0;
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_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_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_random_sample;
static PyObject *__pyx_n_randint;
static PyObject *__pyx_n_bytes;
static PyObject *__pyx_n_uniform;
static PyObject *__pyx_n_rand;
static PyObject *__pyx_n_randn;
static PyObject *__pyx_n_random_integers;
static PyObject *__pyx_n_standard_normal;
static PyObject *__pyx_n_normal;
static PyObject *__pyx_n_beta;
static PyObject *__pyx_n_exponential;
static PyObject *__pyx_n_standard_exponential;
static PyObject *__pyx_n_standard_gamma;
static PyObject *__pyx_n_gamma;
static PyObject *__pyx_n_f;
static PyObject *__pyx_n_noncentral_f;
static PyObject *__pyx_n_chisquare;
static PyObject *__pyx_n_noncentral_chisquare;
static PyObject *__pyx_n_standard_cauchy;
static PyObject *__pyx_n_standard_t;
static PyObject *__pyx_n_vonmises;
static PyObject *__pyx_n_pareto;
static PyObject *__pyx_n_weibull;
static PyObject *__pyx_n_power;
static PyObject *__pyx_n_laplace;
static PyObject *__pyx_n_gumbel;
static PyObject *__pyx_n_logistic;
static PyObject *__pyx_n_lognormal;
static PyObject *__pyx_n_rayleigh;
static PyObject *__pyx_n_wald;
static PyObject *__pyx_n_triangular;
static PyObject *__pyx_n_binomial;
static PyObject *__pyx_n_negative_binomial;
static PyObject *__pyx_n_poisson;
static PyObject *__pyx_n_zipf;
static PyObject *__pyx_n_geometric;
static PyObject *__pyx_n_hypergeometric;
static PyObject *__pyx_n_logseries;
static PyObject *__pyx_n_multivariate_normal;
static PyObject *__pyx_n_multinomial;
static PyObject *__pyx_n_dirichlet;
static PyObject *__pyx_n_shuffle;
static PyObject *__pyx_n_permutation;

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) {
  double *__pyx_v_array_data;
  PyArrayObject *arrayObject;
  long __pyx_v_length;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  Py_INCREF(__pyx_v_size);
  arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":129 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":132 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; 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_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":133 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":134 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":135 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":137 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.cont0_array");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont1 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a) {
  double *__pyx_v_array_data;
  PyArrayObject *arrayObject;
  long __pyx_v_length;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":146 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":149 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; 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_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":150 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":151 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":152 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":154 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.cont1_array_sc");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_n_ValueError;

static PyObject *__pyx_k61p;

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) {
  double *__pyx_v_array_data;
  double *__pyx_v_oa_data;
  PyArrayObject *arrayObject;
  npy_intp __pyx_v_length;
  npy_intp __pyx_v_i;
  PyArrayIterObject *__pyx_v_itera;
  PyArrayMultiIterObject *__pyx_v_multi;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  npy_intp __pyx_5;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":165 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":166 */
    __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":167 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":168 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":169 */
    __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2)));
    Py_DECREF(((PyObject *)__pyx_v_itera));
    __pyx_v_itera = ((PyArrayIterObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":170 */
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":171 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":172 */
      PyArray_ITER_NEXT(__pyx_v_itera);
    }
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":174 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; 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_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":175 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":176 */
    __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3);
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":178 */
    __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
      __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
      Py_INCREF(__pyx_k61p);
      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k61p);
      __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __Pyx_Raise(__pyx_3, 0, 0);
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":180 */
    __pyx_5 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":181 */
      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":182 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":183 */
      PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
    }
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":184 */
  Py_INCREF(((PyObject *)arrayObject));
  __pyx_r = ((PyObject *)arrayObject);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.cont1_array");
  __pyx_r = 0;
  __pyx_L0:;
  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;
}

static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont2 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {
  double *__pyx_v_array_data;
  PyArrayObject *arrayObject;
  long __pyx_v_length;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":193 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":196 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; 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_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":197 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":198 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":199 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":201 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.cont2_array_sc");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k62p;

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) {
  double *__pyx_v_array_data;
  double *__pyx_v_oa_data;
  double *__pyx_v_ob_data;
  PyArrayObject *arrayObject;
  npy_intp __pyx_v_i;
  PyArrayMultiIterObject *__pyx_v_multi;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":214 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":215 */
    __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":216 */
    __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":217 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":218 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":219 */
      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":220 */
      __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":221 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":222 */
      PyArray_MultiIter_NEXT(__pyx_v_multi);
    }
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":224 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
    __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; 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_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_5);
    Py_DECREF(__pyx_5); __pyx_5 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":225 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":226 */
    __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":227 */
    __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
      __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
      Py_INCREF(__pyx_k62p);
      PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k62p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      __Pyx_Raise(__pyx_4, 0, 0);
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":229 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":230 */
      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":231 */
      __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":232 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":233 */
      PyArray_MultiIter_NEXTi(__pyx_v_multi,1);

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":234 */
      PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
    }
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":235 */
  Py_INCREF(((PyObject *)arrayObject));
  __pyx_r = ((PyObject *)arrayObject);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.cont2_array");
  __pyx_r = 0;
  __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;
}

static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_cont3 __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {
  double *__pyx_v_array_data;
  PyArrayObject *arrayObject;
  long __pyx_v_length;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":245 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __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 = 246; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":248 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; 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_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":249 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":250 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":251 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":253 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.cont3_array_sc");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k63p;

static char __pyx_k63[] = "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) {
  double *__pyx_v_array_data;
  double *__pyx_v_oa_data;
  double *__pyx_v_ob_data;
  double *__pyx_v_oc_data;
  PyArrayObject *arrayObject;
  npy_intp __pyx_v_i;
  PyArrayMultiIterObject *__pyx_v_multi;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  npy_intp __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":267 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":268 */
    __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 = 268; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":269 */
    __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":270 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":271 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":272 */
      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":273 */
      __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":274 */
      __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":275 */
      (__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]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":276 */
      PyArray_MultiIter_NEXT(__pyx_v_multi);
    }
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":278 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; 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_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_5);
    Py_DECREF(__pyx_5); __pyx_5 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":279 */
    __pyx_v_array_data = ((double *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":280 */
    __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 = 280; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":282 */
    __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
      __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
      Py_INCREF(__pyx_k63p);
      PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k63p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      __Pyx_Raise(__pyx_4, 0, 0);
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":284 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":285 */
      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":286 */
      __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":287 */
      __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,3));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":288 */
      (__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]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":289 */
      PyArray_MultiIter_NEXT(__pyx_v_multi);
    }
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":290 */
  Py_INCREF(((PyObject *)arrayObject));
  __pyx_r = ((PyObject *)arrayObject);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.cont3_array");
  __pyx_r = 0;
  __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;
}

static PyObject *__pyx_n_int;

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;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":298 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":301 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; 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);
    __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":302 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":303 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":304 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":306 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.disc0_array");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

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;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":314 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __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 = 315; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":317 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; 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);
    __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":318 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":319 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":320 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":322 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.discnp_array_sc");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k64p;

static char __pyx_k64[] = "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) {
  long *__pyx_v_array_data;
  PyArrayObject *arrayObject;
  npy_intp __pyx_v_i;
  double *__pyx_v_op_data;
  long *__pyx_v_on_data;
  PyArrayMultiIterObject *__pyx_v_multi;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  npy_intp __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":333 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":334 */
    __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":335 */
    __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":336 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":337 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":338 */
      __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":339 */
      __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":340 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":341 */
      PyArray_MultiIter_NEXT(__pyx_v_multi);
    }
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":343 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}
    Py_INCREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
    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 = 343; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":344 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":345 */
    __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 = 345; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":346 */
    __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
    if (__pyx_1) {
      __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
      __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
      Py_INCREF(__pyx_k64p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k64p);
      __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      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 = 347; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":348 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":349 */
      __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":350 */
      __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":351 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":352 */
      PyArray_MultiIter_NEXTi(__pyx_v_multi,1);

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":353 */
      PyArray_MultiIter_NEXTi(__pyx_v_multi,2);
    }
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":355 */
  Py_INCREF(((PyObject *)arrayObject));
  __pyx_r = ((PyObject *)arrayObject);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.discnp_array");
  __pyx_r = 0;
  __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;
}

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;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":364 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __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 = 365; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":367 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; 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);
    __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":368 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":369 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":370 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":372 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.discnmN_array_sc");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k65p;

static char __pyx_k65[] = "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) {
  long *__pyx_v_array_data;
  long *__pyx_v_on_data;
  long *__pyx_v_om_data;
  long *__pyx_v_oN_data;
  PyArrayObject *arrayObject;
  npy_intp __pyx_v_i;
  PyArrayMultiIterObject *__pyx_v_multi;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  npy_intp __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":385 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":386 */
    __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 = 386; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":387 */
    __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":388 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":389 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":390 */
      __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":391 */
      __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":392 */
      __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":393 */
      (__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]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":394 */
      PyArray_MultiIter_NEXT(__pyx_v_multi);
    }
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":396 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
    Py_INCREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
    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 = 396; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":397 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":398 */
    __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 = 398; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":400 */
    __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
    if (__pyx_1) {
      __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;}
      __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;}
      Py_INCREF(__pyx_k65p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k65p);
      __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      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 = 401; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":402 */
    __pyx_3 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":403 */
      __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":404 */
      __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":405 */
      __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,3));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":406 */
      (__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]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":407 */
      PyArray_MultiIter_NEXT(__pyx_v_multi);
    }
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":409 */
  Py_INCREF(((PyObject *)arrayObject));
  __pyx_r = ((PyObject *)arrayObject);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.discnmN_array");
  __pyx_r = 0;
  __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;
}

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;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":417 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":420 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; 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);
    __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":421 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":422 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":423 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":425 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.discd_array_sc");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k66p;

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) {
  long *__pyx_v_array_data;
  double *__pyx_v_oa_data;
  PyArrayObject *arrayObject;
  npy_intp __pyx_v_length;
  npy_intp __pyx_v_i;
  PyArrayMultiIterObject *__pyx_v_multi;
  PyArrayIterObject *__pyx_v_itera;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  npy_intp __pyx_5;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":436 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":437 */
    __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":438 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":439 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":440 */
    __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2)));
    Py_DECREF(((PyObject *)__pyx_v_itera));
    __pyx_v_itera = ((PyArrayIterObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":441 */
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":442 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":443 */
      PyArray_ITER_NEXT(__pyx_v_itera);
    }
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":445 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; 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);
    __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":446 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":447 */
    __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3)));
    Py_DECREF(((PyObject *)__pyx_v_multi));
    __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3);
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":448 */
    __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
    if (__pyx_1) {
      __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
      __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
      Py_INCREF(__pyx_k66p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k66p);
      __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      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 = 449; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":450 */
    __pyx_5 = __pyx_v_multi->size;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":451 */
      __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":452 */
      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":453 */
      PyArray_MultiIter_NEXTi(__pyx_v_multi,1);
    }
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":454 */
  Py_INCREF(((PyObject *)arrayObject));
  __pyx_r = ((PyObject *)arrayObject);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.discd_array");
  __pyx_r = 0;
  __pyx_L0:;
  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;
}

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;
  double __pyx_v_sum;
  long __pyx_v_i;
  double __pyx_r;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":459 */
  __pyx_v_sum = (__pyx_v_darr[0]);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":460 */
  __pyx_v_c = 0.0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":461 */
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":462 */
    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":463 */
    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":464 */
    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":465 */
    __pyx_v_sum = __pyx_v_t;
  }

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":466 */
  __pyx_r = __pyx_v_sum;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

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 = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":489 */
  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state))));

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":491 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;}
  Py_INCREF(__pyx_v_seed);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("mtrand.RandomState.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_seed);
  return __pyx_r;
}

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;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL);
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":495 */
    PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":496 */
    ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = NULL;
    goto __pyx_L2;
  }
  __pyx_L2:;

  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n_type;
static PyObject *__pyx_n_integer;

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_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;
  PyObject *__pyx_v_iseed;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  unsigned long __pyx_5;
  static char *__pyx_argnames[] = {"seed",0};
  __pyx_v_seed = __pyx_k3;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed)) return 0;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":510 */
  __pyx_1 = __pyx_v_seed == Py_None;
  if (__pyx_1) {
    __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
    goto __pyx_L2;
  }
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;}
  Py_INCREF(__pyx_v_seed);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;}
  __pyx_1 = __pyx_4 == __pyx_2;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}
    rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
    goto __pyx_L2;
  }
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_integer); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_4); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":515 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_INCREF(__pyx_v_seed);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_v_iseed);
    __pyx_v_iseed = __pyx_4;
    __pyx_4 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":516 */
    __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;}
    rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":518 */
    __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; 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;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":519 */
    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long *)arrayObject_obj->data),(arrayObject_obj->dimensions[0]));
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.RandomState.seed");
  __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;
}

static PyObject *__pyx_n_uint;
static PyObject *__pyx_n_asarray;
static PyObject *__pyx_n_uint32;
static PyObject *__pyx_n_MT19937;


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)\n        ";
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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":528 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; 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 = 528; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1)));
  Py_DECREF(((PyObject *)arrayObject_state));
  arrayObject_state = ((PyArrayObject *)__pyx_1);
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":529 */
  memcpy(((void *)arrayObject_state->data),((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),(624 * (sizeof(long))));

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":530 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; 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 = 530; goto __pyx_L1;}
  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; 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 = 530; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":531 */
  __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 = 531; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
  Py_INCREF(__pyx_n_MT19937);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);
  Py_INCREF(((PyObject *)arrayObject_state));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_1);
  __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.RandomState.get_state");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject_state);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_TypeError;

static PyObject *__pyx_k69p;
static PyObject *__pyx_k70p;

static char __pyx_k69[] = "algorithm must be 'MT19937'";
static char __pyx_k70[] = "state must be 624 longs";

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)\n\n        set_state(state)\n        ";
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;
  PyObject *__pyx_v_key;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"state",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0;
  Py_INCREF(__pyx_v_self);
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":542 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_algorithm_name);
  __pyx_v_algorithm_name = __pyx_2;
  __pyx_2 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":543 */
  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}
  __pyx_3 = __pyx_3 != 0;
  if (__pyx_3) {
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
    Py_INCREF(__pyx_k69p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k69p);
    __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    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 = 544; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":545 */
  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
  __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
  Py_DECREF(__pyx_v_key);
  __pyx_v_key = __pyx_4;
  __pyx_4 = 0;
  __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
  __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_v_pos = __pyx_3;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":546 */
  /*try:*/ {
    __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L3;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
    Py_DECREF(((PyObject *)arrayObject_obj));
    arrayObject_obj = ((PyArrayObject *)__pyx_4);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  goto __pyx_L4;
  __pyx_L3:;
  Py_XDECREF(__pyx_1); __pyx_1 = 0;
  Py_XDECREF(__pyx_2); __pyx_2 = 0;
  Py_XDECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":548 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;}
  __pyx_3 = PyErr_ExceptionMatches(__pyx_1);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_3) {
    __Pyx_AddTraceback("mtrand.set_state");
    if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;}
    __pyx_5 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;}
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5)));
    Py_DECREF(((PyObject *)arrayObject_obj));
    arrayObject_obj = ((PyArrayObject *)__pyx_5);
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    goto __pyx_L4;
  }
  goto __pyx_L1;
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":551 */
  __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);
  if (__pyx_3) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
    Py_INCREF(__pyx_k70p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k70p);
    __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    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 = 552; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":553 */
  memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),((void *)arrayObject_obj->data),(624 * (sizeof(long))));

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":554 */
  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;

  __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_5);
  __Pyx_AddTraceback("mtrand.RandomState.set_state");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(arrayObject_obj);
  Py_DECREF(__pyx_v_algorithm_name);
  Py_DECREF(__pyx_v_key);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_state);
  return __pyx_r;
}

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;
  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 = 558; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("mtrand.RandomState.__getstate__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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;
  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 = 561; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
  Py_INCREF(__pyx_v_state);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("mtrand.RandomState.__setstate__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_state);
  return __pyx_r;
}

static PyObject *__pyx_n_random;
static PyObject *__pyx_n___RandomState_ctor;

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;
  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 = 564; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; 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 = 564; 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_2 = 0;
  __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.RandomState.__reduce__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

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_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 = __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 = 572; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("mtrand.RandomState.random_sample");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

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_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 = __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 = 579; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("mtrand.RandomState.tomaxint");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k71p;

static char __pyx_k71[] = "low >= high";

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_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;
  long __pyx_v_lo;
  long __pyx_v_hi;
  long __pyx_v_diff;
  long *__pyx_v_array_data;
  PyArrayObject *arrayObject;
  long __pyx_v_length;
  long __pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  long __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"low","high","size",0};
  __pyx_v_high = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":594 */
  __pyx_1 = __pyx_v_high == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":595 */
    __pyx_v_lo = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":596 */
    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}
    __pyx_v_hi = __pyx_2;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":598 */
    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; goto __pyx_L1;}
    __pyx_v_lo = __pyx_2;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":599 */
    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;}
    __pyx_v_hi = __pyx_2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":601 */
  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":602 */
  __pyx_1 = (__pyx_v_diff < 0);
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;}
    Py_INCREF(__pyx_k71p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k71p);
    __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 603; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":605 */
  __pyx_1 = __pyx_v_size == Py_None;
  if (__pyx_1) {
    __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 = 606; goto __pyx_L1;}
    __pyx_r = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":608 */
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;}
    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;}
    Py_INCREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3)));
    Py_DECREF(((PyObject *)arrayObject));
    arrayObject = ((PyArrayObject *)__pyx_3);
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":609 */
    __pyx_v_length = PyArray_SIZE(arrayObject);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":610 */
    __pyx_v_array_data = ((long *)arrayObject->data);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":611 */
    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)));
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":613 */
    Py_INCREF(((PyObject *)arrayObject));
    __pyx_r = ((PyObject *)arrayObject);
    goto __pyx_L0;
  }
  __pyx_L4:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.randint");
  __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;
}

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_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;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":621 */
  __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; goto __pyx_L1;}
  Py_DECREF(__pyx_v_bytestring);
  __pyx_v_bytestring = __pyx_1;
  __pyx_1 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":622 */
  __pyx_v_bytes = PyString_AS_STRING(__pyx_v_bytestring);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":623 */
  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":624 */
  Py_INCREF(__pyx_v_bytestring);
  __pyx_r = __pyx_v_bytestring;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("mtrand.RandomState.bytes");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_bytestring);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_subtract;

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_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;
  PyArrayObject *__pyx_v_olow;
  PyArrayObject *__pyx_v_ohigh;
  PyArrayObject *__pyx_v_odiff;
  double __pyx_v_flow;
  double __pyx_v_fhigh;
  PyObject *__pyx_v_temp;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"low","high","size",0};
  __pyx_v_low = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":635 */
  __pyx_v_flow = PyFloat_AsDouble(__pyx_v_low);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":636 */
  __pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":637 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {
    __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 = 638; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":639 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":640 */
  __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":641 */
  __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":642 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; 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_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":643 */
  Py_INCREF(__pyx_v_temp);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":645 */
  __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":646 */
  __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 = 646; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.RandomState.uniform");
  __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;
}

static PyObject *__pyx_n_size;


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_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;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  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_v_self);
  __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}
  __pyx_2 = (__pyx_1 == 0);
  if (__pyx_2) {
    __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_r = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {
    __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
    __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_r = __pyx_6;
    __pyx_6 = 0;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("mtrand.RandomState.rand");
  __pyx_r = 0;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

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_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;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 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_v_self);
  __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;}
  __pyx_2 = (__pyx_1 == 0);
  if (__pyx_2) {
    __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_r = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {
    __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}
    Py_INCREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_args);
    __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; 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_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.randn");
  __pyx_r = 0;
  __pyx_L0:;
  Py_XDECREF(__pyx_v_args);
  Py_DECREF(__pyx_v_self);
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return __pyx_r;
}

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_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;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"low","high","size",0};
  __pyx_v_high = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":686 */
  __pyx_1 = __pyx_v_high == Py_None;
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":687 */
    Py_INCREF(__pyx_v_low);
    Py_DECREF(__pyx_v_high);
    __pyx_v_high = __pyx_v_low;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":688 */
    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; goto __pyx_L1;}
    Py_DECREF(__pyx_v_low);
    __pyx_v_low = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":689 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}
  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; 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 = 689; goto __pyx_L1;}
  Py_INCREF(__pyx_v_low);
  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_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 = 689; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 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);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.RandomState.random_integers");
  __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;
}

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_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 = __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 = 697; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("mtrand.RandomState.standard_normal");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_n_any;
static PyObject *__pyx_n_less_equal;

static PyObject *__pyx_k73p;
static PyObject *__pyx_k74p;

static char __pyx_k73[] = "scale <= 0";
static char __pyx_k74[] = "scale <= 0";

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_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;
  PyArrayObject *__pyx_v_oloc;
  PyArrayObject *__pyx_v_oscale;
  double __pyx_v_floc;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"loc","scale","size",0};
  __pyx_v_loc = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":707 */
  __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":708 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":709 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":710 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;}
      Py_INCREF(__pyx_k73p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 711; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":712 */
    __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 = 712; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":714 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":716 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":717 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_oscale));
  __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":718 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}
    Py_INCREF(__pyx_k74p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 719; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":720 */
  __pyx_5 = __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_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.normal");
  __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;
}

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_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;
  PyArrayObject *__pyx_v_oa;
  PyArrayObject *__pyx_v_ob;
  double __pyx_v_fa;
  double __pyx_v_fb;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"a","b","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":730 */
  __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":731 */
  __pyx_v_fb = PyFloat_AsDouble(__pyx_v_b);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":732 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":733 */
    __pyx_1 = (__pyx_v_fa <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;}
      Py_INCREF(__pyx_k75p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 734; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":735 */
    __pyx_1 = (__pyx_v_fb <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}
      Py_INCREF(__pyx_k76p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 736; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":737 */
    __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 = 737; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":739 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":741 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":742 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_ob));
  __pyx_v_ob = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":743 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;}
    Py_INCREF(__pyx_k77p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 744; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":745 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_ob));
  PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_ob));
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 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 = 745; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}
    Py_INCREF(__pyx_k78p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k78p);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_2, 0, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":747 */
  __pyx_3 = __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_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.beta");
  __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;
}

static PyObject *__pyx_k79p;
static PyObject *__pyx_k80p;

static char __pyx_k79[] = "scale <= 0";
static char __pyx_k80[] = "scale <= 0";

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_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;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"scale","size",0};
  __pyx_v_scale = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":757 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":758 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":759 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;}
      Py_INCREF(__pyx_k79p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 760; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":761 */
    __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 = 761; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":763 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":765 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":766 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; 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 = 766; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; 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_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; 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 = 766; 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 = 766; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;}
    Py_INCREF(__pyx_k80p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k80p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 767; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":768 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.exponential");
  __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;
}

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_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 = __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 = 775; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("mtrand.RandomState.standard_exponential");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k81p;
static PyObject *__pyx_k82p;

static char __pyx_k81[] = "shape <= 0";
static char __pyx_k82[] = "shape <= 0";

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_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;
  double __pyx_v_fshape;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"shape","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":785 */
  __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":786 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":787 */
    __pyx_1 = (__pyx_v_fshape <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; goto __pyx_L1;}
      Py_INCREF(__pyx_k81p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 788; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":789 */
    __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 = 789; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":791 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":792 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":793 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; 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 = 793; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; 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_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; 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 = 793; 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 = 793; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;}
    Py_INCREF(__pyx_k82p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k82p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 794; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":795 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.standard_gamma");
  __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;
}

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_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;
  PyArrayObject *__pyx_v_oshape;
  PyArrayObject *__pyx_v_oscale;
  double __pyx_v_fshape;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"shape","scale","size",0};
  __pyx_v_scale = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":805 */
  __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":806 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":807 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":808 */
    __pyx_1 = (__pyx_v_fshape <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}
      Py_INCREF(__pyx_k83p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 809; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":810 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}
      Py_INCREF(__pyx_k84p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 811; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":812 */
    __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 = 812; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":814 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":815 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":816 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_oscale));
  __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":817 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}
    Py_INCREF(__pyx_k85p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 818; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":819 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; 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_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 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 = 819; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}
    Py_INCREF(__pyx_k86p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k86p);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_2, 0, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":821 */
  __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.gamma");
  __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;
}

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_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;
  PyArrayObject *__pyx_v_odfnum;
  PyArrayObject *__pyx_v_odfden;
  double __pyx_v_fdfnum;
  double __pyx_v_fdfden;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"dfnum","dfden","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":831 */
  __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":832 */
  __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":833 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":834 */
    __pyx_1 = (__pyx_v_fdfnum <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;}
      Py_INCREF(__pyx_k87p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 835; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":836 */
    __pyx_1 = (__pyx_v_fdfden <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}
      Py_INCREF(__pyx_k88p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 837; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":838 */
    __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 = 838; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":840 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":842 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":843 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_odfden));
  __pyx_v_odfden = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":844 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;}
    Py_INCREF(__pyx_k89p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 845; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":846 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; 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_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 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 = 846; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;}
    Py_INCREF(__pyx_k90p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k90p);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_2, 0, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":848 */
  __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.f");
  __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;
}

static PyObject *__pyx_n_less;

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_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;
  PyObject *__pyx_v_size = 0;
  PyArrayObject *__pyx_v_odfnum;
  PyArrayObject *__pyx_v_odfden;
  PyArrayObject *__pyx_v_ononc;
  double __pyx_v_fdfnum;
  double __pyx_v_fdfden;
  double __pyx_v_fnonc;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"dfnum","dfden","nonc","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":858 */
  __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":859 */
  __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":860 */
  __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":861 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":862 */
    __pyx_1 = (__pyx_v_fdfnum <= 1);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}
      Py_INCREF(__pyx_k91p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 863; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":864 */
    __pyx_1 = (__pyx_v_fdfden <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}
      Py_INCREF(__pyx_k92p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 865; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":866 */
    __pyx_1 = (__pyx_v_fnonc < 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}
      Py_INCREF(__pyx_k93p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 867; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":868 */
    __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 = 868; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":871 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":873 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":874 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_odfden));
  __pyx_v_odfden = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":875 */
  __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":877 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; 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 = 877; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; 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_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;}
    Py_INCREF(__pyx_k94p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k94p);
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":879 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_odfden));
  PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_odfden));
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;}
    Py_INCREF(__pyx_k95p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k95p);
    __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    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 = 880; goto __pyx_L1;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":881 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_ononc));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ononc));
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;}
    Py_INCREF(__pyx_k96p);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k96p);
    __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 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 = 882; goto __pyx_L1;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":883 */
  __pyx_2 = __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_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.noncentral_f");
  __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;
}

static PyObject *__pyx_k97p;
static PyObject *__pyx_k98p;

static char __pyx_k97[] = "df <= 0";
static char __pyx_k98[] = "df <= 0";

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_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;
  double __pyx_v_fdf;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"df","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":894 */
  __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":895 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":896 */
    __pyx_1 = (__pyx_v_fdf <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;}
      Py_INCREF(__pyx_k97p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 897; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":898 */
    __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 = 898; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":900 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":902 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":903 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; 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 = 903; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;}
    Py_INCREF(__pyx_k98p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k98p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 904; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":905 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.chisquare");
  __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;
}

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_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;
  PyArrayObject *__pyx_v_odf;
  PyArrayObject *__pyx_v_ononc;
  double __pyx_v_fdf;
  double __pyx_v_fnonc;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"df","nonc","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":914 */
  __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":915 */
  __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":916 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":917 */
    __pyx_1 = (__pyx_v_fdf <= 1);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}
      Py_INCREF(__pyx_k99p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 918; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":919 */
    __pyx_1 = (__pyx_v_fnonc <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}
      Py_INCREF(__pyx_k100p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 920; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":921 */
    __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 = 921; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":924 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":926 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":927 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_ononc));
  __pyx_v_ononc = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":928 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}
    Py_INCREF(__pyx_k101p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 929; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":930 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; 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_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 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 = 930; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}
    Py_INCREF(__pyx_k102p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k102p);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_2, 0, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":932 */
  __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare");
  __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;
}

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_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 = __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 = 940; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("mtrand.RandomState.standard_cauchy");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_k103p;
static PyObject *__pyx_k104p;

static char __pyx_k103[] = "df <= 0";
static char __pyx_k104[] = "df <= 0";

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_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;
  double __pyx_v_fdf;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"df","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":950 */
  __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":951 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":952 */
    __pyx_1 = (__pyx_v_fdf <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}
      Py_INCREF(__pyx_k103p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 953; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":954 */
    __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 = 954; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":956 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":958 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":959 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; 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 = 959; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}
    Py_INCREF(__pyx_k104p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k104p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 960; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":961 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.standard_t");
  __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;
}

static PyObject *__pyx_k105p;
static PyObject *__pyx_k106p;

static char __pyx_k105[] = "kappa < 0";
static char __pyx_k106[] = "kappa < 0";

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_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;
  PyArrayObject *__pyx_v_omu;
  PyArrayObject *__pyx_v_okappa;
  double __pyx_v_fmu;
  double __pyx_v_fkappa;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"mu","kappa","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":972 */
  __pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":973 */
  __pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":974 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":975 */
    __pyx_1 = (__pyx_v_fkappa < 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;}
      Py_INCREF(__pyx_k105p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 976; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":977 */
    __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 = 977; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":979 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":981 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":982 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_okappa));
  __pyx_v_okappa = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":983 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;}
    Py_INCREF(__pyx_k106p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 984; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":985 */
  __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.vonmises");
  __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;
}

static PyObject *__pyx_k107p;
static PyObject *__pyx_k108p;

static char __pyx_k107[] = "a <= 0";
static char __pyx_k108[] = "a <= 0";

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_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;
  double __pyx_v_fa;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"a","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":995 */
  __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":996 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":997 */
    __pyx_1 = (__pyx_v_fa <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; 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_k107p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 998; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":999 */
    __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 = 999; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1001 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1003 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1004 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; 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 = 1004; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; 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_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; 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 = 1004; 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 = 1004; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;}
    Py_INCREF(__pyx_k108p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k108p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1005; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1006 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.pareto");
  __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;
}

static PyObject *__pyx_k109p;
static PyObject *__pyx_k110p;

static char __pyx_k109[] = "a <= 0";
static char __pyx_k110[] = "a <= 0";

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_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;
  double __pyx_v_fa;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"a","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1016 */
  __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1017 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1018 */
    __pyx_1 = (__pyx_v_fa <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;}
      Py_INCREF(__pyx_k109p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1019; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1020 */
    __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 = 1020; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1022 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1024 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1025 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; 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 = 1025; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; 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_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; 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 = 1025; 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 = 1025; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;}
    Py_INCREF(__pyx_k110p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k110p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1026; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1027 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.weibull");
  __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;
}

static PyObject *__pyx_k111p;
static PyObject *__pyx_k112p;

static char __pyx_k111[] = "a <= 0";
static char __pyx_k112[] = "a <= 0";

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_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;
  double __pyx_v_fa;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"a","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1037 */
  __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1038 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1039 */
    __pyx_1 = (__pyx_v_fa <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;}
      Py_INCREF(__pyx_k111p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1040; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1041 */
    __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 = 1041; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1043 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1045 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1046 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; 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 = 1046; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; 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_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; 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 = 1046; 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 = 1046; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;}
    Py_INCREF(__pyx_k112p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1047; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1048 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.power");
  __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;
}

static PyObject *__pyx_k113p;
static PyObject *__pyx_k114p;

static char __pyx_k113[] = "scale <= 0";
static char __pyx_k114[] = "scale <= 0";

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_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;
  PyArrayObject *__pyx_v_oloc;
  PyArrayObject *__pyx_v_oscale;
  double __pyx_v_floc;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"loc","scale","size",0};
  __pyx_v_loc = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1058 */
  __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1059 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1060 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1061 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;}
      Py_INCREF(__pyx_k113p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k113p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1062; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1063 */
    __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 = 1063; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1065 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1066 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_oloc));
  __pyx_v_oloc = ((PyArrayObject *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1067 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_oscale));
  __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1068 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;}
    Py_INCREF(__pyx_k114p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 1069; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1070 */
  __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.laplace");
  __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;
}

static PyObject *__pyx_k115p;
static PyObject *__pyx_k116p;

static char __pyx_k115[] = "scale <= 0";
static char __pyx_k116[] = "scale <= 0";

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_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;
  PyArrayObject *__pyx_v_oloc;
  PyArrayObject *__pyx_v_oscale;
  double __pyx_v_floc;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"loc","scale","size",0};
  __pyx_v_loc = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1080 */
  __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1081 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1082 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1083 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;}
      Py_INCREF(__pyx_k115p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1084; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1085 */
    __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 = 1085; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1087 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1088 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_oloc));
  __pyx_v_oloc = ((PyArrayObject *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1089 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_oscale));
  __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1090 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;}
    Py_INCREF(__pyx_k116p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 1091; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1092 */
  __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.gumbel");
  __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;
}

static PyObject *__pyx_k117p;
static PyObject *__pyx_k118p;

static char __pyx_k117[] = "scale <= 0";
static char __pyx_k118[] = "scale <= 0";

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_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;
  PyArrayObject *__pyx_v_oloc;
  PyArrayObject *__pyx_v_oscale;
  double __pyx_v_floc;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"loc","scale","size",0};
  __pyx_v_loc = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1102 */
  __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1103 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1104 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1105 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;}
      Py_INCREF(__pyx_k117p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1106; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1107 */
    __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 = 1107; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1109 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1110 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_oloc));
  __pyx_v_oloc = ((PyArrayObject *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1111 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_oscale));
  __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1112 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;}
    Py_INCREF(__pyx_k118p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 1113; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1114 */
  __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.logistic");
  __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;
}

static PyObject *__pyx_k119p;
static PyObject *__pyx_k120p;

static char __pyx_k119[] = "sigma <= 0";
static char __pyx_k120[] = "sigma <= 0.0";

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_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;
  PyArrayObject *__pyx_v_omean;
  PyArrayObject *__pyx_v_osigma;
  double __pyx_v_fmean;
  double __pyx_v_fsigma;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"mean","sigma","size",0};
  __pyx_v_mean = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1129 */
  __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1130 */
  __pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1132 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1133 */
    __pyx_1 = (__pyx_v_fsigma <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
      Py_INCREF(__pyx_k119p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k119p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1134; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1135 */
    __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 = 1135; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1137 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1139 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_omean));
  __pyx_v_omean = ((PyArrayObject *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1140 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_osigma));
  __pyx_v_osigma = ((PyArrayObject *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1141 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;}
    Py_INCREF(__pyx_k120p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 1142; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1143 */
  __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.lognormal");
  __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;
}

static PyObject *__pyx_k121p;
static PyObject *__pyx_k122p;

static char __pyx_k121[] = "scale <= 0";
static char __pyx_k122[] = "scale <= 0.0";

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_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;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"scale","size",0};
  __pyx_v_scale = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1153 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1155 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1156 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;}
      Py_INCREF(__pyx_k121p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k121p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1157; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1158 */
    __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 = 1158; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1160 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1162 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1163 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; 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 = 1163; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; 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_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; 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 = 1163; 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 = 1163; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;}
    Py_INCREF(__pyx_k122p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k122p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1164; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1165 */
  __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.rayleigh");
  __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;
}

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_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;
  PyArrayObject *__pyx_v_omean;
  PyArrayObject *__pyx_v_oscale;
  double __pyx_v_fmean;
  double __pyx_v_fscale;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"mean","scale","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1175 */
  __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1176 */
  __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1177 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1178 */
    __pyx_1 = (__pyx_v_fmean <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;}
      Py_INCREF(__pyx_k123p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k123p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1179; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1180 */
    __pyx_1 = (__pyx_v_fscale <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
      Py_INCREF(__pyx_k124p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k124p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1181; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1182 */
    __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 = 1182; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1184 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1185 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_omean));
  __pyx_v_omean = ((PyArrayObject *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1186 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_oscale));
  __pyx_v_oscale = ((PyArrayObject *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1187 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; 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_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;}
    Py_INCREF(__pyx_k125p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 1188; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; 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_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 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 = 1189; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;}
    Py_INCREF(__pyx_k126p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k126p);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_2, 0, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1191 */
  __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.wald");
  __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;
}

static PyObject *__pyx_n_greater;
static PyObject *__pyx_n_equal;

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_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;
  PyObject *__pyx_v_size = 0;
  PyArrayObject *__pyx_v_oleft;
  PyArrayObject *__pyx_v_omode;
  PyArrayObject *__pyx_v_oright;
  double __pyx_v_fleft;
  double __pyx_v_fmode;
  double __pyx_v_fright;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"left","mode","right","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1204 */
  __pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1205 */
  __pyx_v_fright = PyFloat_AsDouble(__pyx_v_right);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1206 */
  __pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1207 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1208 */
    __pyx_1 = (__pyx_v_fleft > __pyx_v_fmode);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;}
      Py_INCREF(__pyx_k127p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k127p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1209; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1210 */
    __pyx_1 = (__pyx_v_fmode > __pyx_v_fright);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
      Py_INCREF(__pyx_k128p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k128p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1211; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1212 */
    __pyx_1 = (__pyx_v_fleft == __pyx_v_fright);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
      Py_INCREF(__pyx_k129p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k129p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1213; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1214 */
    __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 = 1214; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1217 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1218 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1219 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_omode));
  __pyx_v_omode = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1220 */
  __pyx_2 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2)));
  Py_DECREF(((PyObject *)__pyx_v_oright));
  __pyx_v_oright = ((PyArrayObject *)__pyx_2);
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1222 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; 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 = 1222; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; 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_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
    Py_INCREF(__pyx_k130p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k130p);
    __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1224 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_omode));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_omode));
  Py_INCREF(((PyObject *)__pyx_v_oright));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_oright));
  __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;}
    Py_INCREF(__pyx_k131p);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k131p);
    __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 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 = 1225; goto __pyx_L1;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1226 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_oleft));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft));
  Py_INCREF(((PyObject *)__pyx_v_oright));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_oright));
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;}
    Py_INCREF(__pyx_k132p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k132p);
    __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1228 */
  __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 = 1228; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.triangular");
  __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;
}

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_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;
  PyArrayObject *__pyx_v_on;
  PyArrayObject *__pyx_v_op;
  long __pyx_v_ln;
  double __pyx_v_fp;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"n","p","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1241 */
  __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1242 */
  __pyx_v_ln = PyInt_AsLong(__pyx_v_n);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1243 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1244 */
    __pyx_1 = (__pyx_v_ln <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
      Py_INCREF(__pyx_k133p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k133p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1245; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1246 */
    __pyx_1 = (__pyx_v_fp < 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
      Py_INCREF(__pyx_k134p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k134p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1247; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_1 = (__pyx_v_fp > 1);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
      Py_INCREF(__pyx_k135p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k135p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1249; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1250 */
    __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 = 1250; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1252 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1254 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1255 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_op));
  __pyx_v_op = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1256 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  Py_INCREF(__pyx_v_n);
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;}
    Py_INCREF(__pyx_k136p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 1257; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1258 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  Py_INCREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 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 = 1258; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;}
    Py_INCREF(__pyx_k137p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k137p);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_2, 0, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1260 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  Py_INCREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;}
    Py_INCREF(__pyx_k138p);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k138p);
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 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 = 1261; goto __pyx_L1;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1262 */
  __pyx_4 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;}
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.binomial");
  __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;
}

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_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;
  PyArrayObject *__pyx_v_on;
  PyArrayObject *__pyx_v_op;
  long __pyx_v_ln;
  double __pyx_v_fp;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"n","p","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1274 */
  __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1275 */
  __pyx_v_ln = PyInt_AsLong(__pyx_v_n);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1276 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1277 */
    __pyx_1 = (__pyx_v_ln <= 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;}
      Py_INCREF(__pyx_k139p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k139p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1278; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1279 */
    __pyx_1 = (__pyx_v_fp < 0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
      Py_INCREF(__pyx_k140p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k140p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1280; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_1 = (__pyx_v_fp > 1);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;}
      Py_INCREF(__pyx_k141p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k141p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1282; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1283 */
    __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 = 1283; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1286 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1288 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1289 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_op));
  __pyx_v_op = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1290 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  Py_INCREF(__pyx_v_n);
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;}
    Py_INCREF(__pyx_k142p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p);
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    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 = 1291; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1292 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  Py_INCREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 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 = 1292; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;}
    Py_INCREF(__pyx_k143p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k143p);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_2, 0, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1294 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_INCREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;}
    Py_INCREF(__pyx_k144p);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k144p);
    __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 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 = 1295; goto __pyx_L1;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1296 */
  __pyx_4 = __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_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;}
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.negative_binomial");
  __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;
}

static PyObject *__pyx_k145p;
static PyObject *__pyx_k146p;

static char __pyx_k145[] = "lam < 0";
static char __pyx_k146[] = "lam < 0";

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_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;
  double __pyx_v_flam;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"lam","size",0};
  __pyx_v_lam = __pyx_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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1306 */
  __pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1307 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1308 */
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;}
    __pyx_1 = __pyx_1 < 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
      Py_INCREF(__pyx_k145p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k145p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1309; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1310 */
    __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 = 1310; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1312 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1314 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1315 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; 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 = 1315; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_olam));
  PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_olam));
  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 = 1315; 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 = 1315; 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 = 1315; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; goto __pyx_L1;}
    Py_INCREF(__pyx_k146p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k146p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1316; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1317 */
  __pyx_5 = __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_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.poisson");
  __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;
}

static PyObject *__pyx_k147p;
static PyObject *__pyx_k148p;

static char __pyx_k147[] = "a <= 1.0";
static char __pyx_k148[] = "a <= 1.0";

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_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;
  double __pyx_v_fa;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"a","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1327 */
  __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1328 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1329 */
    __pyx_1 = (__pyx_v_fa <= 1.0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
      Py_INCREF(__pyx_k147p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k147p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1330; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1331 */
    __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 = 1331; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1333 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1335 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1336 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; 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 = 1336; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; 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_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; 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 = 1336; 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 = 1336; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;}
    Py_INCREF(__pyx_k148p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k148p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1337; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1338 */
  __pyx_5 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.zipf");
  __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;
}

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_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;
  double __pyx_v_fp;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"p","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1349 */
  __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1350 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1351 */
    __pyx_1 = (__pyx_v_fp < 0.0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;}
      Py_INCREF(__pyx_k149p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k149p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1352; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1353 */
    __pyx_1 = (__pyx_v_fp > 1.0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
      Py_INCREF(__pyx_k150p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k150p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1354; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1355 */
    __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 = 1355; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1357 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1360 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1361 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; 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 = 1361; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; 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_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; 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 = 1361; 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 = 1361; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;}
    Py_INCREF(__pyx_k151p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k151p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1362; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1363 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; 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_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;}
    Py_INCREF(__pyx_k152p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k152p);
    __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    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 = 1364; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1365 */
  __pyx_2 = __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_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.geometric");
  __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;
}

static PyObject *__pyx_n_add;

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_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;
  PyObject *__pyx_v_size = 0;
  PyArrayObject *__pyx_v_ongood;
  PyArrayObject *__pyx_v_onbad;
  PyArrayObject *__pyx_v_onsample;
  long __pyx_v_lngood;
  long __pyx_v_lnbad;
  long __pyx_v_lnsample;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  static char *__pyx_argnames[] = {"ngood","nbad","nsample","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1380 */
  __pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1381 */
  __pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1382 */
  __pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1383 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1384 */
    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; goto __pyx_L1;}
    __pyx_1 = __pyx_1 < 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; goto __pyx_L1;}
      Py_INCREF(__pyx_k153p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k153p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1385; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1386 */
    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;}
    __pyx_1 = __pyx_1 < 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_1) {
      __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;}
      __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;}
      Py_INCREF(__pyx_k154p);
      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k154p);
      __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __Pyx_Raise(__pyx_2, 0, 0);
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1388 */
    __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;}
    __pyx_1 = __pyx_1 < 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    if (__pyx_1) {
      __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;}
      __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;}
      Py_INCREF(__pyx_k155p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k155p);
      __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      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 = 1389; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1390 */
    __pyx_4 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_4, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;}
    __pyx_1 = __pyx_1 < 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;}
      Py_INCREF(__pyx_k156p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k156p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1391; goto __pyx_L1;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1392 */
    __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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1396 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1398 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1399 */
  __pyx_4 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;}
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4)));
  Py_DECREF(((PyObject *)__pyx_v_onbad));
  __pyx_v_onbad = ((PyArrayObject *)__pyx_4);
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1400 */
  __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1401 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; 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 = 1401; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_ongood));
  PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_ongood));
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
    Py_INCREF(__pyx_k157p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k157p);
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1403 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_onbad));
  PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_onbad));
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
    Py_INCREF(__pyx_k158p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k158p);
    __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    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 = 1404; goto __pyx_L1;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1405 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_onsample));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_onsample));
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;}
    Py_INCREF(__pyx_k159p);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k159p);
    __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 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 = 1406; goto __pyx_L1;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1407 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_ongood));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood));
  Py_INCREF(((PyObject *)__pyx_v_onbad));
  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_onbad));
  __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6);
  Py_INCREF(((PyObject *)__pyx_v_onsample));
  PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onsample));
  __pyx_6 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; 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 = 1407; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;}
    Py_INCREF(__pyx_k160p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k160p);
    __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    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 = 1408; goto __pyx_L1;}
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1409 */
  __pyx_6 = __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_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;}
  __pyx_r = __pyx_6;
  __pyx_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("mtrand.RandomState.hypergeometric");
  __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;
}

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_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;
  double __pyx_v_fp;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"p","size",0};
  __pyx_v_size = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1420 */
  __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1421 */
  __pyx_1 = (!PyErr_Occurred());
  if (__pyx_1) {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1422 */
    __pyx_1 = (__pyx_v_fp < 0.0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;}
      Py_INCREF(__pyx_k161p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k161p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1423; goto __pyx_L1;}
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1424 */
    __pyx_1 = (__pyx_v_fp > 1.0);
    if (__pyx_1) {
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;}
      __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;}
      Py_INCREF(__pyx_k162p);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k162p);
      __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      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 = 1425; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1426 */
    __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 = 1426; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1428 */
  PyErr_Clear();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1430 */
  __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1431 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; 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 = 1431; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; 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_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; 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 = 1431; 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 = 1431; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_1) {
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; goto __pyx_L1;}
    Py_INCREF(__pyx_k163p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k163p);
    __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    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 = 1432; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1433 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; 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_5);
  __pyx_5 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
  __pyx_5 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;}
    Py_INCREF(__pyx_k164p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k164p);
    __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    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 = 1434; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1435 */
  __pyx_2 = __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_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.logseries");
  __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;
}

static PyObject *__pyx_n_array;
static PyObject *__pyx_n_shape;
static PyObject *__pyx_n_list;
static PyObject *__pyx_n_append;
static PyObject *__pyx_n_multiply;
static PyObject *__pyx_n_reduce;
static PyObject *__pyx_n_svd;
static PyObject *__pyx_n_dot;
static PyObject *__pyx_n_sqrt;
static PyObject *__pyx_n_tuple;

static PyObject *__pyx_k165p;
static PyObject *__pyx_k166p;
static PyObject *__pyx_k167p;
static PyObject *__pyx_k168p;

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_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_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;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_v_final_shape;
  PyObject *__pyx_v_x;
  PyObject *__pyx_v_svd;
  PyObject *__pyx_v_u;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_v;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  Py_ssize_t __pyx_5;
  PyObject *__pyx_6 = 0;
  static char *__pyx_argnames[] = {"mean","cov","size",0};
  __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);
  __pyx_v_svd = Py_None; Py_INCREF(Py_None);
  __pyx_v_u = Py_None; Py_INCREF(Py_None);
  __pyx_v_s = Py_None; Py_INCREF(Py_None);
  __pyx_v_v = Py_None; Py_INCREF(Py_None);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1456 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; goto __pyx_L1;}
  Py_INCREF(__pyx_v_mean);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1457 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; goto __pyx_L1;}
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; 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 = 1457; goto __pyx_L1;}
  Py_INCREF(__pyx_v_cov);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1458 */
  __pyx_4 = __pyx_v_size == Py_None;
  if (__pyx_4) {
    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; goto __pyx_L1;}
    Py_DECREF(__pyx_v_shape);
    __pyx_v_shape = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L2;
  }
  /*else*/ {
    Py_INCREF(__pyx_v_size);
    Py_DECREF(__pyx_v_shape);
    __pyx_v_shape = __pyx_v_size;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1462 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; goto __pyx_L1;}
  __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_4 = (__pyx_5 != 1);
  if (__pyx_4) {
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;}
    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;}
    Py_INCREF(__pyx_k165p);
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k165p);
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1464 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
  __pyx_5 = PyObject_Length(__pyx_2); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = (__pyx_5 != 2);
  if (!__pyx_4) {
    __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
    __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
    __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
    __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    if (PyObject_Cmp(__pyx_2, __pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;}
    __pyx_4 = __pyx_4 != 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
  }
  if (__pyx_4) {
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;}
    Py_INCREF(__pyx_k166p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k166p);
    __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    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 = 1465; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1466 */
  __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  __pyx_4 = __pyx_4 != 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_4) {
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;}
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;}
    Py_INCREF(__pyx_k167p);
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k167p);
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    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 = 1467; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1469 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;}
  __pyx_4 = PyObject_IsInstance(__pyx_v_shape,__pyx_1); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_4) {
    __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; goto __pyx_L1;}
    Py_INCREF(__pyx_v_shape);
    PyList_SET_ITEM(__pyx_2, 0, __pyx_v_shape);
    Py_DECREF(__pyx_v_shape);
    __pyx_v_shape = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1471 */
  __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
  __pyx_3 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_final_shape);
  __pyx_v_final_shape = __pyx_2;
  __pyx_2 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1472 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;}
  __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;}
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; 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 = 1472; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1476 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  Py_INCREF(__pyx_v_final_shape);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);
  __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
  __pyx_6 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_x);
  __pyx_v_x = __pyx_3;
  __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1477 */
  __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  __pyx_3 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
  __pyx_6 = PyObject_GetItem(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_6);
  __pyx_2 = 0;
  __pyx_6 = 0;
  if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1486 */
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
  Py_INCREF(__pyx_n_svd);
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_svd);
  __pyx_2 = __Pyx_Import(__pyx_k168p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyObject_GetAttr(__pyx_2, __pyx_n_svd); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;}
  Py_DECREF(__pyx_v_svd);
  __pyx_v_svd = __pyx_6;
  __pyx_6 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1488 */
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;}
  Py_INCREF(__pyx_v_cov);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);
  __pyx_1 = PyObject_CallObject(__pyx_v_svd, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;}
  Py_DECREF(__pyx_v_u);
  __pyx_v_u = __pyx_6;
  __pyx_6 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_3;
  __pyx_3 = 0;
  __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;}
  Py_DECREF(__pyx_v_v);
  __pyx_v_v = __pyx_1;
  __pyx_1 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1489 */
  __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_dot); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  Py_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_s);
  __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
  Py_INCREF(__pyx_v_v);
  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_v);
  __pyx_2 = 0;
  __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_v_x);
  __pyx_v_x = __pyx_1;
  __pyx_1 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1492 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_add); 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(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
  Py_INCREF(__pyx_v_mean);
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_mean);
  Py_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_x);
  Py_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_6, 2, __pyx_v_x);
  __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1493 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;}
  Py_INCREF(__pyx_v_final_shape);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);
  __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1494 */
  Py_INCREF(__pyx_v_x);
  __pyx_r = __pyx_v_x;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_shape);
  Py_DECREF(__pyx_v_final_shape);
  Py_DECREF(__pyx_v_x);
  Py_DECREF(__pyx_v_svd);
  Py_DECREF(__pyx_v_u);
  Py_DECREF(__pyx_v_s);
  Py_DECREF(__pyx_v_v);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mean);
  Py_DECREF(__pyx_v_cov);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_n_zeros;

static PyObject *__pyx_k170p;

static char __pyx_k170[] = "sum(pvals[:-1]) > 1.0";

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_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;
  long __pyx_v_d;
  PyArrayObject *arrayObject_parr;
  PyArrayObject *arrayObject_mnarr;
  double *__pyx_v_pix;
  long *__pyx_v_mnix;
  long __pyx_v_i;
  long __pyx_v_j;
  long __pyx_v_dn;
  double __pyx_v_Sum;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_v_multin;
  PyObject *__pyx_r;
  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 = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1512 */
  __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; goto __pyx_L1;}
  __pyx_v_d = __pyx_1;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1513 */
  __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1514 */
  __pyx_v_pix = ((double *)arrayObject_parr->data);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1516 */
  __pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > (1.0 + 1e-12));
  if (__pyx_3) {
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;}
    Py_INCREF(__pyx_k170p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k170p);
    __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    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 = 1517; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1519 */
  __pyx_3 = __pyx_v_size == Py_None;
  if (__pyx_3) {
    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; 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_L3;
  }
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;}
  Py_INCREF(__pyx_v_size);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);
  __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;}
  __pyx_3 = __pyx_4 == __pyx_5;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_3) {
    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; 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);
    __pyx_2 = 0;
    Py_DECREF(__pyx_v_shape);
    __pyx_v_shape = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {
    __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_4 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_v_shape);
    __pyx_v_shape = __pyx_4;
    __pyx_4 = 0;
  }
  __pyx_L3:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1526 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;}
  Py_INCREF(__pyx_v_shape);
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_v_multin);
  __pyx_v_multin = __pyx_4;
  __pyx_4 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1527 */
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin)));
  Py_DECREF(((PyObject *)arrayObject_mnarr));
  arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1528 */
  __pyx_v_mnix = ((long *)arrayObject_mnarr->data);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1529 */
  __pyx_v_i = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1530 */
  while (1) {
    __pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));
    if (!__pyx_3) break;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1531 */
    __pyx_v_Sum = 1.0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1532 */
    __pyx_v_dn = __pyx_v_n;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1533 */
    __pyx_6 = (__pyx_v_d - 1);
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; ++__pyx_v_j) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1534 */
      (__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));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1535 */
      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1536 */
      __pyx_3 = (__pyx_v_dn <= 0);
      if (__pyx_3) {
        goto __pyx_L7;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1538 */
      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));
    }
    __pyx_L7:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1539 */
    __pyx_3 = (__pyx_v_dn > 0);
    if (__pyx_3) {
      (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1542 */
    __pyx_v_i = (__pyx_v_i + __pyx_v_d);
  }

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1544 */
  Py_INCREF(__pyx_v_multin);
  __pyx_r = __pyx_v_multin;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.multinomial");
  __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;
}

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            alpha : array\n                parameter of the distribution (k dimension\n                      for sample of dimension k).\n            size : array\n                number of samples to draw.\n\n        $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 X = \frac{1}{\\sum_{i=1}^k{y_i}} (y_1, ..., y_n) is \n        Dirichlet distributed. \n        \n        Reference:\n            - David Mc Kay : Information Theory, inference and Learning \n                 algorithms, chapter 23. the book is available for free at \n                 http://www.inference.phy.cam.ac.uk/mackay/\n        ";
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;
  long __pyx_v_totsize;
  PyArrayObject *__pyx_v_alpha_arr;
  PyArrayObject *__pyx_v_val_arr;
  double *__pyx_v_alpha_data;
  double *__pyx_v_val_data;
  long __pyx_v_i;
  long __pyx_v_j;
  double __pyx_v_acc;
  double __pyx_v_invacc;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_v_diric;
  PyObject *__pyx_r;
  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 = __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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1601 */
  __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; goto __pyx_L1;}
  __pyx_v_k = __pyx_1;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1602 */
  __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; 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;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1603 */
  __pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1605 */
  __pyx_3 = __pyx_v_size == Py_None;
  if (__pyx_3) {
    __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; 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_L2;
  }
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; goto __pyx_L1;}
  Py_INCREF(__pyx_v_size);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size);
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; goto __pyx_L1;}
  __pyx_3 = __pyx_5 == __pyx_2;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_3) {
    __pyx_4 = PyInt_FromLong(__pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; goto __pyx_L1;}
    Py_INCREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
    __pyx_4 = 0;
    Py_DECREF(__pyx_v_shape);
    __pyx_v_shape = __pyx_5;
    __pyx_5 = 0;
    goto __pyx_L2;
  }
  /*else*/ {
    __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
    __pyx_2 = 0;
    __pyx_5 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_shape);
    __pyx_v_shape = __pyx_5;
    __pyx_5 = 0;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1612 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;}
  __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; 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 = 1612; goto __pyx_L1;}
  Py_INCREF(__pyx_v_shape);
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);
  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 = 1612; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_v_diric);
  __pyx_v_diric = __pyx_2;
  __pyx_2 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1613 */
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric)));
  Py_DECREF(((PyObject *)__pyx_v_val_arr));
  __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1614 */
  __pyx_v_val_data = ((double *)__pyx_v_val_arr->data);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1616 */
  __pyx_v_i = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1617 */
  __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1618 */
  while (1) {
    __pyx_3 = (__pyx_v_i < __pyx_v_totsize);
    if (!__pyx_3) break;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1619 */
    __pyx_v_acc = 0.0;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1620 */
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) {

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1621 */
      (__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]));

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1622 */
      __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]));
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1623 */
    __pyx_v_invacc = (1 / __pyx_v_acc);

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1624 */
    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);
    }

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1626 */
    __pyx_v_i = (__pyx_v_i + __pyx_v_k);
  }

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1628 */
  Py_INCREF(__pyx_v_diric);
  __pyx_r = __pyx_v_diric;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("mtrand.RandomState.dirichlet");
  __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;
}

static PyObject *__pyx_n_copy;


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_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;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  int __pyx_5;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1639 */
  __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; goto __pyx_L1;}
  __pyx_v_i = (__pyx_1 - 1);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1640 */
  /*try:*/ {
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; goto __pyx_L2;}
    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; goto __pyx_L2;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_1 = PyObject_Length(__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; goto __pyx_L2;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_v_j = __pyx_1;
  }
  goto __pyx_L3;
  __pyx_L2:;
  Py_XDECREF(__pyx_2); __pyx_2 = 0;
  Py_XDECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1642 */
  /*except:*/ {
    __Pyx_AddTraceback("mtrand.shuffle");
    if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; 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_L3;
  }
  __pyx_L3:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1645 */
  __pyx_5 = (__pyx_v_j == 0);
  if (__pyx_5) {
    while (1) {
      __pyx_5 = (__pyx_v_i > 0);
      if (!__pyx_5) break;

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1648 */
      __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1649 */
      __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_2); __pyx_2 = 0;

      /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1650 */
      __pyx_v_i = (__pyx_v_i - 1);
    }
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1653 */
    __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_5 = PyObject_HasAttr(__pyx_2,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_v_copy = __pyx_5;

    /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1654 */
    __pyx_5 = __pyx_v_copy;
    if (__pyx_5) {
      while (1) {
        __pyx_5 = (__pyx_v_i > 0);
        if (!__pyx_5) break;

        /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1656 */
        __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);

        /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1657 */
        __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_3); __pyx_3 = 0;
        __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_2); __pyx_2 = 0;
        __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_2); __pyx_2 = 0;
        __pyx_2 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        Py_DECREF(__pyx_3); __pyx_3 = 0;
        __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;}
        Py_DECREF(__pyx_3); __pyx_3 = 0;
        Py_DECREF(__pyx_2); __pyx_2 = 0;

        /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1658 */
        __pyx_v_i = (__pyx_v_i - 1);
      }
      goto __pyx_L7;
    }
    /*else*/ {
      while (1) {
        __pyx_5 = (__pyx_v_i > 0);
        if (!__pyx_5) break;

        /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1661 */
        __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);

        /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1662 */
        __pyx_4 = PyInt_FromLong(__pyx_v_j); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        Py_DECREF(__pyx_2); __pyx_2 = 0;
        __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        Py_DECREF(__pyx_2); __pyx_2 = 0;
        __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        Py_DECREF(__pyx_2); __pyx_2 = 0;
        Py_DECREF(__pyx_3); __pyx_3 = 0;
        __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;}
        Py_DECREF(__pyx_3); __pyx_3 = 0;
        Py_DECREF(__pyx_4); __pyx_4 = 0;

        /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1663 */
        __pyx_v_i = (__pyx_v_i - 1);
      }
    }
    __pyx_L7:;
  }
  __pyx_L4:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mtrand.RandomState.shuffle");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_x);
  return __pyx_r;
}

static PyObject *__pyx_n_arange;

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_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;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  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);

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1671 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;}
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3);
  __pyx_1 = 0;
  __pyx_3 = 0;
  __pyx_4 = PyObject_IsInstance(__pyx_v_x,__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_4) {
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;}
    Py_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);
    __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_v_arr);
    __pyx_v_arr = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L2;
  }
  /*else*/ {
    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;}
    __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;}
    Py_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_v_arr);
    __pyx_v_arr = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L2:;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1675 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; goto __pyx_L1;}
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; goto __pyx_L1;}
  Py_INCREF(__pyx_v_arr);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_arr);
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1676 */
  Py_INCREF(__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("mtrand.RandomState.permutation");
  __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__rand, "_rand"},
  {&__pyx_n__sp, "_sp"},
  {&__pyx_n_add, "add"},
  {&__pyx_n_any, "any"},
  {&__pyx_n_append, "append"},
  {&__pyx_n_arange, "arange"},
  {&__pyx_n_array, "array"},
  {&__pyx_n_asarray, "asarray"},
  {&__pyx_n_beta, "beta"},
  {&__pyx_n_binomial, "binomial"},
  {&__pyx_n_bytes, "bytes"},
  {&__pyx_n_chisquare, "chisquare"},
  {&__pyx_n_copy, "copy"},
  {&__pyx_n_dirichlet, "dirichlet"},
  {&__pyx_n_dot, "dot"},
  {&__pyx_n_empty, "empty"},
  {&__pyx_n_equal, "equal"},
  {&__pyx_n_exponential, "exponential"},
  {&__pyx_n_f, "f"},
  {&__pyx_n_float64, "float64"},
  {&__pyx_n_gamma, "gamma"},
  {&__pyx_n_geometric, "geometric"},
  {&__pyx_n_get_state, "get_state"},
  {&__pyx_n_greater, "greater"},
  {&__pyx_n_gumbel, "gumbel"},
  {&__pyx_n_hypergeometric, "hypergeometric"},
  {&__pyx_n_int, "int"},
  {&__pyx_n_integer, "integer"},
  {&__pyx_n_laplace, "laplace"},
  {&__pyx_n_less, "less"},
  {&__pyx_n_less_equal, "less_equal"},
  {&__pyx_n_list, "list"},
  {&__pyx_n_logistic, "logistic"},
  {&__pyx_n_lognormal, "lognormal"},
  {&__pyx_n_logseries, "logseries"},
  {&__pyx_n_multinomial, "multinomial"},
  {&__pyx_n_multiply, "multiply"},
  {&__pyx_n_multivariate_normal, "multivariate_normal"},
  {&__pyx_n_negative_binomial, "negative_binomial"},
  {&__pyx_n_noncentral_chisquare, "noncentral_chisquare"},
  {&__pyx_n_noncentral_f, "noncentral_f"},
  {&__pyx_n_normal, "normal"},
  {&__pyx_n_numpy, "numpy"},
  {&__pyx_n_pareto, "pareto"},
  {&__pyx_n_permutation, "permutation"},
  {&__pyx_n_poisson, "poisson"},
  {&__pyx_n_power, "power"},
  {&__pyx_n_rand, "rand"},
  {&__pyx_n_randint, "randint"},
  {&__pyx_n_randn, "randn"},
  {&__pyx_n_random, "random"},
  {&__pyx_n_random_integers, "random_integers"},
  {&__pyx_n_random_sample, "random_sample"},
  {&__pyx_n_rayleigh, "rayleigh"},
  {&__pyx_n_reduce, "reduce"},
  {&__pyx_n_seed, "seed"},
  {&__pyx_n_set_state, "set_state"},
  {&__pyx_n_shape, "shape"},
  {&__pyx_n_shuffle, "shuffle"},
  {&__pyx_n_size, "size"},
  {&__pyx_n_sqrt, "sqrt"},
  {&__pyx_n_standard_cauchy, "standard_cauchy"},
  {&__pyx_n_standard_exponential, "standard_exponential"},
  {&__pyx_n_standard_gamma, "standard_gamma"},
  {&__pyx_n_standard_normal, "standard_normal"},
  {&__pyx_n_standard_t, "standard_t"},
  {&__pyx_n_subtract, "subtract"},
  {&__pyx_n_svd, "svd"},
  {&__pyx_n_triangular, "triangular"},
  {&__pyx_n_tuple, "tuple"},
  {&__pyx_n_type, "type"},
  {&__pyx_n_uint, "uint"},
  {&__pyx_n_uint32, "uint32"},
  {&__pyx_n_uniform, "uniform"},
  {&__pyx_n_vonmises, "vonmises"},
  {&__pyx_n_wald, "wald"},
  {&__pyx_n_weibull, "weibull"},
  {&__pyx_n_zeros, "zeros"},
  {&__pyx_n_zipf, "zipf"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__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) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++o->ob_refcnt;
    __pyx_f_6mtrand_11RandomState___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --o->ob_refcnt;
    PyErr_Restore(etype, eval, etb);
  }
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {
  return 0;
}

static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {
  return 0;
}

static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {
  {"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}
};

static PyNumberMethods __pyx_tp_as_number_RandomState = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_RandomState = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_RandomState = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_RandomState = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_6mtrand_RandomState = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "mtrand.RandomState", /*tp_name*/
  sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_RandomState, /*tp_as_number*/
  &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Container for the Mersenne Twister PRNG.\n\n    Constructor\n    -----------\n    RandomState(seed=None): initializes the PRNG with the given seed. See the\n        seed() method for details.\n\n    Distribution Methods\n    -----------------\n    RandomState exposes a number of methods for generating random numbers drawn\n    from a variety of probability distributions. In addition to the\n    distribution-specific arguments, each method takes a keyword argument\n    size=None. If size is None, then a single value is generated and returned.\n    If size is an integer, then a 1-D numpy array filled with generated values\n    is returned. If size is a tuple, then a numpy array with that shape is\n    filled and returned.\n    ", /*tp_doc*/
  __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/
  __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6mtrand_RandomState, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6mtrand_RandomState, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC initmtrand(void); /*proto*/
PyMODINIT_FUNC initmtrand(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  PyObject *__pyx_9 = 0;
  PyObject *__pyx_10 = 0;
  PyObject *__pyx_11 = 0;
  PyObject *__pyx_12 = 0;
  PyObject *__pyx_13 = 0;
  PyObject *__pyx_14 = 0;
  PyObject *__pyx_15 = 0;
  PyObject *__pyx_16 = 0;
  PyObject *__pyx_17 = 0;
  PyObject *__pyx_18 = 0;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("mtrand", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;};
  Py_INCREF(__pyx_m);
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; 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 = 468; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}
  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":119 */
  import_array();

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":121 */
  __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":488 */
  Py_INCREF(Py_None);
  __pyx_k2 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":498 */
  Py_INCREF(Py_None);
  __pyx_k3 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":567 */
  Py_INCREF(Py_None);
  __pyx_k4 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":574 */
  Py_INCREF(Py_None);
  __pyx_k5 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":581 */
  Py_INCREF(Py_None);
  __pyx_k6 = Py_None;
  Py_INCREF(Py_None);
  __pyx_k7 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":626 */
  __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;}
  __pyx_k8 = __pyx_1;
  __pyx_1 = 0;
  __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;}
  __pyx_k9 = __pyx_2;
  __pyx_2 = 0;
  Py_INCREF(Py_None);
  __pyx_k10 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":679 */
  Py_INCREF(Py_None);
  __pyx_k11 = Py_None;
  Py_INCREF(Py_None);
  __pyx_k12 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":692 */
  Py_INCREF(Py_None);
  __pyx_k13 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":699 */
  __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;}
  __pyx_k14 = __pyx_3;
  __pyx_3 = 0;
  __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;}
  __pyx_k15 = __pyx_4;
  __pyx_4 = 0;
  Py_INCREF(Py_None);
  __pyx_k16 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":722 */
  Py_INCREF(Py_None);
  __pyx_k17 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":749 */
  __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;}
  __pyx_k18 = __pyx_5;
  __pyx_5 = 0;
  Py_INCREF(Py_None);
  __pyx_k19 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":770 */
  Py_INCREF(Py_None);
  __pyx_k20 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":777 */
  Py_INCREF(Py_None);
  __pyx_k21 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":797 */
  __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; goto __pyx_L1;}
  __pyx_k22 = __pyx_6;
  __pyx_6 = 0;
  Py_INCREF(Py_None);
  __pyx_k23 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":823 */
  Py_INCREF(Py_None);
  __pyx_k24 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":850 */
  Py_INCREF(Py_None);
  __pyx_k25 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":886 */
  Py_INCREF(Py_None);
  __pyx_k26 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":907 */
  Py_INCREF(Py_None);
  __pyx_k27 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":935 */
  Py_INCREF(Py_None);
  __pyx_k28 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":942 */
  Py_INCREF(Py_None);
  __pyx_k29 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":963 */
  Py_INCREF(Py_None);
  __pyx_k30 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":987 */
  Py_INCREF(Py_None);
  __pyx_k31 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1008 */
  Py_INCREF(Py_None);
  __pyx_k32 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1029 */
  Py_INCREF(Py_None);
  __pyx_k33 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1050 */
  __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; goto __pyx_L1;}
  __pyx_k34 = __pyx_7;
  __pyx_7 = 0;
  __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; goto __pyx_L1;}
  __pyx_k35 = __pyx_8;
  __pyx_8 = 0;
  Py_INCREF(Py_None);
  __pyx_k36 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1072 */
  __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
  __pyx_k37 = __pyx_9;
  __pyx_9 = 0;
  __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;}
  __pyx_k38 = __pyx_10;
  __pyx_10 = 0;
  Py_INCREF(Py_None);
  __pyx_k39 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1094 */
  __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; goto __pyx_L1;}
  __pyx_k40 = __pyx_11;
  __pyx_11 = 0;
  __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; goto __pyx_L1;}
  __pyx_k41 = __pyx_12;
  __pyx_12 = 0;
  Py_INCREF(Py_None);
  __pyx_k42 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1116 */
  __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; goto __pyx_L1;}
  __pyx_k43 = __pyx_13;
  __pyx_13 = 0;
  __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; goto __pyx_L1;}
  __pyx_k44 = __pyx_14;
  __pyx_14 = 0;
  Py_INCREF(Py_None);
  __pyx_k45 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1145 */
  __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; goto __pyx_L1;}
  __pyx_k46 = __pyx_15;
  __pyx_15 = 0;
  Py_INCREF(Py_None);
  __pyx_k47 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1167 */
  Py_INCREF(Py_None);
  __pyx_k48 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1195 */
  Py_INCREF(Py_None);
  __pyx_k49 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1232 */
  Py_INCREF(Py_None);
  __pyx_k50 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1264 */
  Py_INCREF(Py_None);
  __pyx_k51 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1299 */
  __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; goto __pyx_L1;}
  __pyx_k52 = __pyx_16;
  __pyx_16 = 0;
  Py_INCREF(Py_None);
  __pyx_k53 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1319 */
  Py_INCREF(Py_None);
  __pyx_k54 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1340 */
  Py_INCREF(Py_None);
  __pyx_k55 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1367 */
  Py_INCREF(Py_None);
  __pyx_k56 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1412 */
  Py_INCREF(Py_None);
  __pyx_k57 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1438 */
  Py_INCREF(Py_None);
  __pyx_k58 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1496 */
  Py_INCREF(Py_None);
  __pyx_k59 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1546 */
  Py_INCREF(Py_None);
  __pyx_k60 = Py_None;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1678 */
  __pyx_17 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; goto __pyx_L1;}
  Py_DECREF(__pyx_17); __pyx_17 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1679 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; 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 = 1679; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1680 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; 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 = 1680; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1681 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; 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 = 1681; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1682 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; 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 = 1682; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1683 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; 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 = 1683; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1684 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; 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 = 1684; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1685 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; 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 = 1685; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1686 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; 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 = 1686; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1687 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; 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 = 1687; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1688 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; 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 = 1688; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1689 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; 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 = 1689; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1690 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; 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 = 1690; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1691 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; 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 = 1691; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1692 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; 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 = 1692; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1693 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; 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 = 1693; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1694 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; 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 = 1694; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1695 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; 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 = 1695; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1696 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; 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 = 1696; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1697 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; 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 = 1697; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1698 */
  __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;}
  __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; 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 = 1698; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_noncentral_chisquare); 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_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_standard_cauchy); 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_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_standard_t); 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_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_vonmises); 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_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_pareto); 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_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_weibull); 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_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_power); 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_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_laplace); 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_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_gumbel); 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_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_logistic); 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_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_lognormal); 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_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_rayleigh); 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_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_wald); 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_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_triangular); 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_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_binomial); 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_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_negative_binomial); 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_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_poisson); 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_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_zipf); 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_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_geometric); 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_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_hypergeometric); 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_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_logseries); 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_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_multivariate_normal); 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_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_multinomial); 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_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_dirichlet); 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_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_shuffle); 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_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;

  /* "/home/oliphant/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_permutation); 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_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;}
  Py_DECREF(__pyx_18); __pyx_18 = 0;
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  Py_XDECREF(__pyx_9);
  Py_XDECREF(__pyx_10);
  Py_XDECREF(__pyx_11);
  Py_XDECREF(__pyx_12);
  Py_XDECREF(__pyx_13);
  Py_XDECREF(__pyx_14);
  Py_XDECREF(__pyx_15);
  Py_XDECREF(__pyx_16);
  Py_XDECREF(__pyx_17);
  Py_XDECREF(__pyx_18);
  __Pyx_AddTraceback("mtrand");
}

static char *__pyx_filenames[] = {
  "mtrand.pyx",
  "numpy.pxi",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

static int __Pyx_GetStarArgs(
    PyObject **args, 
    PyObject **kwds,
    char *kwd_list[], 
    Py_ssize_t nargs,
    PyObject **args2, 
    PyObject **kwds2,
    char rqd_kwds[])
{
    PyObject *x = 0, *args1 = 0, *kwds1 = 0;
    int i;
    char **p;
    
    if (args2)
        *args2 = 0;
    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;
    }
    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;
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 (kwds2) {
        Py_XDECREF(*kwds2);
    }
    return -1;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
    if (!__import__)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunction(__import__, "OOOO",
        name, global_dict, empty_dict, list);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) type->ob_type;
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    PyErr_Restore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

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())
            __Pyx_UnpackError();
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_UnpackError();
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_Get();
    PyErr_Fetch(type, value, tb);
    PyErr_NormalizeException(type, value, tb);
    if (PyErr_Occurred())
        goto bad;
    Py_INCREF(*type);
    Py_INCREF(*value);
    Py_INCREF(*tb);
    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;
    return 0;
bad:
    Py_XDECREF(*type);
    Py_XDECREF(*value);
    Py_XDECREF(*tb);
    return -1;
}

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (obj == Py_None || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
        obj->ob_type->tp_name, type->tp_name);
    return 0;
}

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
    while (t->p) {
        *t->p = PyString_InternFromString(t->s);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, 
    long size) 
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    result = PyObject_GetAttrString(py_module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s does not appear to be the correct type object",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(char *name) {
    PyObject *py_name = 0;
    
    py_name = PyString_FromString(name);
    if (!py_name)
        goto bad;
    return PyImport_Import(py_name);
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

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;
    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(
        0,            /*int argcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        empty_string, /*PyObject *code,*/
        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,*/
        empty_string  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_Get(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
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);
}
