From numpy-svn at scipy.org Fri Sep 1 01:53:59 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 1 Sep 2006 00:53:59 -0500 (CDT) Subject: [Numpy-svn] r3099 - in trunk/numpy/core: include/numpy src Message-ID: <20060901055359.ED40E39C01B@new.scipy.org> Author: oliphant Date: 2006-09-01 00:53:54 -0500 (Fri, 01 Sep 2006) New Revision: 3099 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arrayobject.c Log: Fix so that VOID arrays are not found during a search but instead object arrays. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-08-29 18:29:53 UTC (rev 3098) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-01 05:53:54 UTC (rev 3099) @@ -32,9 +32,9 @@ /* Helpful to distinguish what is installed */ #define NPY_VERSION 0x01000002 - /* Some platforms don't define bool, long long, or long double. - Handle that here. - */ + /* Some platforms don't define bool, long long, or long double. + Handle that here. + */ #ifdef PY_LONG_LONG typedef PY_LONG_LONG npy_longlong; @@ -45,12 +45,12 @@ # define NPY_LONGLONG_SUFFIX(x) (x##i64) # define NPY_ULONGLONG_SUFFIX(x) (x##Ui64) # else - /* #define LONGLONG_FMT "lld" Another possible variant + /* #define LONGLONG_FMT "lld" Another possible variant #define ULONGLONG_FMT "llu" - #define LONGLONG_FMT "qd" -- BSD perhaps? - #define ULONGLONG_FMT "qu" - */ + #define LONGLONG_FMT "qd" -- BSD perhaps? + #define ULONGLONG_FMT "qu" + */ # define NPY_LONGLONG_FMT "Ld" # define NPY_ULONGLONG_FMT "Lu" # define NPY_LONGLONG_SUFFIX(x) (x##LL) @@ -69,10 +69,10 @@ #define NPY_TRUE 1 #if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE - typedef double npy_longdouble; + typedef double npy_longdouble; #define NPY_LONGDOUBLE_FMT "g" #else - typedef long double npy_longdouble; + typedef long double npy_longdouble; #define NPY_LONGDOUBLE_FMT "Lg" #endif @@ -138,58 +138,58 @@ /* except 'p' -- signed integer for pointer type */ enum NPY_TYPECHAR { NPY_BOOLLTR = '?', - NPY_BYTELTR = 'b', - NPY_UBYTELTR = 'B', - NPY_SHORTLTR = 'h', - NPY_USHORTLTR = 'H', - NPY_INTLTR = 'i', - NPY_UINTLTR = 'I', - NPY_LONGLTR = 'l', - NPY_ULONGLTR = 'L', - NPY_LONGLONGLTR = 'q', - NPY_ULONGLONGLTR = 'Q', - NPY_FLOATLTR = 'f', - NPY_DOUBLELTR = 'd', - NPY_LONGDOUBLELTR = 'g', - NPY_CFLOATLTR = 'F', - NPY_CDOUBLELTR = 'D', - NPY_CLONGDOUBLELTR = 'G', - NPY_OBJECTLTR = 'O', - NPY_STRINGLTR = 'S', - NPY_STRINGLTR2 = 'a', - NPY_UNICODELTR = 'U', - NPY_VOIDLTR = 'V', - NPY_CHARLTR = 'c', + NPY_BYTELTR = 'b', + NPY_UBYTELTR = 'B', + NPY_SHORTLTR = 'h', + NPY_USHORTLTR = 'H', + NPY_INTLTR = 'i', + NPY_UINTLTR = 'I', + NPY_LONGLTR = 'l', + NPY_ULONGLTR = 'L', + NPY_LONGLONGLTR = 'q', + NPY_ULONGLONGLTR = 'Q', + NPY_FLOATLTR = 'f', + NPY_DOUBLELTR = 'd', + NPY_LONGDOUBLELTR = 'g', + NPY_CFLOATLTR = 'F', + NPY_CDOUBLELTR = 'D', + NPY_CLONGDOUBLELTR = 'G', + NPY_OBJECTLTR = 'O', + NPY_STRINGLTR = 'S', + NPY_STRINGLTR2 = 'a', + NPY_UNICODELTR = 'U', + NPY_VOIDLTR = 'V', + NPY_CHARLTR = 'c', - /* No Descriptor, just a define -- this let's - Python users specify an array of integers - large enough to hold a pointer on the platform*/ - NPY_INTPLTR = 'p', - NPY_UINTPLTR = 'P', + /* No Descriptor, just a define -- this let's + Python users specify an array of integers + large enough to hold a pointer on the platform*/ + NPY_INTPLTR = 'p', + NPY_UINTPLTR = 'P', - NPY_GENBOOLLTR ='b', - NPY_SIGNEDLTR = 'i', - NPY_UNSIGNEDLTR = 'u', - NPY_FLOATINGLTR = 'f', - NPY_COMPLEXLTR = 'c' + NPY_GENBOOLLTR ='b', + NPY_SIGNEDLTR = 'i', + NPY_UNSIGNEDLTR = 'u', + NPY_FLOATINGLTR = 'f', + NPY_COMPLEXLTR = 'c' }; typedef enum { - NPY_QUICKSORT=0, - NPY_HEAPSORT=1, - NPY_MERGESORT=2, + NPY_QUICKSORT=0, + NPY_HEAPSORT=1, + NPY_MERGESORT=2, } NPY_SORTKIND; #define NPY_NSORTS NPY_MERGESORT + 1 typedef enum { - NPY_NOSCALAR=-1, - NPY_BOOL_SCALAR, - NPY_INTPOS_SCALAR, - NPY_INTNEG_SCALAR, - NPY_FLOAT_SCALAR, - NPY_COMPLEX_SCALAR, - NPY_OBJECT_SCALAR, + NPY_NOSCALAR=-1, + NPY_BOOL_SCALAR, + NPY_INTPOS_SCALAR, + NPY_INTNEG_SCALAR, + NPY_FLOAT_SCALAR, + NPY_COMPLEX_SCALAR, + NPY_OBJECT_SCALAR, } NPY_SCALARKIND; #define NPY_NSCALARKINDS NPY_OBJECT_SCALAR+1 @@ -206,7 +206,7 @@ NPY_RAISE=2 } NPY_CLIPMODE; - /* Define bit-width array types and typedefs */ + /* Define bit-width array types and typedefs */ #define NPY_MAX_INT8 127 #define NPY_MIN_INT8 -128 @@ -227,21 +227,21 @@ #define NPY_MIN_INT256 (-NPY_MAX_INT256 - NPY_LONGLONG_SUFFIX(1)) #define NPY_MAX_UINT256 NPY_ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935) - /* Need to find the number of bits for each type and - make definitions accordingly. + /* Need to find the number of bits for each type and + make definitions accordingly. - C states that sizeof(char) == 1 by definition + C states that sizeof(char) == 1 by definition - So, just using the sizeof keyword won't help. + So, just using the sizeof keyword won't help. - It also looks like Python itself uses sizeof(char) quite a - bit, which by definition should be 1 all the time. + It also looks like Python itself uses sizeof(char) quite a + bit, which by definition should be 1 all the time. - Idea: Make Use of CHAR_BIT which should tell us how many - BITS per CHARACTER - */ + Idea: Make Use of CHAR_BIT which should tell us how many + BITS per CHARACTER + */ - /* Include platform definitions -- These are in the C89/90 standard */ + /* Include platform definitions -- These are in the C89/90 standard */ #include #define NPY_MAX_BYTE SCHAR_MAX #define NPY_MIN_BYTE SCHAR_MIN @@ -280,37 +280,37 @@ #if NPY_BITSOF_LONG == 8 #define NPY_INT8 NPY_LONG #define NPY_UINT8 NPY_ULONG - typedef long npy_int8; - typedef unsigned long npy_uint8; + typedef long npy_int8; + typedef unsigned long npy_uint8; #elif NPY_BITSOF_LONG == 16 #define NPY_INT16 NPY_LONG #define NPY_UINT16 NPY_ULONG - typedef long npy_int16; - typedef unsigned long npy_uint16; + typedef long npy_int16; + typedef unsigned long npy_uint16; #elif NPY_BITSOF_LONG == 32 #define NPY_INT32 NPY_LONG #define NPY_UINT32 NPY_ULONG - typedef long npy_int32; - typedef unsigned long npy_uint32; - typedef unsigned long npy_ucs4; + typedef long npy_int32; + typedef unsigned long npy_uint32; + typedef unsigned long npy_ucs4; #elif NPY_BITSOF_LONG == 64 #define NPY_INT64 NPY_LONG #define NPY_UINT64 NPY_ULONG - typedef long npy_int64; - typedef unsigned long npy_uint64; + typedef long npy_int64; + typedef unsigned long npy_uint64; #elif NPY_BITSOF_LONG == 128 #define NPY_INT128 NPY_LONG #define NPY_UINT128 NPY_ULONG - typedef long npy_int128; - typedef unsigned long npy_uint128; + typedef long npy_int128; + typedef unsigned long npy_uint128; #endif #if NPY_BITSOF_LONGLONG == 8 # ifndef NPY_INT8 # define NPY_INT8 NPY_LONGLONG # define NPY_UINT8 NPY_ULONGLONG - typedef npy_longlong npy_int8; - typedef npy_ulonglong npy_uint8; + typedef npy_longlong npy_int8; + typedef npy_ulonglong npy_uint8; # endif # define NPY_MAX_LONGLONG NPY_MAX_INT8 # define NPY_MIN_LONGLONG NPY_MIN_INT8 @@ -319,8 +319,8 @@ # ifndef NPY_INT16 # define NPY_INT16 NPY_LONGLONG # define NPY_UINT16 NPY_ULONGLONG - typedef npy_longlong npy_int16; - typedef npy_ulonglong npy_uint16; + typedef npy_longlong npy_int16; + typedef npy_ulonglong npy_uint16; # endif # define NPY_MAX_LONGLONG NPY_MAX_INT16 # define NPY_MIN_LONGLONG NPY_MIN_INT16 @@ -329,9 +329,9 @@ # ifndef NPY_INT32 # define NPY_INT32 NPY_LONGLONG # define NPY_UINT32 NPY_ULONGLONG - typedef npy_longlong npy_int32; - typedef npy_ulonglong npy_uint32; - typedef npy_ulonglong npy_ucs4; + typedef npy_longlong npy_int32; + typedef npy_ulonglong npy_uint32; + typedef npy_ulonglong npy_ucs4; # endif # define NPY_MAX_LONGLONG NPY_MAX_INT32 # define NPY_MIN_LONGLONG NPY_MIN_INT32 @@ -340,8 +340,8 @@ # ifndef NPY_INT64 # define NPY_INT64 NPY_LONGLONG # define NPY_UINT64 NPY_ULONGLONG - typedef npy_longlong npy_int64; - typedef npy_ulonglong npy_uint64; + typedef npy_longlong npy_int64; + typedef npy_ulonglong npy_uint64; # endif # define NPY_MAX_LONGLONG NPY_MAX_INT64 # define NPY_MIN_LONGLONG NPY_MIN_INT64 @@ -350,8 +350,8 @@ # ifndef NPY_INT128 # define NPY_INT128 NPY_LONGLONG # define NPY_UINT128 NPY_ULONGLONG - typedef npy_longlong npy_int128; - typedef npy_ulonglong npy_uint128; + typedef npy_longlong npy_int128; + typedef npy_ulonglong npy_uint128; # endif # define NPY_MAX_LONGLONG NPY_MAX_INT128 # define NPY_MIN_LONGLONG NPY_MIN_INT128 @@ -359,8 +359,8 @@ #elif NPY_BITSOF_LONGLONG == 256 # define NPY_INT256 NPY_LONGLONG # define NPY_UINT256 NPY_ULONGLONG - typedef npy_longlong npy_int256; - typedef npy_ulonglong npy_uint256; + typedef npy_longlong npy_int256; + typedef npy_ulonglong npy_uint256; # define NPY_MAX_LONGLONG NPY_MAX_INT256 # define NPY_MIN_LONGLONG NPY_MIN_INT256 # define NPY_MAX_ULONGLONG NPY_MAX_UINT256 @@ -370,37 +370,37 @@ #ifndef NPY_INT8 #define NPY_INT8 NPY_INT #define NPY_UINT8 NPY_UINT - typedef int npy_int8; - typedef unsigned int npy_uint8; + typedef int npy_int8; + typedef unsigned int npy_uint8; #endif #elif NPY_BITSOF_INT == 16 #ifndef NPY_INT16 #define NPY_INT16 NPY_INT #define NPY_UINT16 NPY_UINT - typedef int npy_int16; - typedef unsigned int npy_uint16; + typedef int npy_int16; + typedef unsigned int npy_uint16; #endif #elif NPY_BITSOF_INT == 32 #ifndef NPY_INT32 #define NPY_INT32 NPY_INT #define NPY_UINT32 NPY_UINT - typedef int npy_int32; - typedef unsigned int npy_uint32; + typedef int npy_int32; + typedef unsigned int npy_uint32; typedef unsigned int npy_ucs4; #endif #elif NPY_BITSOF_INT == 64 #ifndef NPY_INT64 #define NPY_INT64 NPY_INT #define NPY_UINT64 NPY_UINT - typedef int npy_int64; - typedef unsigned int npy_uint64; + typedef int npy_int64; + typedef unsigned int npy_uint64; #endif #elif NPY_BITSOF_INT == 128 #ifndef NPY_INT128 #define NPY_INT128 NPY_INT #define NPY_UINT128 NPY_UINT - typedef int npy_int128; - typedef unsigned int npy_uint128; + typedef int npy_int128; + typedef unsigned int npy_uint128; #endif #endif @@ -408,37 +408,37 @@ #ifndef NPY_INT8 #define NPY_INT8 NPY_SHORT #define NPY_UINT8 NPY_USHORT - typedef short npy_int8; - typedef unsigned short npy_uint8; + typedef short npy_int8; + typedef unsigned short npy_uint8; #endif #elif NPY_BITSOF_SHORT == 16 #ifndef NPY_INT16 #define NPY_INT16 NPY_SHORT #define NPY_UINT16 NPY_USHORT - typedef short npy_int16; - typedef unsigned short npy_uint16; + typedef short npy_int16; + typedef unsigned short npy_uint16; #endif #elif NPY_BITSOF_SHORT == 32 #ifndef NPY_INT32 #define NPY_INT32 NPY_SHORT #define NPY_UINT32 NPY_USHORT - typedef short npy_int32; - typedef unsigned short npy_uint32; - typedef unsigned short npy_ucs4; + typedef short npy_int32; + typedef unsigned short npy_uint32; + typedef unsigned short npy_ucs4; #endif #elif NPY_BITSOF_SHORT == 64 #ifndef NPY_INT64 #define NPY_INT64 NPY_SHORT #define NPY_UINT64 NPY_USHORT - typedef short npy_int64; - typedef unsigned short npy_uint64; + typedef short npy_int64; + typedef unsigned short npy_uint64; #endif #elif NPY_BITSOF_SHORT == 128 #ifndef NPY_INT128 #define NPY_INT128 NPY_SHORT #define NPY_UINT128 NPY_USHORT - typedef short npy_int128; - typedef unsigned short npy_uint128; + typedef short npy_int128; + typedef unsigned short npy_uint128; #endif #endif @@ -447,37 +447,37 @@ #ifndef NPY_INT8 #define NPY_INT8 NPY_BYTE #define NPY_UINT8 NPY_UBYTE - typedef signed char npy_int8; - typedef unsigned char npy_uint8; + typedef signed char npy_int8; + typedef unsigned char npy_uint8; #endif #elif NPY_BITSOF_CHAR == 16 #ifndef NPY_INT16 #define NPY_INT16 NPY_BYTE #define NPY_UINT16 NPY_UBYTE - typedef signed char npy_int16; - typedef unsigned char npy_uint16; + typedef signed char npy_int16; + typedef unsigned char npy_uint16; #endif #elif NPY_BITSOF_CHAR == 32 #ifndef NPY_INT32 #define NPY_INT32 NPY_BYTE #define NPY_UINT32 NPY_UBYTE - typedef signed char npy_int32; - typedef unsigned char npy_uint32; - typedef unsigned char npy_ucs4; + typedef signed char npy_int32; + typedef unsigned char npy_uint32; + typedef unsigned char npy_ucs4; #endif #elif NPY_BITSOF_CHAR == 64 #ifndef NPY_INT64 #define NPY_INT64 NPY_BYTE #define NPY_UINT64 NPY_UBYTE - typedef signed char npy_int64; - typedef unsigned char npy_uint64; + typedef signed char npy_int64; + typedef unsigned char npy_uint64; #endif #elif NPY_BITSOF_CHAR == 128 #ifndef NPY_INT128 #define NPY_INT128 NPY_BYTE #define NPY_UINT128 NPY_UBYTE - typedef signed char npy_int128; - typedef unsigned char npy_uint128; + typedef signed char npy_int128; + typedef unsigned char npy_uint128; #endif #endif @@ -487,43 +487,43 @@ #ifndef NPY_FLOAT16 #define NPY_FLOAT16 NPY_DOUBLE #define NPY_COMPLEX32 NPY_CDOUBLE - typedef double npy_float16; - typedef npy_cdouble npy_complex32; + typedef double npy_float16; + typedef npy_cdouble npy_complex32; #endif #elif NPY_BITSOF_DOUBLE == 32 #ifndef NPY_FLOAT32 #define NPY_FLOAT32 NPY_DOUBLE #define NPY_COMPLEX64 NPY_CDOUBLE - typedef double npy_float32; - typedef npy_cdouble npy_complex64; + typedef double npy_float32; + typedef npy_cdouble npy_complex64; #endif #elif NPY_BITSOF_DOUBLE == 64 #ifndef NPY_FLOAT64 #define NPY_FLOAT64 NPY_DOUBLE #define NPY_COMPLEX128 NPY_CDOUBLE - typedef double npy_float64; - typedef npy_cdouble npy_complex128; + typedef double npy_float64; + typedef npy_cdouble npy_complex128; #endif #elif NPY_BITSOF_DOUBLE == 80 #ifndef NPY_FLOAT80 #define NPY_FLOAT80 NPY_DOUBLE #define NPY_COMPLEX160 NPY_CDOUBLE - typedef double npy_float80; - typedef npy_cdouble npy_complex160; + typedef double npy_float80; + typedef npy_cdouble npy_complex160; #endif #elif NPY_BITSOF_DOUBLE == 96 #ifndef NPY_FLOAT96 #define NPY_FLOAT96 NPY_DOUBLE #define NPY_COMPLEX192 NPY_CDOUBLE - typedef double npy_float96; - typedef npy_cdouble npy_complex192; + typedef double npy_float96; + typedef npy_cdouble npy_complex192; #endif #elif NPY_BITSOF_DOUBLE == 128 #ifndef NPY_FLOAT128 #define NPY_FLOAT128 NPY_DOUBLE #define NPY_COMPLEX256 NPY_CDOUBLE - typedef double npy_float128; - typedef npy_cdouble npy_complex256; + typedef double npy_float128; + typedef npy_cdouble npy_complex256; #endif #endif @@ -533,43 +533,43 @@ #ifndef NPY_FLOAT16 #define NPY_FLOAT16 NPY_FLOAT #define NPY_COMPLEX32 NPY_CFLOAT - typedef float npy_float16; - typedef npy_cfloat npy_complex32; + typedef float npy_float16; + typedef npy_cfloat npy_complex32; #endif #elif NPY_BITSOF_FLOAT == 32 #ifndef NPY_FLOAT32 #define NPY_FLOAT32 NPY_FLOAT #define NPY_COMPLEX64 NPY_CFLOAT - typedef float npy_float32; - typedef npy_cfloat npy_complex64; + typedef float npy_float32; + typedef npy_cfloat npy_complex64; #endif #elif NPY_BITSOF_FLOAT == 64 #ifndef NPY_FLOAT64 #define NPY_FLOAT64 NPY_FLOAT #define NPY_COMPLEX128 NPY_CFLOAT - typedef float npy_float64; - typedef npy_cfloat npy_complex128; + typedef float npy_float64; + typedef npy_cfloat npy_complex128; #endif #elif NPY_BITSOF_FLOAT == 80 #ifndef NPY_FLOAT80 #define NPY_FLOAT80 NPY_FLOAT #define NPY_COMPLEX160 NPY_CFLOAT - typedef float npy_float80; - typedef npy_cfloat npy_complex160; + typedef float npy_float80; + typedef npy_cfloat npy_complex160; #endif #elif NPY_BITSOF_FLOAT == 96 #ifndef NPY_FLOAT96 #define NPY_FLOAT96 NPY_FLOAT #define NPY_COMPLEX192 NPY_CFLOAT - typedef float npy_float96; - typedef npy_cfloat npy_complex192; + typedef float npy_float96; + typedef npy_cfloat npy_complex192; #endif #elif NPY_BITSOF_FLOAT == 128 #ifndef NPY_FLOAT128 #define NPY_FLOAT128 NPY_FLOAT #define NPY_COMPLEX256 NPY_CFLOAT - typedef float npy_float128; - typedef npy_cfloat npy_complex256; + typedef float npy_float128; + typedef npy_cfloat npy_complex256; #endif #endif @@ -578,52 +578,52 @@ #ifndef NPY_FLOAT16 #define NPY_FLOAT16 NPY_LONGDOUBLE #define NPY_COMPLEX32 NPY_CLONGDOUBLE - typedef npy_longdouble npy_float16; - typedef npy_clongdouble npy_complex32; + typedef npy_longdouble npy_float16; + typedef npy_clongdouble npy_complex32; #endif #elif NPY_BITSOF_LONGDOUBLE == 32 #ifndef NPY_FLOAT32 #define NPY_FLOAT32 NPY_LONGDOUBLE #define NPY_COMPLEX64 NPY_CLONGDOUBLE - typedef npy_longdouble npy_float32; - typedef npy_clongdouble npy_complex64; + typedef npy_longdouble npy_float32; + typedef npy_clongdouble npy_complex64; #endif #elif NPY_BITSOF_LONGDOUBLE == 64 #ifndef NPY_FLOAT64 #define NPY_FLOAT64 NPY_LONGDOUBLE #define NPY_COMPLEX128 NPY_CLONGDOUBLE - typedef npy_longdouble npy_float64; - typedef npy_clongdouble npy_complex128; + typedef npy_longdouble npy_float64; + typedef npy_clongdouble npy_complex128; #endif #elif NPY_BITSOF_LONGDOUBLE == 80 #ifndef NPY_FLOAT80 #define NPY_FLOAT80 NPY_LONGDOUBLE #define NPY_COMPLEX160 NPY_CLONGDOUBLE - typedef npy_longdouble npy_float80; - typedef npy_clongdouble npy_complex160; + typedef npy_longdouble npy_float80; + typedef npy_clongdouble npy_complex160; #endif #elif NPY_BITSOF_LONGDOUBLE == 96 #ifndef NPY_FLOAT96 #define NPY_FLOAT96 NPY_LONGDOUBLE #define NPY_COMPLEX192 NPY_CLONGDOUBLE - typedef npy_longdouble npy_float96; - typedef npy_clongdouble npy_complex192; + typedef npy_longdouble npy_float96; + typedef npy_clongdouble npy_complex192; #endif #elif NPY_BITSOF_LONGDOUBLE == 128 #ifndef NPY_FLOAT128 #define NPY_FLOAT128 NPY_LONGDOUBLE #define NPY_COMPLEX256 NPY_CLONGDOUBLE - typedef npy_longdouble npy_float128; - typedef npy_clongdouble npy_complex256; + typedef npy_longdouble npy_float128; + typedef npy_clongdouble npy_complex256; #endif #elif NPY_BITSOF_LONGDOUBLE == 256 #define NPY_FLOAT256 NPY_LONGDOUBLE #define NPY_COMPLEX512 NPY_CLONGDOUBLE - typedef npy_longdouble npy_float256; - typedef npy_clongdouble npy_complex512; + typedef npy_longdouble npy_float256; + typedef npy_clongdouble npy_complex512; #endif - /* End of typedefs for numarray style bit-width names */ + /* End of typedefs for numarray style bit-width names */ /* This is to typedef npy_intp to the appropriate pointer size for this platform. * Py_intptr_t, Py_uintptr_t are defined in pyport.h. */ @@ -644,31 +644,31 @@ #endif #if SIZEOF_PY_INTPTR_T == SIZEOF_INT - #define NPY_INTP NPY_INT - #define NPY_UINTP NPY_UINT + #define NPY_INTP NPY_INT + #define NPY_UINTP NPY_UINT #define PyIntpArrType_Type PyIntArrType_Type #define PyUIntpArrType_Type PyUIntArrType_Type - #define NPY_MAX_INTP NPY_MAX_INT - #define NPY_MIN_INTP NPY_MIN_INT - #define NPY_MAX_UINTP NPY_MAX_UINT + #define NPY_MAX_INTP NPY_MAX_INT + #define NPY_MIN_INTP NPY_MIN_INT + #define NPY_MAX_UINTP NPY_MAX_UINT #define NPY_INTP_FMT "d" #elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG - #define NPY_INTP NPY_LONG - #define NPY_UINTP NPY_ULONG + #define NPY_INTP NPY_LONG + #define NPY_UINTP NPY_ULONG #define PyIntpArrType_Type PyLongArrType_Type #define PyUIntpArrType_Type PyULongArrType_Type - #define NPY_MAX_INTP NPY_MAX_LONG - #define NPY_MIN_INTP MIN_LONG - #define NPY_MAX_UINTP NPY_MAX_ULONG + #define NPY_MAX_INTP NPY_MAX_LONG + #define NPY_MIN_INTP MIN_LONG + #define NPY_MAX_UINTP NPY_MAX_ULONG #define NPY_INTP_FMT "ld" #elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG) - #define NPY_INTP NPY_LONGLONG - #define NPY_UINTP NPY_ULONGLONG + #define NPY_INTP NPY_LONGLONG + #define NPY_UINTP NPY_ULONGLONG #define PyIntpArrType_Type PyLongLongArrType_Type #define PyUIntpArrType_Type PyULongLongArrType_Type - #define NPY_MAX_INTP NPY_MAX_LONGLONG - #define NPY_MIN_INTP NPY_MIN_LONGLONG - #define NPY_MAX_UINTP NPY_MAX_ULONGLONG + #define NPY_MAX_INTP NPY_MAX_LONGLONG + #define NPY_MIN_INTP NPY_MIN_LONGLONG + #define NPY_MAX_UINTP NPY_MAX_ULONGLONG #define NPY_INTP_FMT "Ld" #endif @@ -720,7 +720,7 @@ typedef int (PyArray_CompareFunc)(const void *, const void *, void *); typedef int (PyArray_ArgFunc)(void*, npy_intp, npy_intp*, void *); typedef void (PyArray_DotFunc)(void *, npy_intp, void *, npy_intp, void *, npy_intp, - void *); + void *); typedef void (PyArray_VectorUnaryFunc)(void *, void *, npy_intp, void *, void *); typedef int (PyArray_ScanFunc)(FILE *, void *, void *, void *); typedef int (PyArray_FromStrFunc)(char *, void *, char **, void *); @@ -740,116 +740,116 @@ } PyArray_Dims; typedef struct { - /* Functions to cast to all other standard types*/ - /* Can have some NULL entries */ - PyArray_VectorUnaryFunc *cast[NPY_NTYPES]; + /* Functions to cast to all other standard types*/ + /* Can have some NULL entries */ + PyArray_VectorUnaryFunc *cast[NPY_NTYPES]; - /* The next four functions *cannot* be NULL */ + /* The next four functions *cannot* be NULL */ - /* Functions to get and set items with standard - Python types -- not array scalars */ - PyArray_GetItemFunc *getitem; - PyArray_SetItemFunc *setitem; + /* Functions to get and set items with standard + Python types -- not array scalars */ + PyArray_GetItemFunc *getitem; + PyArray_SetItemFunc *setitem; - /* Copy and/or swap data. Memory areas may not overlap */ - /* Use memmove first if they might */ - PyArray_CopySwapNFunc *copyswapn; + /* Copy and/or swap data. Memory areas may not overlap */ + /* Use memmove first if they might */ + PyArray_CopySwapNFunc *copyswapn; PyArray_CopySwapFunc *copyswap; - /* Function to compare items */ - /* Can be NULL - */ - PyArray_CompareFunc *compare; + /* Function to compare items */ + /* Can be NULL + */ + PyArray_CompareFunc *compare; - /* Function to select largest - Can be NULL - */ - PyArray_ArgFunc *argmax; + /* Function to select largest + Can be NULL + */ + PyArray_ArgFunc *argmax; - /* Function to compute dot product */ - /* Can be NULL */ - PyArray_DotFunc *dotfunc; + /* Function to compute dot product */ + /* Can be NULL */ + PyArray_DotFunc *dotfunc; - /* Function to scan an ASCII file and - place a single value plus possible separator - Can be NULL - */ - PyArray_ScanFunc *scanfunc; + /* Function to scan an ASCII file and + place a single value plus possible separator + Can be NULL + */ + PyArray_ScanFunc *scanfunc; - /* Function to read a single value from a string */ - /* and adjust the pointer; Can be NULL */ - PyArray_FromStrFunc *fromstr; + /* Function to read a single value from a string */ + /* and adjust the pointer; Can be NULL */ + PyArray_FromStrFunc *fromstr; - /* Function to determine if data is zero or not */ - /* If NULL a default version is */ - /* used at Registration time. */ - PyArray_NonzeroFunc *nonzero; + /* Function to determine if data is zero or not */ + /* If NULL a default version is */ + /* used at Registration time. */ + PyArray_NonzeroFunc *nonzero; - /* Used for arange. Can be NULL.*/ - PyArray_FillFunc *fill; + /* Used for arange. Can be NULL.*/ + PyArray_FillFunc *fill; - /* Function to fill arrays with scalar values - Can be NULL*/ - PyArray_FillWithScalarFunc *fillwithscalar; + /* Function to fill arrays with scalar values + Can be NULL*/ + PyArray_FillWithScalarFunc *fillwithscalar; - /* Sorting functions; Can be NULL*/ - PyArray_SortFunc *sort[NPY_NSORTS]; - PyArray_ArgSortFunc *argsort[NPY_NSORTS]; + /* Sorting functions; Can be NULL*/ + PyArray_SortFunc *sort[NPY_NSORTS]; + PyArray_ArgSortFunc *argsort[NPY_NSORTS]; - /* Dictionary of additional casting functions - PyArray_VectorUnaryFuncs - which can be populated to support casting - to other registered types. Can be NULL*/ - PyObject *castdict; + /* Dictionary of additional casting functions + PyArray_VectorUnaryFuncs + which can be populated to support casting + to other registered types. Can be NULL*/ + PyObject *castdict; - /* Functions useful for generalizing - the casting rules. Can be NULL; - */ - PyArray_ScalarKindFunc *scalarkind; - int **cancastscalarkindto; - int *cancastto; + /* Functions useful for generalizing + the casting rules. Can be NULL; + */ + PyArray_ScalarKindFunc *scalarkind; + int **cancastscalarkindto; + int *cancastto; - /* Set to 1 if you want pickles of this type - to go out as lists of _getitem objects - */ - int listpickle; + /* Set to 1 if you want pickles of this type + to go out as lists of _getitem objects + */ + int listpickle; } PyArray_ArrFuncs; typedef struct { - PyObject_HEAD - PyTypeObject *typeobj; /* the type object representing an - instance of this type -- should not - be two type_numbers with the same type - object. */ - char kind; /* kind for this type */ - char type; /* unique-character representing this type */ - char byteorder; /* '>' (big), '<' (little), '|' - (not-applicable), or '=' (native). */ + PyObject_HEAD + PyTypeObject *typeobj; /* the type object representing an + instance of this type -- should not + be two type_numbers with the same type + object. */ + char kind; /* kind for this type */ + char type; /* unique-character representing this type */ + char byteorder; /* '>' (big), '<' (little), '|' + (not-applicable), or '=' (native). */ char hasobject; /* non-zero if it has object arrays in fields */ - int type_num; /* number representing this type */ - int elsize; /* element size for this type */ - int alignment; /* alignment needed for this type */ - struct _arr_descr \ - *subarray; /* Non-NULL if this type is - is an array (C-contiguous) - of some other type - */ - PyObject *fields; /* The fields dictionary for this type */ - /* For statically defined descr this - is always Py_None */ + int type_num; /* number representing this type */ + int elsize; /* element size for this type */ + int alignment; /* alignment needed for this type */ + struct _arr_descr \ + *subarray; /* Non-NULL if this type is + is an array (C-contiguous) + of some other type + */ + PyObject *fields; /* The fields dictionary for this type */ + /* For statically defined descr this + is always Py_None */ PyObject *names; /* An ordered tuple of field names or NULL if no fields are defined */ - PyArray_ArrFuncs *f; /* a table of functions specific for each - basic data descriptor */ + PyArray_ArrFuncs *f; /* a table of functions specific for each + basic data descriptor */ } PyArray_Descr; typedef struct _arr_descr { - PyArray_Descr *base; - PyObject *shape; /* a tuple */ + PyArray_Descr *base; + PyObject *shape; /* a tuple */ } PyArray_ArrayDescr; /* @@ -859,23 +859,23 @@ */ typedef struct PyArrayObject { - PyObject_HEAD - char *data; /* pointer to raw data buffer */ - int nd; /* number of dimensions, also called ndim */ - npy_intp *dimensions; /* size in each dimension */ + PyObject_HEAD + char *data; /* pointer to raw data buffer */ + int nd; /* number of dimensions, also called ndim */ + npy_intp *dimensions; /* size in each dimension */ npy_intp *strides; /* bytes to jump to get to the - next element in each dimension */ - PyObject *base; /* This object should be decref'd - upon deletion of array */ - /* For views it points to the original array */ - /* For creation from buffer object it points - to an object that shold be decref'd on - deletion */ - /* For UPDATEIFCOPY flag this is an array - to-be-updated upon deletion of this one */ - PyArray_Descr *descr; /* Pointer to type structure */ - int flags; /* Flags describing array -- see below*/ - PyObject *weakreflist; /* For weakreferences */ + next element in each dimension */ + PyObject *base; /* This object should be decref'd + upon deletion of array */ + /* For views it points to the original array */ + /* For creation from buffer object it points + to an object that shold be decref'd on + deletion */ + /* For UPDATEIFCOPY flag this is an array + to-be-updated upon deletion of this one */ + PyArray_Descr *descr; /* Pointer to type structure */ + int flags; /* Flags describing array -- see below*/ + PyObject *weakreflist; /* For weakreferences */ } PyArrayObject; #define NPY_AO PyArrayObject @@ -983,7 +983,7 @@ #define PyArray_CHKFLAGS(m, FLAGS) \ - ((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS)) + ((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS)) #define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, NPY_CONTIGUOUS) #define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, NPY_WRITEABLE) #define PyArray_ISALIGNED(m) PyArray_CHKFLAGS(m, NPY_ALIGNED) @@ -1009,21 +1009,21 @@ #define NPY_BEGIN_THREADS_DESCR(dtype) #define NPY_END_THREADS_DESCR(dtype) #define NPY_ALLOW_C_API_DEF -#define NPY_ALLOW_C_API -#define NPY_DISABLE_C_API +#define NPY_ALLOW_C_API +#define NPY_DISABLE_C_API #endif typedef struct { PyObject_HEAD - int nd_m1; /* number of dimensions - 1 */ - npy_intp index, size; - npy_intp coordinates[NPY_MAXDIMS];/* N-dimensional loop */ + int nd_m1; /* number of dimensions - 1 */ + npy_intp index, size; + npy_intp coordinates[NPY_MAXDIMS];/* N-dimensional loop */ npy_intp dims_m1[NPY_MAXDIMS]; /* ao->dimensions - 1 */ - npy_intp strides[NPY_MAXDIMS]; /* ao->strides or fake */ - npy_intp backstrides[NPY_MAXDIMS];/* how far to jump back */ - npy_intp factors[NPY_MAXDIMS]; /* shape factors */ - PyArrayObject *ao; - char *dataptr; /* pointer to current item*/ + npy_intp strides[NPY_MAXDIMS]; /* ao->strides or fake */ + npy_intp backstrides[NPY_MAXDIMS];/* how far to jump back */ + npy_intp factors[NPY_MAXDIMS]; /* shape factors */ + PyArrayObject *ao; + char *dataptr; /* pointer to current item*/ npy_bool contiguous; } PyArrayIterObject; @@ -1031,93 +1031,93 @@ /* Iterator API */ #define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type) -#define PyArray_ITER_RESET(it) { \ +#define PyArray_ITER_RESET(it) { \ (it)->index = 0; \ - (it)->dataptr = (it)->ao->data; \ - memset((it)->coordinates, 0, ((it)->nd_m1+1)*sizeof(npy_intp)); \ + (it)->dataptr = (it)->ao->data; \ + memset((it)->coordinates, 0, ((it)->nd_m1+1)*sizeof(npy_intp)); \ } -#define _PyArray_ITER_NEXT1(it) { \ - (it)->dataptr += (it)->strides[0]; \ - (it)->coordinates[0]++; \ - } +#define _PyArray_ITER_NEXT1(it) { \ + (it)->dataptr += (it)->strides[0]; \ + (it)->coordinates[0]++; \ + } -#define _PyArray_ITER_NEXT2(it) { \ - if ((it)->coordinates[1] < (it)->dims_m1[1]) { \ - (it)->coordinates[1]++; \ - (it)->dataptr += (it)->strides[1]; \ - } \ - else { \ - (it)->coordinates[1] = 0; \ - (it)->coordinates[0]++; \ - (it)->dataptr += (it)->strides[0] - \ - (it)->backstrides[1]; \ - } \ - } +#define _PyArray_ITER_NEXT2(it) { \ + if ((it)->coordinates[1] < (it)->dims_m1[1]) { \ + (it)->coordinates[1]++; \ + (it)->dataptr += (it)->strides[1]; \ + } \ + else { \ + (it)->coordinates[1] = 0; \ + (it)->coordinates[0]++; \ + (it)->dataptr += (it)->strides[0] - \ + (it)->backstrides[1]; \ + } \ + } -#define PyArray_ITER_NEXT(it) { \ +#define PyArray_ITER_NEXT(it) { \ (it)->index++; \ - if ((it)->nd_m1 == 0) { \ - _PyArray_ITER_NEXT1(it); \ - } \ - else if ((it)->contiguous) (it)->dataptr += (it)->ao->descr->elsize; \ - else if ((it)->nd_m1 == 1) { \ - _PyArray_ITER_NEXT2(it); \ - } \ - else { \ - int __npy_i; \ - for (__npy_i = (it)->nd_m1; __npy_i >= 0; __npy_i--) { \ - if ((it)->coordinates[__npy_i] < \ - (it)->dims_m1[__npy_i]) { \ - (it)->coordinates[__npy_i]++; \ - (it)->dataptr += (it)->strides[__npy_i]; \ - break; \ - } \ - else { \ - (it)->coordinates[__npy_i] = 0; \ - (it)->dataptr -= (it)->backstrides[__npy_i]; \ - } \ - } \ - } \ + if ((it)->nd_m1 == 0) { \ + _PyArray_ITER_NEXT1(it); \ + } \ + else if ((it)->contiguous) (it)->dataptr += (it)->ao->descr->elsize; \ + else if ((it)->nd_m1 == 1) { \ + _PyArray_ITER_NEXT2(it); \ + } \ + else { \ + int __npy_i; \ + for (__npy_i = (it)->nd_m1; __npy_i >= 0; __npy_i--) { \ + if ((it)->coordinates[__npy_i] < \ + (it)->dims_m1[__npy_i]) { \ + (it)->coordinates[__npy_i]++; \ + (it)->dataptr += (it)->strides[__npy_i]; \ + break; \ + } \ + else { \ + (it)->coordinates[__npy_i] = 0; \ + (it)->dataptr -= (it)->backstrides[__npy_i]; \ + } \ + } \ + } \ } -#define PyArray_ITER_GOTO(it, destination) { \ - int __npy_i; \ - (it)->index = 0; \ - (it)->dataptr = (it)->ao->data; \ - for (__npy_i = (it)->nd_m1; __npy_i>=0; __npy_i--) { \ +#define PyArray_ITER_GOTO(it, destination) { \ + int __npy_i; \ + (it)->index = 0; \ + (it)->dataptr = (it)->ao->data; \ + for (__npy_i = (it)->nd_m1; __npy_i>=0; __npy_i--) { \ if (destination[__npy_i] < 0) { \ destination[__npy_i] += (it)->dims_m1[__npy_i]+1; \ } \ - (it)->dataptr += destination[__npy_i] * \ - (it)->strides[__npy_i]; \ - (it)->coordinates[__npy_i] = destination[__npy_i]; \ - (it)->index += destination[__npy_i] * \ - ( __npy_i==(it)->nd_m1 ? 1 : \ - (it)->dims_m1[__npy_i+1]+1) ; \ - } \ - } + (it)->dataptr += destination[__npy_i] * \ + (it)->strides[__npy_i]; \ + (it)->coordinates[__npy_i] = destination[__npy_i]; \ + (it)->index += destination[__npy_i] * \ + ( __npy_i==(it)->nd_m1 ? 1 : \ + (it)->dims_m1[__npy_i+1]+1) ; \ + } \ + } #define PyArray_ITER_GOTO1D(it, ind) { \ - int __npy_i; \ - npy_intp __npy_ind = (npy_intp) (ind); \ + int __npy_i; \ + npy_intp __npy_ind = (npy_intp) (ind); \ if (__npy_ind < 0) __npy_ind += (it)->size; \ - (it)->index = __npy_ind; \ + (it)->index = __npy_ind; \ if ((it)->nd_m1 == 0) { \ (it)->dataptr = (it)->ao->data + __npy_ind * \ (it)->strides[0]; \ } \ else if ((it)->contiguous) \ - (it)->dataptr = (it)->ao->data + __npy_ind * \ - (it)->ao->descr->elsize; \ - else { \ - (it)->dataptr = (it)->ao->data; \ - for (__npy_i = 0; __npy_i<=(it)->nd_m1; __npy_i++) { \ - (it)->dataptr += (__npy_ind / (it)->factors[__npy_i]) \ - * (it)->strides[__npy_i]; \ - __npy_ind %= (it)->factors[__npy_i]; \ - } \ - } \ + (it)->dataptr = (it)->ao->data + __npy_ind * \ + (it)->ao->descr->elsize; \ + else { \ + (it)->dataptr = (it)->ao->data; \ + for (__npy_i = 0; __npy_i<=(it)->nd_m1; __npy_i++) { \ + (it)->dataptr += (__npy_ind / (it)->factors[__npy_i]) \ + * (it)->strides[__npy_i]; \ + __npy_ind %= (it)->factors[__npy_i]; \ + } \ + } \ } #define PyArray_ITER_DATA(it) ((PyArrayIterObject *)it)->dataptr @@ -1129,56 +1129,56 @@ */ typedef struct { - PyObject_HEAD - int numiter; /* number of iters */ - npy_intp size; /* broadcasted size */ - npy_intp index; /* current index */ - int nd; /* number of dims */ - npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */ - PyArrayIterObject *iters[NPY_MAXARGS]; /* iterators */ + PyObject_HEAD + int numiter; /* number of iters */ + npy_intp size; /* broadcasted size */ + npy_intp index; /* current index */ + int nd; /* number of dims */ + npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */ + PyArrayIterObject *iters[NPY_MAXARGS]; /* iterators */ } PyArrayMultiIterObject; -#define PyArray_MultiIter_RESET(multi) { \ - int __npy_mi; \ - PyArrayMultiIterObject *__npy_mul = (multi); \ - __npy_mul->index = 0; \ - for (__npy_mi = 0; __npy_mi < __npy_mul->numiter; __npy_mi++) { \ - PyArray_ITER_RESET(__npy_mul->iters[__npy_mi]); \ - } \ - } +#define PyArray_MultiIter_RESET(multi) { \ + int __npy_mi; \ + PyArrayMultiIterObject *__npy_mul = (multi); \ + __npy_mul->index = 0; \ + for (__npy_mi = 0; __npy_mi < __npy_mul->numiter; __npy_mi++) { \ + PyArray_ITER_RESET(__npy_mul->iters[__npy_mi]); \ + } \ + } -#define PyArray_MultiIter_NEXT(multi) { \ - int __npy_mi; \ - PyArrayMultiIterObject *__npy_mul = (multi); \ - __npy_mul->index += 1; \ - for (__npy_mi=0; __npy_mi<__npy_mul->numiter; __npy_mi++) { \ - PyArray_ITER_NEXT(__npy_mul->iters[__npy_mi]); \ - } \ - } +#define PyArray_MultiIter_NEXT(multi) { \ + int __npy_mi; \ + PyArrayMultiIterObject *__npy_mul = (multi); \ + __npy_mul->index += 1; \ + for (__npy_mi=0; __npy_mi<__npy_mul->numiter; __npy_mi++) { \ + PyArray_ITER_NEXT(__npy_mul->iters[__npy_mi]); \ + } \ + } -#define PyArray_MultiIter_GOTO(multi, dest) { \ - int __npy_mi; \ - PyArrayMultiIterObject *__npy_mul = (multi); \ - for (__npy_mi=0; __npy_mi<__npy_mul->numiter; __npy_mi++) { \ - PyArray_ITER_GOTO(__npy_mul->iters[__npy_mi], dest); \ - } \ - __npy_mul->index = __npy_mul->iters[0]->index; \ - } +#define PyArray_MultiIter_GOTO(multi, dest) { \ + int __npy_mi; \ + PyArrayMultiIterObject *__npy_mul = (multi); \ + for (__npy_mi=0; __npy_mi<__npy_mul->numiter; __npy_mi++) { \ + PyArray_ITER_GOTO(__npy_mul->iters[__npy_mi], dest); \ + } \ + __npy_mul->index = __npy_mul->iters[0]->index; \ + } -#define PyArray_MultiIter_GOTO1D(multi, ind) { \ - int __npy_mi; \ - PyArrayMultiIterObject *__npy_mul = (multi); \ - for (__npy_mi=0; __npy_mi<__npy_mul->numiter; __npy_mi++) { \ - PyArray_ITER_GOTO1D(__npy_mul->iters[__npy_mi], ind); \ - } \ - __npy_mul->index = __npy_mul->iters[0]->index; \ - } +#define PyArray_MultiIter_GOTO1D(multi, ind) { \ + int __npy_mi; \ + PyArrayMultiIterObject *__npy_mul = (multi); \ + for (__npy_mi=0; __npy_mi<__npy_mul->numiter; __npy_mi++) { \ + PyArray_ITER_GOTO1D(__npy_mul->iters[__npy_mi], ind); \ + } \ + __npy_mul->index = __npy_mul->iters[0]->index; \ + } #define PyArray_MultiIter_DATA(multi, i) \ - (((PyArrayMultiIterObject *)multi)->iters[i]->dataptr) + (((PyArrayMultiIterObject *)multi)->iters[i]->dataptr) #define PyArray_MultiIter_SIZE(multi) \ - ((PyArrayMultiIterObject *)multi)->size + ((PyArrayMultiIterObject *)multi)->size #define PyArray_MultiIter_NEXTi(multi, i) \ PyArray_ITER_NEXT(((PyArrayMultiIterObject *)multi)->iters[i]) @@ -1186,38 +1186,38 @@ /* Store the information needed for fancy-indexing over an array */ typedef struct { - PyObject_HEAD - /* Multi-iterator portion --- needs to be present in this order to - work with PyArray_Broadcast */ + PyObject_HEAD + /* Multi-iterator portion --- needs to be present in this order to + work with PyArray_Broadcast */ - int numiter; /* number of index-array - iterators */ - npy_intp size; /* size of broadcasted - result */ - npy_intp index; /* current index */ - int nd; /* number of dims */ - npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */ - PyArrayIterObject *iters[NPY_MAXDIMS]; /* index object - iterators */ - PyArrayIterObject *ait; /* flat Iterator for - underlying array */ + int numiter; /* number of index-array + iterators */ + npy_intp size; /* size of broadcasted + result */ + npy_intp index; /* current index */ + int nd; /* number of dims */ + npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */ + PyArrayIterObject *iters[NPY_MAXDIMS]; /* index object + iterators */ + PyArrayIterObject *ait; /* flat Iterator for + underlying array */ - /* flat iterator for subspace (when numiter < nd) */ - PyArrayIterObject *subspace; + /* flat iterator for subspace (when numiter < nd) */ + PyArrayIterObject *subspace; - /* if subspace iteration, then this is the array of - axes in the underlying array represented by the - index objects */ - int iteraxes[NPY_MAXDIMS]; - /* if subspace iteration, the these are the coordinates - to the start of the subspace. - */ - npy_intp bscoord[NPY_MAXDIMS]; + /* if subspace iteration, then this is the array of + axes in the underlying array represented by the + index objects */ + int iteraxes[NPY_MAXDIMS]; + /* if subspace iteration, the these are the coordinates + to the start of the subspace. + */ + npy_intp bscoord[NPY_MAXDIMS]; - PyObject *indexobj; /* creating obj */ - int view; - int consec; - char *dataptr; + PyObject *indexobj; /* creating obj */ + int view; + int consec; + char *dataptr; } PyArrayMapIterObject; @@ -1232,7 +1232,7 @@ #define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd) #define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || PyArray_CHKFLAGS(m, NPY_CONTIGUOUS) || \ - PyArray_CHKFLAGS(m, NPY_FORTRAN)) + PyArray_CHKFLAGS(m, NPY_FORTRAN)) #define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, NPY_FORTRAN) && (PyArray_NDIM(m) > 1)) #define PyArray_FORTRAN_IF(m) ((PyArray_CHKFLAGS(m, NPY_FORTRAN) ? NPY_FORTRAN : 0)) #define FORTRAN_IF PyArray_FORTRAN_IF @@ -1247,54 +1247,54 @@ #define PyArray_FLAGS(obj) (((PyArrayObject *)(obj))->flags) #define PyArray_ITEMSIZE(obj) (((PyArrayObject *)(obj))->descr->elsize) #define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num) -#define PyArray_GETITEM(obj,itemptr) \ - ((PyArrayObject *)(obj))->descr->f->getitem((char *)itemptr, \ - (PyArrayObject *)obj); -#define PyArray_SETITEM(obj,itemptr,v) \ - ((PyArrayObject *)(obj))->descr->f->setitem((PyObject *)v, \ - (char *)(itemptr), \ - (PyArrayObject *)(obj)); +#define PyArray_GETITEM(obj,itemptr) \ + ((PyArrayObject *)(obj))->descr->f->getitem((char *)itemptr, \ + (PyArrayObject *)obj); +#define PyArray_SETITEM(obj,itemptr,v) \ + ((PyArrayObject *)(obj))->descr->f->setitem((PyObject *)v, \ + (char *)(itemptr), \ + (PyArrayObject *)(obj)); #define PyTypeNum_ISBOOL(type) (type == NPY_BOOL) #define PyTypeNum_ISUNSIGNED(type) ((type == NPY_UBYTE) || \ - (type == NPY_USHORT) || \ - (type == NPY_UINT) || \ - (type == NPY_ULONG) || \ - (type == NPY_ULONGLONG)) + (type == NPY_USHORT) || \ + (type == NPY_UINT) || \ + (type == NPY_ULONG) || \ + (type == NPY_ULONGLONG)) -#define PyTypeNum_ISSIGNED(type) ((type == NPY_BYTE) || \ - (type == NPY_SHORT) || \ - (type == NPY_INT) || \ - (type == NPY_LONG) || \ - (type == NPY_LONGLONG)) +#define PyTypeNum_ISSIGNED(type) ((type == NPY_BYTE) || \ + (type == NPY_SHORT) || \ + (type == NPY_INT) || \ + (type == NPY_LONG) || \ + (type == NPY_LONGLONG)) -#define PyTypeNum_ISINTEGER(type) ((type >= NPY_BYTE) && \ - (type <= NPY_ULONGLONG)) +#define PyTypeNum_ISINTEGER(type) ((type >= NPY_BYTE) && \ + (type <= NPY_ULONGLONG)) #define PyTypeNum_ISFLOAT(type) ((type >= NPY_FLOAT) && \ - (type <= NPY_LONGDOUBLE)) + (type <= NPY_LONGDOUBLE)) #define PyTypeNum_ISNUMBER(type) (type <= NPY_CLONGDOUBLE) #define PyTypeNum_ISSTRING(type) ((type == NPY_STRING) || \ - (type == NPY_UNICODE)) + (type == NPY_UNICODE)) #define PyTypeNum_ISCOMPLEX(type) ((type >= NPY_CFLOAT) && \ - (type <= NPY_CLONGDOUBLE)) + (type <= NPY_CLONGDOUBLE)) #define PyTypeNum_ISPYTHON(type) ((type == NPY_LONG) || \ - (type == NPY_DOUBLE) || \ - (type == NPY_CDOUBLE) || \ - (type == NPY_BOOL) || \ - (type == NPY_OBJECT )) + (type == NPY_DOUBLE) || \ + (type == NPY_CDOUBLE) || \ + (type == NPY_BOOL) || \ + (type == NPY_OBJECT )) #define PyTypeNum_ISFLEXIBLE(type) ((type>=NPY_STRING) && \ - (type<=NPY_VOID)) + (type<=NPY_VOID)) #define PyTypeNum_ISUSERDEF(type) ((type >= NPY_USERDEF) && \ - (type < NPY_USERDEF+\ - NPY_NUMUSERTYPES)) + (type < NPY_USERDEF+\ + NPY_NUMUSERTYPES)) #define PyTypeNum_ISEXTENDED(type) (PyTypeNum_ISFLEXIBLE(type) || \ PyTypeNum_ISUSERDEF(type)) @@ -1351,8 +1351,8 @@ #define PyArray_ISNOTSWAPPED(m) PyArray_ISNBO(PyArray_DESCR(m)->byteorder) #define PyArray_ISBYTESWAPPED(m) (!PyArray_ISNOTSWAPPED(m)) -#define PyArray_FLAGSWAP(m, flags) (PyArray_CHKFLAGS(m, flags) && \ - PyArray_ISNOTSWAPPED(m)) +#define PyArray_FLAGSWAP(m, flags) (PyArray_CHKFLAGS(m, flags) && \ + PyArray_ISNOTSWAPPED(m)) #define PyArray_ISCARRAY(m) PyArray_FLAGSWAP(m, NPY_CARRAY) #define PyArray_ISCARRAY_RO(m) PyArray_FLAGSWAP(m, NPY_CARRAY_RO) #define PyArray_ISFARRAY(m) PyArray_FLAGSWAP(m, NPY_FARRAY) @@ -1375,7 +1375,7 @@ flags are CONTIGUOUS (1), FORTRAN (2), ALIGNED (0x100), NOTSWAPPED (0x200), and WRITEABLE (0x400). - ARR_HAS_DESCR (0x800) states that arrdescr + ARR_HAS_DESCR (0x800) states that arrdescr field is present in structure */ npy_intp *shape; /* A length-nd array of shape information */ npy_intp *strides; /* A length-nd array of stride information */ @@ -1399,33 +1399,33 @@ #define PyArray_DescrCheck(op) ((op)->ob_type == &PyArrayDescr_Type) -#define PyArray_Check(op) ((op)->ob_type == &PyArray_Type || \ - PyObject_TypeCheck((op), &PyArray_Type)) +#define PyArray_Check(op) ((op)->ob_type == &PyArray_Type || \ + PyObject_TypeCheck((op), &PyArray_Type)) #define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type) #define PyArray_IsZeroDim(op) (PyArray_Check(op) && (PyArray_NDIM(op) == 0)) -#define PyArray_IsScalar(obj, cls) \ - (PyObject_TypeCheck((obj), &Py##cls##ArrType_Type)) +#define PyArray_IsScalar(obj, cls) \ + (PyObject_TypeCheck((obj), &Py##cls##ArrType_Type)) #define PyArray_CheckScalar(m) (PyArray_IsScalar(m, Generic) || \ PyArray_IsZeroDim(m)) #define PyArray_IsPythonNumber(obj) \ - (PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \ - PyLong_Check(obj) || PyBool_Check(obj)) + (PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \ + PyLong_Check(obj) || PyBool_Check(obj)) #define PyArray_IsPythonScalar(obj) \ - (PyArray_IsPythonNumber(obj) || PyString_Check(obj) || \ + (PyArray_IsPythonNumber(obj) || PyString_Check(obj) || \ PyUnicode_Check(obj)) -#define PyArray_IsAnyScalar(obj) \ - (PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj)) +#define PyArray_IsAnyScalar(obj) \ + (PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj)) #define PyArray_CheckAnyScalar(obj) (PyArray_IsPythonScalar(obj) || \ - PyArray_CheckScalar(obj)) + PyArray_CheckScalar(obj)) #define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? Py_INCREF(m), m : \ (PyArrayObject *)(PyArray_Copy(m))) #define PyArray_SAMESHAPE(a1,a2) ((PyArray_NDIM(a1) == PyArray_NDIM(a2)) && \ - PyArray_CompareLists(PyArray_DIMS(a1), \ - PyArray_DIMS(a2), \ - PyArray_NDIM(a1))) + PyArray_CompareLists(PyArray_DIMS(a1), \ + PyArray_DIMS(a2), \ + PyArray_NDIM(a1))) #define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m)) #define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m)) #define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0, NULL) @@ -1433,17 +1433,17 @@ #define PyArray_FROM_OT(m,type) PyArray_FromAny(m, PyArray_DescrFromType(type), \ 0, 0, 0, NULL); #define PyArray_FROM_OTF(m, type, flags) \ - PyArray_FromAny(m, PyArray_DescrFromType(type), 0, 0, \ + PyArray_FromAny(m, PyArray_DescrFromType(type), 0, 0, \ (((flags) & NPY_ENSURECOPY) ? \ ((flags) | NPY_DEFAULT) : (flags)), NULL) #define PyArray_FROMANY(m, type, min, max, flags) \ - PyArray_FromAny(m, PyArray_DescrFromType(type), min, max, \ + PyArray_FromAny(m, PyArray_DescrFromType(type), min, max, \ (((flags) & NPY_ENSURECOPY) ? \ (flags) | NPY_DEFAULT : (flags)), NULL) #define PyArray_ZEROS(m, dims, type, fortran) \ - PyArray_Zeros(m, dims, PyArray_DescrFromType(type), fortran) + PyArray_Zeros(m, dims, PyArray_DescrFromType(type), fortran) #define PyArray_EMPTY(m, dims, type, fortran) \ - PyArray_Empty(m, dims, PyArray_DescrFromType(type), fortran) + PyArray_Empty(m, dims, PyArray_DescrFromType(type), fortran) #define PyArray_FILLWBYTE(obj, val) memset(PyArray_DATA(obj), (val), PyArray_NBYTES(obj)) @@ -1455,76 +1455,76 @@ PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_DEFAULT, NULL) -#define PyArray_EquivArrTypes(a1, a2) \ - PyArray_EquivTypes(PyArray_DESCR(a1), PyArray_DESCR(a2)) +#define PyArray_EquivArrTypes(a1, a2) \ + PyArray_EquivTypes(PyArray_DESCR(a1), PyArray_DESCR(a2)) #define PyArray_EquivByteorders(b1, b2) \ - (((b1) == (b2)) || (PyArray_ISNBO(b1) == PyArray_ISNBO(b2))) + (((b1) == (b2)) || (PyArray_ISNBO(b1) == PyArray_ISNBO(b2))) #define PyArray_SimpleNew(nd, dims, typenum) \ - PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL) + PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL) #define PyArray_SimpleNewFromData(nd, dims, typenum, data) \ PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, data, 0, NPY_CARRAY, NULL) #define PyArray_SimpleNewFromDescr(nd, dims, descr) \ - PyArray_NewFromDescr(&PyArray_Type, descr, nd, dims, NULL, NULL, 0, NULL) + PyArray_NewFromDescr(&PyArray_Type, descr, nd, dims, NULL, NULL, 0, NULL) #define PyArray_ToScalar(data, arr) \ - PyArray_Scalar(data, PyArray_DESCR(arr), (PyObject *)arr) + PyArray_Scalar(data, PyArray_DESCR(arr), (PyObject *)arr) /* These might be faster without the dereferencing of obj going on inside -- of course an optimizing compiler should inline the constants inside a for loop making it a moot point */ -#define PyArray_GETPTR1(obj, i) (void *)(PyArray_BYTES(obj) + \ - i*PyArray_STRIDES(obj)[0]) +#define PyArray_GETPTR1(obj, i) (void *)(PyArray_BYTES(obj) + \ + i*PyArray_STRIDES(obj)[0]) -#define PyArray_GETPTR2(obj, i, j) (void *)(PyArray_BYTES(obj) + \ - i*PyArray_STRIDES(obj)[0] + \ - j*PyArray_STRIDES(obj)[1]) +#define PyArray_GETPTR2(obj, i, j) (void *)(PyArray_BYTES(obj) + \ + i*PyArray_STRIDES(obj)[0] + \ + j*PyArray_STRIDES(obj)[1]) -#define PyArray_GETPTR3(obj, i, j, k) (void *)(PyArray_BYTES(obj) + \ - i*PyArray_STRIDES(obj)[0] + \ - j*PyArray_STRIDES(obj)[1] + \ - k*PyArray_STRIDES(obj)[2]) \ +#define PyArray_GETPTR3(obj, i, j, k) (void *)(PyArray_BYTES(obj) + \ + i*PyArray_STRIDES(obj)[0] + \ + j*PyArray_STRIDES(obj)[1] + \ + k*PyArray_STRIDES(obj)[2]) \ -#define PyArray_GETPTR4(obj, i, j, k, l) (void *)(PyArray_BYTES(obj) + \ - i*PyArray_STRIDES(obj)[0] + \ - j*PyArray_STRIDES(obj)[1] + \ - k*PyArray_STRIDES(obj)[2] + \ - l*PyArray_STRIDES(obj)[3]) +#define PyArray_GETPTR4(obj, i, j, k, l) (void *)(PyArray_BYTES(obj) + \ + i*PyArray_STRIDES(obj)[0] + \ + j*PyArray_STRIDES(obj)[1] + \ + k*PyArray_STRIDES(obj)[2] + \ + l*PyArray_STRIDES(obj)[3]) #define PyArray_XDECREF_ERR(obj) \ - if (obj && (PyArray_FLAGS(obj) & NPY_UPDATEIFCOPY)) { \ - PyArray_FLAGS(PyArray_BASE(obj)) |= NPY_WRITEABLE; \ - PyArray_FLAGS(obj) &= ~NPY_UPDATEIFCOPY; \ - }\ - Py_XDECREF(obj) + if (obj && (PyArray_FLAGS(obj) & NPY_UPDATEIFCOPY)) { \ + PyArray_FLAGS(PyArray_BASE(obj)) |= NPY_WRITEABLE; \ + PyArray_FLAGS(obj) &= ~NPY_UPDATEIFCOPY; \ + }\ + Py_XDECREF(obj) -#define PyArray_DESCR_REPLACE(descr) do { \ - PyArray_Descr *_new_; \ - _new_ = PyArray_DescrNew(descr); \ - Py_XDECREF(descr); \ - descr = _new_; \ - } while(0) +#define PyArray_DESCR_REPLACE(descr) do { \ + PyArray_Descr *_new_; \ + _new_ = PyArray_DescrNew(descr); \ + Py_XDECREF(descr); \ + descr = _new_; \ + } while(0) /* Copy should always return contiguous array */ #define PyArray_Copy(obj) PyArray_NewCopy(obj, NPY_CORDER) -#define PyArray_FromObject(op, type, min_depth, max_depth) \ - PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ +#define PyArray_FromObject(op, type, min_depth, max_depth) \ + PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_BEHAVED | NPY_ENSUREARRAY, NULL) -#define PyArray_ContiguousFromObject(op, type, min_depth, max_depth) \ - PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ +#define PyArray_ContiguousFromObject(op, type, min_depth, max_depth) \ + PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_DEFAULT | NPY_ENSUREARRAY, NULL) -#define PyArray_CopyFromObject(op, type, min_depth, max_depth) \ +#define PyArray_CopyFromObject(op, type, min_depth, max_depth) \ PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \ max_depth, NPY_ENSURECOPY | NPY_DEFAULT | NPY_ENSUREARRAY, NULL) #define PyArray_Cast(mp, type_num) \ - PyArray_CastToType(mp, PyArray_DescrFromType(type_num), 0) + PyArray_CastToType(mp, PyArray_DescrFromType(type_num), 0) #define PyArray_Take(ap, items, axis) \ PyArray_TakeFrom(ap, items, axis, NULL, NPY_RAISE) @@ -1535,8 +1535,8 @@ /* Compatibility with old Numeric stuff -- don't use in new code */ #define PyArray_FromDimsAndData(nd, d, type, data) \ - PyArray_FromDimsAndDataAndDescr(nd, d, PyArray_DescrFromType(type), \ - data) + PyArray_FromDimsAndDataAndDescr(nd, d, PyArray_DescrFromType(type), \ + data) #include "old_defines.h" Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-08-29 18:29:53 UTC (rev 3098) +++ trunk/numpy/core/src/arrayobject.c 2006-09-01 05:53:54 UTC (rev 3099) @@ -6974,6 +6974,11 @@ outtype = _array_small_type(chktype, minitype); Py_DECREF(chktype); Py_DECREF(minitype); + /* VOID Arrays should not occur by "default" */ + if (outtype->type_num == PyArray_VOID) { + Py_DECREF(outtype); + return PyArray_DescrFromType(PyArray_OBJECT); + } return outtype; } From numpy-svn at scipy.org Fri Sep 1 02:09:58 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 1 Sep 2006 01:09:58 -0500 (CDT) Subject: [Numpy-svn] r3100 - in trunk/numpy/core: . src Message-ID: <20060901060958.7104939C01B@new.scipy.org> Author: oliphant Date: 2006-09-01 01:09:52 -0500 (Fri, 01 Sep 2006) New Revision: 3100 Modified: trunk/numpy/core/setup.py trunk/numpy/core/src/arrayobject.c Log: Fix default type of empty array. Fix test for strtod on Python 2.3 Modified: trunk/numpy/core/setup.py =================================================================== --- trunk/numpy/core/setup.py 2006-09-01 05:53:54 UTC (rev 3099) +++ trunk/numpy/core/setup.py 2006-09-01 06:09:52 UTC (rev 3100) @@ -102,7 +102,8 @@ moredefs.append('NPY_NO_SIGNAL') if sys.version[:3] < '2.4': - if check_func('strtod'): + if config_cmd.check_func('strtod', decl=False, + headers=['stdlib.h']): moredefs.append(('PyOS_ascii_strtod', 'strtod')) target_f = open(target,'a') Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-01 05:53:54 UTC (rev 3099) +++ trunk/numpy/core/src/arrayobject.c 2006-09-01 06:09:52 UTC (rev 3100) @@ -6944,7 +6944,7 @@ } if (l == 0 && minitype->type_num == PyArray_BOOL) { Py_DECREF(minitype); - minitype = PyArray_DescrFromType(PyArray_INTP); + minitype = PyArray_DescrFromType(PyArray_DEFAULT); } while (--l >= 0) { PyArray_Descr *newtype; From numpy-svn at scipy.org Sat Sep 2 11:42:28 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 2 Sep 2006 10:42:28 -0500 (CDT) Subject: [Numpy-svn] r3101 - trunk/numpy/core/src Message-ID: <20060902154228.9D43739C077@new.scipy.org> Author: charris Date: 2006-09-02 10:42:26 -0500 (Sat, 02 Sep 2006) New Revision: 3101 Modified: trunk/numpy/core/src/multiarraymodule.c Log: In multiarray.c rename function local_where to local_search_left. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-01 06:09:52 UTC (rev 3100) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-02 15:42:26 UTC (rev 3101) @@ -2506,7 +2506,7 @@ static void -local_where(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret) +local_search_left(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret) { PyArray_CompareFunc *compare = ap2->descr->f->compare; intp min_i, max_i, i, j; @@ -2577,7 +2577,7 @@ } NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_where(ap1, ap2, ret); + local_search_left(ap1, ap2, ret); NPY_END_THREADS_DESCR(ap2->descr) Py_DECREF(ap1); From numpy-svn at scipy.org Sat Sep 2 18:27:29 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 2 Sep 2006 17:27:29 -0500 (CDT) Subject: [Numpy-svn] r3102 - trunk/numpy/core/src Message-ID: <20060902222729.E5F7739C069@new.scipy.org> Author: charris Date: 2006-09-02 17:27:28 -0500 (Sat, 02 Sep 2006) New Revision: 3102 Modified: trunk/numpy/core/src/multiarraymodule.c Log: In multiarray.c rename function local_where to local_search_left. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-02 15:42:26 UTC (rev 3101) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-02 22:27:28 UTC (rev 3102) @@ -2505,6 +2505,23 @@ } +/* local_search_left + * + * Use bisection to find the indices i into ap1 s.t. + * + * ap1[j] < key <= ap1[i] for all 0 <= j < i and all keys in ap2, + * + * When there is no such index i, set i = len(ap1). Return the results in ret. All + * arrays are assumed contiguous on entry and both ap1 and ap2 are assumed to + * be of the same comparable type. + * + * Arguments: + * + * ap1 -- array to be searched, contiguous on entry and assumed sorted. + * ap2 -- array of keys, contiguous on entry. + * ret -- return array of intp, contiguous on entry. + * + */ static void local_search_left(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret) { @@ -2543,6 +2560,53 @@ } } + +/* local_search_right + * + * Use bisection to find the indices i into ap1 s.t. + * + * ap1[j] <= key < ap1[i] for all 0 <= j < i and all keys in ap2. + * + * When there is no such index i, set i = len(ap1). Return the results in ret. All + * arrays are assumed contiguous on entry and both ap1 and ap2 are assumed to + * be of the same comparable type. + * + * Arguments: + * + * ap1 -- array to be searched, contiguous on entry and assumed sorted. + * ap2 -- array of keys, contiguous on entry. + * ret -- return array of intp, contiguous on entry. + * + */ +static void +local_search_right(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret) +{ + PyArray_CompareFunc *compare = ap2->descr->f->compare; + intp nelts = ap1->dimensions[ap1->nd - 1]; + intp nkeys = PyArray_SIZE(ap2); + char *p1 = ap1->data; + char *p2 = ap2->data; + intp *pr = (intp *)ret->data; + int elsize = ap1->descr->elsize; + intp i; + + for(i = 0; i < nkeys; ++i) { + intp imin = 0; + intp ilen = nelts; + while (imin < imax) { + intp imid = imin + (imax - imin >> 2); + if (compare(p1 + elsize*imid, p2, ap2) < 0) { + imin = imid + 1; + } else { + imax = imid; + } + } + *pr = imin; + pr += 1; + p2 += elsize; + } +} + /*MULTIARRAY_API Numeric.searchsorted(a,v) */ @@ -2577,7 +2641,7 @@ } NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_search_left(ap1, ap2, ret); + local_search_right(ap1, ap2, ret); NPY_END_THREADS_DESCR(ap2->descr) Py_DECREF(ap1); From numpy-svn at scipy.org Sat Sep 2 18:33:42 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 2 Sep 2006 17:33:42 -0500 (CDT) Subject: [Numpy-svn] r3103 - trunk/numpy/core/src Message-ID: <20060902223342.092DE39C051@new.scipy.org> Author: charris Date: 2006-09-02 17:33:40 -0500 (Sat, 02 Sep 2006) New Revision: 3103 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Oops, previous commit was accidental and had a temporary mod I was using for testing. Remove that mod. Meanwhile, have added a local_search_right function. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-02 22:27:28 UTC (rev 3102) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-02 22:33:40 UTC (rev 3103) @@ -2592,9 +2592,9 @@ for(i = 0; i < nkeys; ++i) { intp imin = 0; - intp ilen = nelts; + intp imax = nelts; while (imin < imax) { - intp imid = imin + (imax - imin >> 2); + intp imid = imin + ((imax - imin) >> 2); if (compare(p1 + elsize*imid, p2, ap2) < 0) { imin = imid + 1; } else { @@ -2641,7 +2641,7 @@ } NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_search_right(ap1, ap2, ret); + local_search_left(ap1, ap2, ret); NPY_END_THREADS_DESCR(ap2->descr) Py_DECREF(ap1); From numpy-svn at scipy.org Sat Sep 2 22:26:29 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 2 Sep 2006 21:26:29 -0500 (CDT) Subject: [Numpy-svn] r3104 - in trunk/numpy: . core core/include/numpy core/src Message-ID: <20060903022629.D014839C0E4@new.scipy.org> Author: charris Date: 2006-09-02 21:26:26 -0500 (Sat, 02 Sep 2006) New Revision: 3104 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/fromnumeric.py trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/multiarraymodule.c Log: Add new keyword to the searchsorted method and function. Add documentation thereto. Cleanup whitespace. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-02 22:33:40 UTC (rev 3103) +++ trunk/numpy/add_newdocs.py 2006-09-03 02:26:26 UTC (rev 3104) @@ -819,14 +819,41 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('searchsorted', -"""a.searchsorted(v) +"""a.searchsorted(values=v, side='left') -> array of indices. - Assuming that a is a 1-D array, in ascending order and represents bin - boundaries, then a.searchsorted(values) gives an array of bin numbers, - giving the bin into which each value would be placed. This method is - helpful for histograming. Note: No warning is given if the boundaries, in - a, are not in ascending order. + Required Arguments: + v -- keys to be searched for in a. + Keyword arguments + side -- {'left', 'right'}, default('left'). + + If a is a 1-D array in ascending order, then + + a.searchsorted(v, side='left') + + returns an array of indices i such that for each element of values the + following holds: + + a[j] < key <= a[i] for all j < i, + + If such an index does not exist, a.size() is used. The result is such that + if the key were to be inserted in the slot before the index i, then the + order of a would be preserved and i would be the smallest index with that + property. + + If a is a 1-D array in ascending order, then + + a.searchsorted(v, side='right') + + returns an array of indices i such that for each element of values the + following holds: + + a[j] <= key < a[i] for all j < i, + + If such an index does not exist, a.size() is used. The result is that if the + key were to be inserted in the slot before the index i, then the order of a + would be preserved and i would be the largest index with that property. + """)) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2006-09-02 22:33:40 UTC (rev 3103) +++ trunk/numpy/core/fromnumeric.py 2006-09-03 02:26:26 UTC (rev 3104) @@ -220,14 +220,49 @@ return _wrapit(a, 'argmin', axis) return argmin(axis) -def searchsorted(a, v): - """searchsorted(a, v) +def searchsorted(a, v, side ='left'): + """-> array ind. Inserting v[i] before a[ind[i]] will leave a in order. + + Required Arguments: + a -- sorted 1-D array to be searched. + v -- keys to be searched for in a. + + Keyword arguments + side -- {'left', 'right'}, default('left'). + + If a is a 1-D array in ascending order, then + + searchsorted(a, v, side='left') + + returns an array of indices i such that for each element of values the + following holds: + + a[j] < key <= a[i] for all j < i, + + If such an index does not exist, a.size() is used. The result is such that + if the key were to be inserted in the slot before the index i, then the + order of a would be preserved and i would be the smallest index with that + property. + + If a is a 1-D array in ascending order, then + + searchsorted(a, v, side='right') + + returns an array of indices i such that for each element of values the + following holds: + + a[j] <= key < a[i] for all j < i, + + If such an index does not exist, a.size() is used. The result is that if the + key were to be inserted in the slot before the index i, then the order of a + would be preserved and i would be the largest index with that property. + """ try: searchsorted = a.searchsorted except AttributeError: - return _wrapit(a, 'searchsorted', v) - return searchsorted(v) + return _wrapit(a, 'searchsorted', v, side) + return searchsorted(v, side) def resize(a, new_shape): """resize(a,new_shape) returns a new array with the specified shape. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-02 22:33:40 UTC (rev 3103) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-03 02:26:26 UTC (rev 3104) @@ -183,6 +183,13 @@ typedef enum { + NPY_SEARCHLEFT=0, + NPY_SEARCHRIGHT=1, +} NPY_SEARCHKIND; +#define NPY_NSEARCHKINDS NPY_SEARCHRIGHT + 1 + + +typedef enum { NPY_NOSCALAR=-1, NPY_BOOL_SCALAR, NPY_INTPOS_SCALAR, Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-02 22:33:40 UTC (rev 3103) +++ trunk/numpy/core/src/arraymethods.c 2006-09-03 02:26:26 UTC (rev 3104) @@ -693,13 +693,32 @@ } static PyObject * -array_searchsorted(PyArrayObject *self, PyObject *args) +array_searchsorted(PyArrayObject *self, PyObject *args, PyObject *kwds) { PyObject *values; + char *side = "left"; + static char *kwlist[] = {"values","side", NULL}; + NPY_SEARCHKIND which; - if (!PyArg_ParseTuple(args, "O", &values)) return NULL; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s", kwlist, &values, &side)) + return NULL; + if (strlen(side) < 1) { + PyErr_SetString(PyExc_ValueError, + "Searchsorted side string must be at least length 1"); + return PY_FAIL; + } - return _ARET(PyArray_SearchSorted(self, values)); + if (side[0] == 'l' || side[0] == 'L') + which = NPY_SEARCHLEFT; + else if (side[0] == 'r' || side[0] == 'R') + which = NPY_SEARCHRIGHT; + else { + PyErr_Format(PyExc_ValueError, + "%s is an unrecognized side", side); + return PY_FAIL; + } + + return _ARET(PyArray_SearchSorted(self, values, which)); } static void @@ -1549,25 +1568,25 @@ /* Original and Extended methods added 2005 */ {"all", (PyCFunction)array_all, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"any", (PyCFunction)array_any, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"argmax", (PyCFunction)array_argmax, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"argmin", (PyCFunction)array_argmin, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"argsort", (PyCFunction)array_argsort, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"astype", (PyCFunction)array_cast, METH_VARARGS, NULL}, {"byteswap", (PyCFunction)array_byteswap, METH_VARARGS, NULL}, {"choose", (PyCFunction)array_choose, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"clip", (PyCFunction)array_clip, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"compress", (PyCFunction)array_compress, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"conj", (PyCFunction)array_conjugate, METH_VARARGS, NULL}, {"conjugate", (PyCFunction)array_conjugate, @@ -1575,11 +1594,11 @@ {"copy", (PyCFunction)array_copy, METH_VARARGS, NULL}, {"cumprod", (PyCFunction)array_cumprod, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"cumsum", (PyCFunction)array_cumsum, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"diagonal", (PyCFunction)array_diagonal, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"fill", (PyCFunction)array_fill, METH_VARARGS, NULL}, {"flatten", (PyCFunction)array_flatten, @@ -1589,51 +1608,51 @@ {"item", (PyCFunction)array_toscalar, METH_VARARGS, NULL}, {"max", (PyCFunction)array_max, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"mean", (PyCFunction)array_mean, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"min", (PyCFunction)array_min, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"newbyteorder", (PyCFunction)array_newbyteorder, METH_VARARGS, NULL}, {"nonzero", (PyCFunction)array_nonzero, METH_VARARGS, NULL}, {"prod", (PyCFunction)array_prod, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"ptp", (PyCFunction)array_ptp, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"put", (PyCFunction)array_put, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"putmask", (PyCFunction)array_putmask, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"ravel", (PyCFunction)array_ravel, METH_VARARGS, NULL}, {"repeat", (PyCFunction)array_repeat, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"reshape", (PyCFunction)array_reshape, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"resize", (PyCFunction)array_resize, METH_VARARGS | METH_KEYWORDS, NULL}, {"round", (PyCFunction)array_round, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"searchsorted", (PyCFunction)array_searchsorted, - METH_VARARGS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"setfield", (PyCFunction)array_setfield, METH_VARARGS | METH_KEYWORDS, NULL}, {"setflags", (PyCFunction)array_setflags, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"sort", (PyCFunction)array_sort, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"squeeze", (PyCFunction)array_squeeze, METH_VARARGS, NULL}, {"std", (PyCFunction)array_stddev, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"sum", (PyCFunction)array_sum, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"swapaxes", (PyCFunction)array_swapaxes, METH_VARARGS, NULL}, {"take", (PyCFunction)array_take, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"tofile", (PyCFunction)array_tofile, METH_VARARGS | METH_KEYWORDS, NULL}, {"tolist", (PyCFunction)array_tolist, @@ -1641,11 +1660,11 @@ {"tostring", (PyCFunction)array_tostring, METH_VARARGS | METH_KEYWORDS, NULL}, {"trace", (PyCFunction)array_trace, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"transpose", (PyCFunction)array_transpose, METH_VARARGS, NULL}, {"var", (PyCFunction)array_variance, - METH_VARARGS|METH_KEYWORDS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {"view", (PyCFunction)array_view, METH_VARARGS, NULL}, {NULL, NULL} /* sentinel */ Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-02 22:33:40 UTC (rev 3103) +++ trunk/numpy/core/src/arrayobject.c 2006-09-03 02:26:26 UTC (rev 3104) @@ -2399,9 +2399,9 @@ } } - /* Be sure values array is "broadcastable" + /* Be sure values array is "broadcastable" to shape of mit->dimensions, mit->nd */ - + if ((it = (PyArrayIterObject *)\ PyArray_BroadcastToShape(arr, mit->dimensions, mit->nd))==NULL) { Py_DECREF(arr); @@ -4698,7 +4698,7 @@ if (temp) *axis = PyArray_NDIM(temp)-1; else *axis = 0; } - else { + else { temp = (PyObject *)arr; Py_INCREF(temp); *axis = 0; @@ -6288,7 +6288,7 @@ } /* Create a view of a complex array with an equivalent data-type - except it is real instead of complex. + except it is real instead of complex. */ static PyArrayObject * @@ -6301,7 +6301,7 @@ type = PyArray_DescrFromType(self->descr->type_num - PyArray_NUM_FLOATTYPE); offset = (imag ? type->elsize : 0); - + if (!PyArray_ISNBO(self->descr->byteorder)) { PyArray_Descr *new; new = PyArray_DescrNew(type); @@ -6759,14 +6759,14 @@ { PyArray_Descr *outtype; int outtype_num, save_num; - - if (chktype->type_num > mintype->type_num) + + if (chktype->type_num > mintype->type_num) outtype_num = chktype->type_num; - else + else outtype_num = mintype->type_num; - + save_num = outtype_num; - while(outtype_num < PyArray_NTYPES && + while(outtype_num < PyArray_NTYPES && !(PyArray_CanCastSafely(chktype->type_num, outtype_num) && PyArray_CanCastSafely(mintype->type_num, outtype_num))) outtype_num++; @@ -8627,7 +8627,7 @@ PyArrayIterObject *it; int i, diff, j, compat, k; PyArrayObject *ao = (PyArrayObject *)obj; - + if (ao->nd > nd) goto err; compat = 1; diff = j = nd - ao->nd; @@ -8642,7 +8642,7 @@ it = (PyArrayIterObject *)_pya_malloc(sizeof(PyArrayIterObject)); PyObject_Init((PyObject *)it, &PyArrayIter_Type); - + if (it == NULL) return NULL; Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-02 22:33:40 UTC (rev 3103) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-03 02:26:26 UTC (rev 3104) @@ -2526,37 +2526,27 @@ local_search_left(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret) { PyArray_CompareFunc *compare = ap2->descr->f->compare; - intp min_i, max_i, i, j; - int location, elsize = ap1->descr->elsize; - intp elements = ap1->dimensions[ap1->nd-1]; - intp n = PyArray_SIZE(ap2); - intp *rp = (intp *)ret->data; - char *ip = ap2->data; - char *vp = ap1->data; + intp nelts = ap1->dimensions[ap1->nd - 1]; + intp nkeys = PyArray_SIZE(ap2); + char *p1 = ap1->data; + char *p2 = ap2->data; + intp *pr = (intp *)ret->data; + int elsize = ap1->descr->elsize; + intp i; - for (j=0; j 0) { - if (compare(ip, vp+elsize*(--i), ap2) \ - != 0) { - i = i+1; break; - } - } - min_i = i; - break; - } - else if (location < 0) { - max_i = i; - } else { - min_i = i+1; - } + for(i = 0; i < nkeys; ++i) { + intp imin = 0; + intp imax = nelts; + while (imin < imax) { + intp imid = imin + ((imax - imin) >> 2); + if (compare(p1 + elsize*imid, p2, ap2) < 0) + imin = imid + 1; + else + imax = imid; } - *rp = min_i; + *pr = imin; + pr += 1; + p2 += elsize; } } @@ -2595,11 +2585,10 @@ intp imax = nelts; while (imin < imax) { intp imid = imin + ((imax - imin) >> 2); - if (compare(p1 + elsize*imid, p2, ap2) < 0) { + if (compare(p1 + elsize*imid, p2, ap2) <= 0) imin = imid + 1; - } else { + else imax = imid; - } } *pr = imin; pr += 1; @@ -2611,39 +2600,54 @@ Numeric.searchsorted(a,v) */ static PyObject * -PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) +PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2, NPY_SEARCHKIND which) { - PyArrayObject *ap1=NULL, *ap2=NULL, *ret=NULL; + PyArrayObject *ap1=NULL; + PyArrayObject *ap2=NULL; + PyArrayObject *ret=NULL; int typenum = 0; NPY_BEGIN_THREADS_DEF typenum = PyArray_ObjectType((PyObject *)op1, 0); typenum = PyArray_ObjectType(op2, typenum); - ret = NULL; + + /* need ap1 as contiguous array and of right type */ ap1 = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op1, typenum, 1, 1); - if (ap1 == NULL) return NULL; - ap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum, + if (ap1 == NULL) + return NULL; + + /* need ap2 as contiguous array and of right type */ + ap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum, 0, 0); - if (ap2 == NULL) goto fail; + if (ap2 == NULL) + goto fail; + /* ret is a contiguous array of intp type to hold returned indices */ ret = (PyArrayObject *)PyArray_New(ap2->ob_type, ap2->nd, ap2->dimensions, PyArray_INTP, NULL, NULL, 0, 0, (PyObject *)ap2); - if (ret == NULL) goto fail; + if (ret == NULL) + goto fail; + /* check that comparison function exists */ if (ap2->descr->f->compare == NULL) { PyErr_SetString(PyExc_TypeError, "compare not supported for type"); goto fail; } - NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_search_left(ap1, ap2, ret); - NPY_END_THREADS_DESCR(ap2->descr) - + if (which == NPY_SEARCHLEFT) { + NPY_BEGIN_THREADS_DESCR(ap2->descr) + local_search_left(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr) + } else if (which == NPY_SEARCHRIGHT) { + NPY_BEGIN_THREADS_DESCR(ap2->descr) + local_search_right(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr) + } Py_DECREF(ap1); Py_DECREF(ap2); return (PyObject *)ret; @@ -6519,8 +6523,8 @@ #else -static void -_PyArray_SigintHandler(int signum) +static void +_PyArray_SigintHandler(int signum) { return; } @@ -6554,14 +6558,14 @@ else { NPY_SIGINT_ON - + while(a>=0) { a += 1; } - - NPY_SIGINT_OFF + + NPY_SIGINT_OFF } - + return PyInt_FromLong(a); } From numpy-svn at scipy.org Sun Sep 3 13:49:54 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Sep 2006 12:49:54 -0500 (CDT) Subject: [Numpy-svn] r3105 - in trunk/numpy: . core core/src Message-ID: <20060903174954.F369439C09E@new.scipy.org> Author: charris Date: 2006-09-03 12:49:51 -0500 (Sun, 03 Sep 2006) New Revision: 3105 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/fromnumeric.py trunk/numpy/core/src/arraymethods.c Log: Change ndarray.searchsorted keyword "value" to "keys". Tweak documentation of searchsorted. Indent many docstrings in add_newdocs. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-03 02:26:26 UTC (rev 3104) +++ trunk/numpy/add_newdocs.py 2006-09-03 17:49:51 UTC (rev 3105) @@ -57,255 +57,255 @@ ) add_newdoc('numpy.core.multiarray','array', -"""array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0) + """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0) -Return an array from object with the specified date-type. + Return an array from object with the specified date-type. -Inputs: - object - an array, any object exposing the array interface, any - object whose __array__ method returns an array, or any - (nested) sequence. - dtype - The desired data-type for the array. If not given, then - the type will be determined as the minimum type required - to hold the objects in the sequence. This argument can only - be used to 'upcast' the array. For downcasting, use the - .astype(t) method. - copy - If true, then force a copy. Otherwise a copy will only occur - if __array__ returns a copy, obj is a nested sequence, or - a copy is needed to satisfy any of the other requirements - order - Specify the order of the array. If order is 'C', then the - array will be in C-contiguous order (last-index varies the - fastest). If order is 'FORTRAN', then the returned array - will be in Fortran-contiguous order (first-index varies the - fastest). If order is None, then the returned array may - be in either C-, or Fortran-contiguous order or even - discontiguous. - subok - If True, then sub-classes will be passed-through, otherwise - the returned array will be forced to be a base-class array - ndmin - Specifies the minimum number of dimensions that the resulting - array should have. 1's will be pre-pended to the shape as - needed to meet this requirement. + Inputs: + object - an array, any object exposing the array interface, any + object whose __array__ method returns an array, or any + (nested) sequence. + dtype - The desired data-type for the array. If not given, then + the type will be determined as the minimum type required + to hold the objects in the sequence. This argument can only + be used to 'upcast' the array. For downcasting, use the + .astype(t) method. + copy - If true, then force a copy. Otherwise a copy will only occur + if __array__ returns a copy, obj is a nested sequence, or + a copy is needed to satisfy any of the other requirements + order - Specify the order of the array. If order is 'C', then the + array will be in C-contiguous order (last-index varies the + fastest). If order is 'FORTRAN', then the returned array + will be in Fortran-contiguous order (first-index varies the + fastest). If order is None, then the returned array may + be in either C-, or Fortran-contiguous order or even + discontiguous. + subok - If True, then sub-classes will be passed-through, otherwise + the returned array will be forced to be a base-class array + ndmin - Specifies the minimum number of dimensions that the resulting + array should have. 1's will be pre-pended to the shape as + needed to meet this requirement. -""") + """) add_newdoc('numpy.core.multiarray','empty', -"""empty((d1,...,dn),dtype=float,order='C') + """empty((d1,...,dn),dtype=float,order='C') -Return a new array of shape (d1,...,dn) and given type with all its -entries uninitialized. This can be faster than zeros. + Return a new array of shape (d1,...,dn) and given type with all its + entries uninitialized. This can be faster than zeros. -""") + """) add_newdoc('numpy.core.multiarray','scalar', -"""scalar(dtype,obj) + """scalar(dtype,obj) -Return a new scalar array of the given type initialized with -obj. Mainly for pickle support. The dtype must be a valid data-type -descriptor. If dtype corresponds to an OBJECT descriptor, then obj -can be any object, otherwise obj must be a string. If obj is not given -it will be interpreted as None for object type and zeros for all other -types. + Return a new scalar array of the given type initialized with + obj. Mainly for pickle support. The dtype must be a valid data-type + descriptor. If dtype corresponds to an OBJECT descriptor, then obj + can be any object, otherwise obj must be a string. If obj is not given + it will be interpreted as None for object type and zeros for all other + types. -""") + """) add_newdoc('numpy.core.multiarray','zeros', -"""zeros((d1,...,dn),dtype=float,order='C') + """zeros((d1,...,dn),dtype=float,order='C') -Return a new array of shape (d1,...,dn) and type typecode with all -it's entries initialized to zero. + Return a new array of shape (d1,...,dn) and type typecode with all + it's entries initialized to zero. -""") + """) add_newdoc('numpy.core.multiarray','set_typeDict', -"""set_typeDict(dict) + """set_typeDict(dict) -Set the internal dictionary that can look up an array type using a -registered code. + Set the internal dictionary that can look up an array type using a + registered code. -""") + """) add_newdoc('numpy.core.multiarray','fromstring', -"""fromstring(string, dtype=float, count=-1, sep='') + """fromstring(string, dtype=float, count=-1, sep='') -Return a new 1d array initialized from the raw binary data in string. + Return a new 1d array initialized from the raw binary data in string. -If count is positive, the new array will have count elements, otherwise its -size is determined by the size of string. If sep is not empty then the -string is interpreted in ASCII mode and converted to the desired number type -using sep as the separator between elements (extra whitespace is ignored). + If count is positive, the new array will have count elements, otherwise its + size is determined by the size of string. If sep is not empty then the + string is interpreted in ASCII mode and converted to the desired number type + using sep as the separator between elements (extra whitespace is ignored). -""") + """) add_newdoc('numpy.core.multiarray','fromstring', -"""fromiter(iterable, dtype, count=-1) + """fromiter(iterable, dtype, count=-1) -Return a new 1d array initialized from iterable. If count is -nonegative, the new array will have count elements, otherwise it's -size is determined by the generator. + Return a new 1d array initialized from iterable. If count is + nonegative, the new array will have count elements, otherwise it's + size is determined by the generator. -""") + """) add_newdoc('numpy.core.multiarray','fromfile', -"""fromfile(file=, dtype=float, count=-1, sep='') + """fromfile(file=, dtype=float, count=-1, sep='') -Return an array of the given data type from a (text or binary) file. -The file argument can be an open file or a string with the name of a -file to read from. If count==-1, then the entire file is read, -otherwise count is the number of items of the given type read in. If -sep is '' then read a binary file, otherwise it gives the separator -between elements in a text file. + Return an array of the given data type from a (text or binary) file. + The file argument can be an open file or a string with the name of a + file to read from. If count==-1, then the entire file is read, + otherwise count is the number of items of the given type read in. If + sep is '' then read a binary file, otherwise it gives the separator + between elements in a text file. -WARNING: This function should be used sparingly, as it is not a -platform-independent method of persistence. But it can be useful to -read in simply-formatted or binary data quickly. + WARNING: This function should be used sparingly, as it is not a + platform-independent method of persistence. But it can be useful to + read in simply-formatted or binary data quickly. -""") + """) add_newdoc('numpy.core.multiarray','frombuffer', -"""frombuffer(buffer=, dtype=float, count=-1, offset=0) + """frombuffer(buffer=, dtype=float, count=-1, offset=0) -Returns a 1-d array of data type dtype from buffer. The buffer -argument must be an object that exposes the buffer interface. If -count is -1 then the entire buffer is used, otherwise, count is the -size of the output. If offset is given then jump that far into the -buffer. If the buffer has data that is out not in machine byte-order, -than use a propert data type descriptor. The data will not be -byteswapped, but the array will manage it in future operations. + Returns a 1-d array of data type dtype from buffer. The buffer + argument must be an object that exposes the buffer interface. If + count is -1 then the entire buffer is used, otherwise, count is the + size of the output. If offset is given then jump that far into the + buffer. If the buffer has data that is out not in machine byte-order, + than use a propert data type descriptor. The data will not be + byteswapped, but the array will manage it in future operations. -""") + """) add_newdoc('numpy.core.multiarray','concatenate', -"""concatenate((a1, a2, ...), axis=0) + """concatenate((a1, a2, ...), axis=0) -Join arrays together. + Join arrays together. -The tuple of sequences (a1, a2, ...) are joined along the given axis -(default is the first one) into a single numpy array. + The tuple of sequences (a1, a2, ...) are joined along the given axis + (default is the first one) into a single numpy array. -Example: + Example: ->>> concatenate( ([0,1,2], [5,6,7]) ) -array([0, 1, 2, 5, 6, 7]) + >>> concatenate( ([0,1,2], [5,6,7]) ) + array([0, 1, 2, 5, 6, 7]) -""") + """) add_newdoc('numpy.core.multiarray','inner', -"""inner(a,b) + """inner(a,b) -Returns the dot product of two arrays, which has shape a.shape[:-1] + -b.shape[:-1] with elements computed by the product of the elements -from the last dimensions of a and b. + Returns the dot product of two arrays, which has shape a.shape[:-1] + + b.shape[:-1] with elements computed by the product of the elements + from the last dimensions of a and b. -""") + """) add_newdoc('numpy.core','fastCopyAndTranspose', -"""_fastCopyAndTranspose(a)""") + """_fastCopyAndTranspose(a)""") add_newdoc('numpy.core.multiarray','correlate', -"""cross_correlate(a,v, mode=0)""") + """cross_correlate(a,v, mode=0)""") add_newdoc('numpy.core.multiarray','arange', -"""arange([start,] stop[, step,], dtype=None) + """arange([start,] stop[, step,], dtype=None) -For integer arguments, just like range() except it returns an array -whose type can be specified by the keyword argument dtype. If dtype -is not specified, the type of the result is deduced from the type of -the arguments. + For integer arguments, just like range() except it returns an array + whose type can be specified by the keyword argument dtype. If dtype + is not specified, the type of the result is deduced from the type of + the arguments. -For floating point arguments, the length of the result is ceil((stop - -start)/step). This rule may result in the last element of the result -being greater than stop. + For floating point arguments, the length of the result is ceil((stop - + start)/step). This rule may result in the last element of the result + being greater than stop. -""") + """) add_newdoc('numpy.core.multiarray','_get_ndarray_c_version', -"""_get_ndarray_c_version() + """_get_ndarray_c_version() -Return the compile time NDARRAY_VERSION number. + Return the compile time NDARRAY_VERSION number. -""") + """) add_newdoc('numpy.core.multiarray','_reconstruct', -"""_reconstruct(subtype, shape, dtype) + """_reconstruct(subtype, shape, dtype) -Construct an empty array. Used by Pickles. + Construct an empty array. Used by Pickles. -""") + """) add_newdoc('numpy.core.multiarray','set_string_function', -"""set_string_function(f, repr=1) + """set_string_function(f, repr=1) -Set the python function f to be the function used to obtain a pretty -printable string version of an array whenever an array is printed. -f(M) should expect an array argument M, and should return a string -consisting of the desired representation of M for printing. + Set the python function f to be the function used to obtain a pretty + printable string version of an array whenever an array is printed. + f(M) should expect an array argument M, and should return a string + consisting of the desired representation of M for printing. -""") + """) add_newdoc('numpy.core.multiarray','set_numeric_ops', -"""set_numeric_ops(op=func, ...) + """set_numeric_ops(op=func, ...) -Set some or all of the number methods for all array objects. Don't -forget **dict can be used as the argument list. Return the functions -that were replaced, which can be stored and set later. + Set some or all of the number methods for all array objects. Don't + forget **dict can be used as the argument list. Return the functions + that were replaced, which can be stored and set later. -""") + """) add_newdoc('numpy.core.multiarray','where', -"""where(condition, | x, y) + """where(condition, | x, y) -The result is shaped like condition and has elements of x and y where -condition is respectively true or false. If x or y are not given, -then it is equivalent to condition.nonzero(). + The result is shaped like condition and has elements of x and y where + condition is respectively true or false. If x or y are not given, + then it is equivalent to condition.nonzero(). -To group the indices by element, rather than dimension, use + To group the indices by element, rather than dimension, use - transpose(where(condition, | x, y)) + transpose(where(condition, | x, y)) -instead. This always results in a 2d array, with a row of indices for -each element that satisfies the condition. + instead. This always results in a 2d array, with a row of indices for + each element that satisfies the condition. -""") + """) add_newdoc('numpy.core.multiarray','lexsort', -"""lexsort(keys=, axis=-1) + """lexsort(keys=, axis=-1) -Return an array of indices similar to argsort, except the sorting is -done using the provided sorting keys. First the sort is done using -key[0], then the resulting list of indices is further manipulated by -sorting on key[1], and so forth. The result is a sort on multiple -keys. If the keys represented columns of a spreadsheet, for example, -this would sort using multiple columns. The keys argument must be a -sequence of things that can be converted to arrays of the same shape. + Return an array of indices similar to argsort, except the sorting is + done using the provided sorting keys. First the sort is done using + key[0], then the resulting list of indices is further manipulated by + sorting on key[1], and so forth. The result is a sort on multiple + keys. If the keys represented columns of a spreadsheet, for example, + this would sort using multiple columns. The keys argument must be a + sequence of things that can be converted to arrays of the same shape. -""") + """) add_newdoc('numpy.core.multiarray','can_cast', -"""can_cast(from=d1, to=d2) + """can_cast(from=d1, to=d2) -Returns True if data type d1 can be cast to data type d2 without -losing precision. + Returns True if data type d1 can be cast to data type d2 without + losing precision. -""") + """) add_newdoc('numpy.core.multiarray','newbuffer', -"""newbuffer(size) + """newbuffer(size) -Return a new uninitialized buffer object of size bytes + Return a new uninitialized buffer object of size bytes -""") + """) add_newdoc('numpy.core.multiarray','getbuffer', -"""getbuffer(obj [,offset[, size]]) + """getbuffer(obj [,offset[, size]]) -Create a buffer object from the given object referencing a slice of -length size starting at offset. Default is the entire buffer. A -read-write buffer is attempted followed by a read-only buffer. + Create a buffer object from the given object referencing a slice of + length size starting at offset. Default is the entire buffer. A + read-write buffer is attempted followed by a read-only buffer. -""") + """) ############################################################################## # @@ -328,29 +328,29 @@ add_newdoc('numpy.core.multiarray', 'ndarray', -"""An array object represents a multidimensional, homogeneous array -of fixed-size items. An associated data-type-descriptor object -details the data-type in an array (including byteorder and any -fields). An array can be constructed using the numpy.array -command. Arrays are sequence, mapping and numeric objects. -More information is available in the numpy module and by looking -at the methods and attributes of an array. + """An array object represents a multidimensional, homogeneous array + of fixed-size items. An associated data-type-descriptor object + details the data-type in an array (including byteorder and any + fields). An array can be constructed using the numpy.array + command. Arrays are sequence, mapping and numeric objects. + More information is available in the numpy module and by looking + at the methods and attributes of an array. -ndarray.__new__(subtype, shape=, dtype=float, buffer=None, - offset=0, strides=None, order=None) + ndarray.__new__(subtype, shape=, dtype=float, buffer=None, + offset=0, strides=None, order=None) - There are two modes of creating an array using __new__: - 1) If buffer is None, then only shape, dtype, and order - are used - 2) If buffer is an object exporting the buffer interface, then - all keywords are interpreted. - The dtype parameter can be any object that can be interpreted - as a numpy.dtype object. + There are two modes of creating an array using __new__: + 1) If buffer is None, then only shape, dtype, and order + are used + 2) If buffer is an object exporting the buffer interface, then + all keywords are interpreted. + The dtype parameter can be any object that can be interpreted + as a numpy.dtype object. - No __init__ method is needed because the array is fully - initialized after the __new__ method. + No __init__ method is needed because the array is fully + initialized after the __new__ method. -""") + """) ############################################################################## @@ -361,86 +361,118 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_interface__', -"""Array protocol: Python side.""")) + """Array protocol: Python side.""")) add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_finalize__', -"""None.""")) + """None.""")) add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_priority__', -"""Array priority.""")) + """Array priority.""")) add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_struct__', -"""Array protocol: C-struct side.""")) + """Array protocol: C-struct side.""")) add_newdoc('numpy.core.multiarray', 'ndarray', ('_as_parameter_', -"""Allow the array to be interpreted as a ctypes object by returning the -data-memory location as an integer""")) + """Allow the array to be interpreted as a ctypes object by returning the + data-memory location as an integer + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('base', -"""Base object if memory is from some other object.""")) + """Base object if memory is from some other object. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('ctypes', -"""A ctypes interface object.""")) + """A ctypes interface object. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('data', -"""Buffer object pointing to the start of the data.""")) + """Buffer object pointing to the start of the data. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('dtype', -"""Data-type for the array.""")) + """Data-type for the array. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('imag', -"""Imaginary part of the array.""")) + """Imaginary part of the array. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('itemsize', -"""Length of one element in bytes.""")) + """Length of one element in bytes. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('flags', -"""Special object providing array flags.""")) + """Special object providing array flags. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('flat', -"""A 1-d flat iterator.""")) + """A 1-d flat iterator. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('nbytes', -"""Number of bytes in the array.""")) + """Number of bytes in the array. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('ndim', -"""Number of array dimensions.""")) + """Number of array dimensions. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('real', -"""Real part of the array.""")) + """Real part of the array. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('shape', -"""Tuple of array dimensions.""")) + """Tuple of array dimensions. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('size', -"""Number of elements in the array.""")) + """Number of elements in the array. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('strides', -"""Tuple of bytes to step in each dimension.""")) + """Tuple of bytes to step in each dimension. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('T', -"""Equivalent to self.transpose() except self is returned for self.ndim < 2.""")) + """Same as self.transpose() except self is returned for self.ndim < 2. + """)) + ############################################################################## # # ndarray methods @@ -449,594 +481,604 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('__array__', -""" a.__array__(|dtype) -> reference if type unchanged, copy otherwise. + """ a.__array__(|dtype) -> reference if type unchanged, copy otherwise. -Returns either a new reference to self if dtype is not given or a new array -of provided data type if dtype is different from the current dtype of the -array. + Returns either a new reference to self if dtype is not given or a new array + of provided data type if dtype is different from the current dtype of the + array. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('__array_wrap__', -"""a.__array_wrap__(obj) -> Object of same type as a from ndarray obj. + """a.__array_wrap__(obj) -> Object of same type as a from ndarray obj. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('__copy__', -"""a.__copy__(|order) -> copy, possibly with different order. + """a.__copy__(|order) -> copy, possibly with different order. -Return a copy of the array. + Return a copy of the array. -Argument: - order -- Order of returned copy (default 'C') - If order is 'C' (False) then the result is contiguous (default). - If order is 'Fortran' (True) then the result has fortran order. - If order is 'Any' (None) then the result has fortran order - only if m is already in fortran order.; + Argument: + order -- Order of returned copy (default 'C') + If order is 'C' (False) then the result is contiguous (default). + If order is 'Fortran' (True) then the result has fortran order. + If order is 'Any' (None) then the result has fortran order + only if m is already in fortran order.; -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('__deepcopy__', -"""a.__deepcopy__() -> Deep copy of array. + """a.__deepcopy__() -> Deep copy of array. -Used if copy.deepcopy is called on an array. + Used if copy.deepcopy is called on an array. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('__reduce__', -"""a.__reduce__() + """a.__reduce__() -For pickling. + For pickling. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('__setstate__', -"""a.__setstate__(version, shape, typecode, isfortran, rawdata) + """a.__setstate__(version, shape, typecode, isfortran, rawdata) -For unpickling. + For unpickling. -Arguments: - version -- optional pickle version. If omitted defaults to 0. - shape -- a tuple giving the shape - typecode -- a typecode - isFortran -- a bool stating if Fortran or no - rawdata -- a binary string with the data (or a list if Object array) + Arguments: + version -- optional pickle version. If omitted defaults to 0. + shape -- a tuple giving the shape + typecode -- a typecode + isFortran -- a bool stating if Fortran or no + rawdata -- a binary string with the data (or a list if Object array) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('all', -""" a.all(axis=None) + """ a.all(axis=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('any', -""" a.any(axis=None, out=None) + """ a.any(axis=None, out=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('argmax', -""" a.argmax(axis=None, out=None) + """ a.argmax(axis=None, out=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('argmin', -""" a.argmin(axis=None, out=None) + """ a.argmin(axis=None, out=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('argsort', -"""a.argsort(axis=-1, kind='quicksort') -> indices that sort a along given axis. + """a.argsort(axis=-1, kind='quicksort') -> indices that sort a along axis. -Keyword arguments: + Keyword arguments: -axis -- axis to be indirectly sorted (default -1) -kind -- sorting algorithm (default 'quicksort') - Possible values: 'quicksort', 'mergesort', or 'heapsort' + axis -- axis to be indirectly sorted (default -1) + kind -- sorting algorithm (default 'quicksort') + Possible values: 'quicksort', 'mergesort', or 'heapsort' -Returns: array of indices that sort a along the specified axis. + Returns: array of indices that sort a along the specified axis. -This method executes an indirect sort along the given axis using the -algorithm specified by the kind keyword. It returns an array of indices of -the same shape as a that index data along the given axis in sorted order. + This method executes an indirect sort along the given axis using the + algorithm specified by the kind keyword. It returns an array of indices of + the same shape as a that index data along the given axis in sorted order. -The various sorts are characterized by average speed, worst case -performance, need for work space, and whether they are stable. A stable -sort keeps items with the same key in the same relative order. The three -available algorithms have the following properties: + The various sorts are characterized by average speed, worst case + performance, need for work space, and whether they are stable. A stable + sort keeps items with the same key in the same relative order. The three + available algorithms have the following properties: -|------------------------------------------------------| -| kind | speed | worst case | work space | stable| -|------------------------------------------------------| -|'quicksort'| 1 | o(n^2) | 0 | no | -|'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | -|'heapsort' | 3 | o(n*log(n)) | 0 | no | -|------------------------------------------------------| + |------------------------------------------------------| + | kind | speed | worst case | work space | stable| + |------------------------------------------------------| + |'quicksort'| 1 | o(n^2) | 0 | no | + |'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | + |'heapsort' | 3 | o(n*log(n)) | 0 | no | + |------------------------------------------------------| -All the sort algorithms make temporary copies of the data when the sort is not -along the last axis. Consequently, sorts along the last axis are faster and use -less space than sorts along other axis. + All the sort algorithms make temporary copies of the data when the sort is + not along the last axis. Consequently, sorts along the last axis are faster + and use less space than sorts along other axis. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('astype', -"""a.astype(t) -> Copy of array cast to type t. + """a.astype(t) -> Copy of array cast to type t. -Cast array m to type t. t can be either a string representing a typecode, -or a python type object of type int, float, or complex. + Cast array m to type t. t can be either a string representing a typecode, + or a python type object of type int, float, or complex. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('byteswap', -"""a.byteswap(False) -> View or copy. Swap the bytes in the array. + """a.byteswap(False) -> View or copy. Swap the bytes in the array. -Swap the bytes in the array. Return the byteswapped array. If the first -argument is TRUE, byteswap in-place and return a reference to self. + Swap the bytes in the array. Return the byteswapped array. If the first + argument is TRUE, byteswap in-place and return a reference to self. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('choose', -""" a.choose(b0, b1, ..., bn, out=None, mode='raise') + """ a.choose(b0, b1, ..., bn, out=None, mode='raise') -Return an array that merges the b_i arrays together using 'a' as -the index The b_i arrays and 'a' must all be broadcastable to the -same shape. The output at a particular position is the input -array b_i at that position depending on the value of 'a' at that -position. Therefore, 'a' must be an integer array with entries -from 0 to n+1.; + Return an array that merges the b_i arrays together using 'a' as + the index The b_i arrays and 'a' must all be broadcastable to the + same shape. The output at a particular position is the input + array b_i at that position depending on the value of 'a' at that + position. Therefore, 'a' must be an integer array with entries + from 0 to n+1.; -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('clip', -"""a.clip(min=, max=, out=None) + """a.clip(min=, max=, out=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('compress', -"""a.compress(condition=, axis=None, out=None) + """a.compress(condition=, axis=None, out=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('conj', -"""a.conj() + """a.conj() -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('conjugate', -"""a.conjugate() + """a.conjugate() -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('copy', -"""a.copy(|order) -> copy, possibly with different order. + """a.copy(|order) -> copy, possibly with different order. -Return a copy of the array. + Return a copy of the array. -Argument: - order -- Order of returned copy (default 'C') - If order is 'C' (False) then the result is contiguous (default). - If order is 'Fortran' (True) then the result has fortran order. - If order is 'Any' (None) then the result has fortran order - only if m is already in fortran order.; + Argument: + order -- Order of returned copy (default 'C') + If order is 'C' (False) then the result is contiguous (default). + If order is 'Fortran' (True) then the result has fortran order. + If order is 'Any' (None) then the result has fortran order + only if m is already in fortran order.; -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('cumprod', -"""a.cumprod(axis=None, dtype=None) + """a.cumprod(axis=None, dtype=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('cumsum', -"""a.cumsum(axis=None, dtype=None, out=None) + """a.cumsum(axis=None, dtype=None, out=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('diagonal', -"""a.diagonal(offset=0, axis1=0, axis2=1) + """a.diagonal(offset=0, axis1=0, axis2=1) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('dump', -"""a.dump(file) Dump to specified file. + """a.dump(file) Dump to specified file. -Arguments: - file -- string naming the dump file. + Arguments: + file -- string naming the dump file. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('dumps', -"""a.dumps() -> string containing the dump? + """a.dumps() -> string containing the dump? -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('fill', -"""a.fill(value) -> None. Fill the array with the scalar value. -""")) + """a.fill(value) -> None. Fill the array with the scalar value. + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('flatten', -"""a.flatten([fortran]) return a 1-d array (always copy) -""")) + """a.flatten([fortran]) return a 1-d array (always copy) + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('getfield', -"""a.getfield(dtype, offset) -> field of array as given type. + """a.getfield(dtype, offset) -> field of array as given type. -Returns a field of the given array as a certain type. A field is a view of -the array's data with each itemsize determined by the given type and the -offset into the current array. + Returns a field of the given array as a certain type. A field is a view of + the array's data with each itemsize determined by the given type and the + offset into the current array. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('item', -"""a.item() -> copy of first array item as Python scalar. + """a.item() -> copy of first array item as Python scalar. -Copy the first element of array to a standard Python scalar and return -it. The array must be of size one. + Copy the first element of array to a standard Python scalar and return + it. The array must be of size one. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('max', -"""a.max(axis=None) + """a.max(axis=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('mean', -"""a.mean(axis=None, dtype=None) + """a.mean(axis=None, dtype=None) - Average the array over the given axis. If the axis is None, - average over all dimensions of the array. If an integer axis - is given, this equals: - a.sum(axis, dtype) * 1.0 / len(a). - If axis is None, this equals: - a.sum(axis, dtype) * 1.0 / product(a.shape,axis=0) - The optional dtype argument is the data type for intermediate - calculations in the sum.; + Average the array over the given axis. If the axis is None, + average over all dimensions of the array. If an integer axis + is given, this equals: + a.sum(axis, dtype) * 1.0 / len(a). + If axis is None, this equals: + a.sum(axis, dtype) * 1.0 / product(a.shape,axis=0) + The optional dtype argument is the data type for intermediate + calculations in the sum.; -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('min', -"""a.min(axis=None) + """a.min(axis=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('newbyteorder', -"""a.newbyteorder() is equivalent to -a.view(a.dtype.newbytorder()) -""")) + """a.newbyteorder() is equivalent to + a.view(a.dtype.newbytorder()) + """)) + add_newdoc('numpy.core.multiarray', 'ndarray', ('nonzero', -"""a.nonzero() returns a tuple of arrays + """a.nonzero() returns a tuple of arrays -Returns a tuple of arrays, one for each dimension of a, -containing the indices of the non-zero elements in that -dimension. The corresponding non-zero values can be obtained -with - a[a.nonzero()]. + Returns a tuple of arrays, one for each dimension of a, + containing the indices of the non-zero elements in that + dimension. The corresponding non-zero values can be obtained + with + a[a.nonzero()]. -To group the indices by element, rather than dimension, use - transpose(a.nonzero()) -instead. The result of this is always a 2d array, with a row for -each non-zero element.; + To group the indices by element, rather than dimension, use + transpose(a.nonzero()) + instead. The result of this is always a 2d array, with a row for + each non-zero element.; -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('prod', -""" a.prod(axis=None, dtype=None) + """a.prod(axis=None, dtype=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('ptp', -"""a.ptp(axis=None) a.max(axis)-a.min(axis) + """a.ptp(axis=None) a.max(axis)-a.min(axis) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('put', -"""a.put(values, indices, mode) sets a.flat[n] = values[n] for -each n in indices. v can be scalar or shorter than indices, and -it will repeat. + """a.put(values, indices, mode) sets a.flat[n] = values[n] for + each n in indices. v can be scalar or shorter than indices, and + it will repeat. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('putmask', -"""a.putmask(values, mask) sets a.flat[n] = v[n] for each n where -mask.flat[n] is true. v can be scalar. + """a.putmask(values, mask) sets a.flat[n] = v[n] for each n where + mask.flat[n] is true. v can be scalar. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('ravel', -"""a.ravel([fortran]) return a 1-d array (copy only if needed) + """a.ravel([fortran]) return a 1-d array (copy only if needed) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('repeat', -"""a.repeat(repeats=, axis=none) + """a.repeat(repeats=, axis=none) -copy elements of a, repeats times. the repeats argument must be a sequence -of length a.shape[axis] or a scalar. + copy elements of a, repeats times. the repeats argument must be a sequence + of length a.shape[axis] or a scalar. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('reshape', -"""a.reshape(d1, d2, ..., dn, order='c') + """a.reshape(d1, d2, ..., dn, order='c') -Return a new array from this one. The new array must have the same number -of elements as self. Also always returns a view or raises a ValueError if -that is impossible.; + Return a new array from this one. The new array must have the same number + of elements as self. Also always returns a view or raises a ValueError if + that is impossible.; -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('resize', -"""a.resize(new_shape, refcheck=True, order=False) -> None. Change array shape. + """a.resize(new_shape, refcheck=True, order=False) -> None. Change array shape. -Change size and shape of self inplace. Array must own its own memory and -not be referenced by other arrays. Returns None. + Change size and shape of self inplace. Array must own its own memory and + not be referenced by other arrays. Returns None. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('round', -"""a.round(decimals=0, out=None) + """a.round(decimals=0, out=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('searchsorted', -"""a.searchsorted(values=v, side='left') -> array of indices. + """a.searchsorted(v, side='left') -> index array. - Required Arguments: - v -- keys to be searched for in a. + Required arguments: + v -- array of keys to be searched for in a. - Keyword arguments + Keyword arguments: side -- {'left', 'right'}, default('left'). - If a is a 1-D array in ascending order, then + Returns: + index array with the same shape as keys. + The array to be searched must be 1-D and is assumed to be sorted in + ascending order. + + The method call + a.searchsorted(v, side='left') - returns an array of indices i such that for each element of values the - following holds: + returns an index array with the same shape as v such that for each value i + in the index and the corresponding key in v the following holds: a[j] < key <= a[i] for all j < i, If such an index does not exist, a.size() is used. The result is such that - if the key were to be inserted in the slot before the index i, then the - order of a would be preserved and i would be the smallest index with that - property. + if the key were to be inserted into a in the slot before the index i, then + the order of a would be preserved and i would be the smallest index with + that property. - If a is a 1-D array in ascending order, then + The method call a.searchsorted(v, side='right') - returns an array of indices i such that for each element of values the - following holds: + returns an index array with the same shape as v such that for each value i + in the index and the corresponding key in v the following holds: a[j] <= key < a[i] for all j < i, - If such an index does not exist, a.size() is used. The result is that if the - key were to be inserted in the slot before the index i, then the order of a - would be preserved and i would be the largest index with that property. + If such an index does not exist, a.size() is used. The result is such that + if the key were to be inserted into a in the slot before the index i, then + the order of a would be preserved and i would be the largest index with + that property. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('setfield', -"""m.setfield(value, dtype, offset) -> None. -places val into field of the given array defined by the data type and offset. + """m.setfield(value, dtype, offset) -> None. + places val into field of the given array defined by the data type and offset. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('setflags', -"""a.setflags(write=None, align=None, uic=None) + """a.setflags(write=None, align=None, uic=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('sort', -"""a.sort(axis=-1, kind='quicksort') -> None. Sort a along the given axis. + """a.sort(axis=-1, kind='quicksort') -> None. Sort a along the given axis. -Keyword arguments: + Keyword arguments: -axis -- axis to be sorted (default -1) -kind -- sorting algorithm (default 'quicksort') - Possible values: 'quicksort', 'mergesort', or 'heapsort'. + axis -- axis to be sorted (default -1) + kind -- sorting algorithm (default 'quicksort') + Possible values: 'quicksort', 'mergesort', or 'heapsort'. -Returns: None. + Returns: None. -This method sorts a in place along the given axis using the algorithm -specified by the kind keyword. + This method sorts a in place along the given axis using the algorithm + specified by the kind keyword. -The various sorts may characterized by average speed, worst case -performance, need for work space, and whether they are stable. A stable -sort keeps items with the same key in the same relative order and is most -useful when used with argsort where the key might differ from the items -being sorted. The three available algorithms have the following properties: + The various sorts may characterized by average speed, worst case + performance, need for work space, and whether they are stable. A stable + sort keeps items with the same key in the same relative order and is most + useful when used with argsort where the key might differ from the items + being sorted. The three available algorithms have the following properties: -|------------------------------------------------------| -| kind | speed | worst case | work space | stable| -|------------------------------------------------------| -|'quicksort'| 1 | o(n) | 0 | no | -|'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | -|'heapsort' | 3 | o(n*log(n)) | 0 | no | -|------------------------------------------------------| + |------------------------------------------------------| + | kind | speed | worst case | work space | stable| + |------------------------------------------------------| + |'quicksort'| 1 | o(n) | 0 | no | + |'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | + |'heapsort' | 3 | o(n*log(n)) | 0 | no | + |------------------------------------------------------| -All the sort algorithms make temporary copies of the data when the sort is -not along the last axis. Consequently, sorts along the last axis are faster -and use less space than sorts along other axis. + All the sort algorithms make temporary copies of the data when the sort is + not along the last axis. Consequently, sorts along the last axis are faster + and use less space than sorts along other axis. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('squeeze', -"""m.squeeze() eliminate all length-1 dimensions + """m.squeeze() eliminate all length-1 dimensions -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('std', -"""a.std(axis=None, dtype=None, out=None) -> standard deviation. + """a.std(axis=None, dtype=None, out=None) -> standard deviation. -The standard deviation isa measure of the spread of a -distribution. + The standard deviation isa measure of the spread of a + distribution. -The standard deviation is the square root of the average of the -squared deviations from the mean, i.e. - std = sqrt(mean((x - x.mean())**2,axis=0)). + The standard deviation is the square root of the average of the + squared deviations from the mean, i.e. + std = sqrt(mean((x - x.mean())**2,axis=0)). -For multidimensional arrays, std is computed by default along the -first axis. + For multidimensional arrays, std is computed by default along the + first axis. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('sum', -"""a.sum(axis=None, dtype=None) -> Sum of array over given axis. + """a.sum(axis=None, dtype=None) -> Sum of array over given axis. -Sum the array over the given axis. If the axis is None, sum over -all dimensions of the array. + Sum the array over the given axis. If the axis is None, sum over + all dimensions of the array. -The optional dtype argument is the data type for the returned -value and intermediate calculations. The default is to upcast -(promote) smaller integer types to the platform-dependent int. -For example, on 32-bit platforms: + The optional dtype argument is the data type for the returned + value and intermediate calculations. The default is to upcast + (promote) smaller integer types to the platform-dependent int. + For example, on 32-bit platforms: - a.dtype default sum dtype - --------------------------------------------------- - bool, int8, int16, int32 int32 + a.dtype default sum dtype + --------------------------------------------------- + bool, int8, int16, int32 int32 -Examples: + Examples: ->>> array([0.5, 1.5]).sum() -2.0 ->>> array([0.5, 1.5]).sum(dtype=int32) -1 ->>> array([[0, 1], [0, 5]]).sum(axis=0) -array([0, 6]) ->>> array([[0, 1], [0, 5]]).sum(axis=1) -array([1, 5]) + >>> array([0.5, 1.5]).sum() + 2.0 + >>> array([0.5, 1.5]).sum(dtype=int32) + 1 + >>> array([[0, 1], [0, 5]]).sum(axis=0) + array([0, 6]) + >>> array([[0, 1], [0, 5]]).sum(axis=1) + array([1, 5]) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('swapaxes', -"""a.swapaxes(axis1, axis2) -> new view with axes swapped. + """a.swapaxes(axis1, axis2) -> new view with axes swapped. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('take', -"""a.take(indices, axis=None, out=None, mode='raise') -> new array. + """a.take(indices, axis=None, out=None, mode='raise') -> new array. -The new array is formed from the elements of a indexed by indices along the -given axis. + The new array is formed from the elements of a indexed by indices along the + given axis. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('tofile', -"""a.tofile(fid, sep="") -> None. Write the data to a file. + """a.tofile(fid, sep="") -> None. Write the data to a file. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('tolist', -"""a.tolist() -> Array as hierarchical list. + """a.tolist() -> Array as hierarchical list. -Copy the data portion of the array to a hierarchical python list and return -that list. + Copy the data portion of the array to a hierarchical python list and return + that list. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring', -"""a.tostring(order='C') -> binary array data as Python string. + """a.tostring(order='C') -> binary array data as Python string. -Construct a Python string containing the raw bytes in the array. + Construct a Python string containing the raw bytes in the array. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('trace', -"""a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None) -return the sum along the offset diagonal of the array's indicated -axis1 and axis2. + """a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None) + return the sum along the offset diagonal of the array's indicated + axis1 and axis2. -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('transpose', -"""a.transpose(*axes) + """a.transpose(*axes) -Returns a view of 'a' with axes transposed. If no axes are given, -or None is passed, switches the order of the axes. For a 2-d -array, this is the usual matrix transpose. If axes are given, -they describe how the axes are permuted. + Returns a view of 'a' with axes transposed. If no axes are given, + or None is passed, switches the order of the axes. For a 2-d + array, this is the usual matrix transpose. If axes are given, + they describe how the axes are permuted. -Example: ->>> a = array([[1,2],[3,4]]) ->>> a -array([[1, 2], - [3, 4]]) ->>> a.transpose() -array([[1, 3], - [2, 4]]) ->>> a.transpose((1,0)) -array([[1, 3], - [2, 4]]) ->>> a.transpose(1,0) -array([[1, 3], - [2, 4]]) + Example: + >>> a = array([[1,2],[3,4]]) + >>> a + array([[1, 2], + [3, 4]]) + >>> a.transpose() + array([[1, 3], + [2, 4]]) + >>> a.transpose((1,0)) + array([[1, 3], + [2, 4]]) + >>> a.transpose(1,0) + array([[1, 3], + [2, 4]]) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('var', -"""a.var(axis=None, dtype=None) + """a.var(axis=None, dtype=None) -""")) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('view', -"""a.view() -> new view of array with same data. + """a.view() -> new view of array with same data. -Type can be either a new sub-type object or a data-descriptor object + Type can be either a new sub-type object or a data-descriptor object -""")) + """)) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2006-09-03 02:26:26 UTC (rev 3104) +++ trunk/numpy/core/fromnumeric.py 2006-09-03 17:49:51 UTC (rev 3105) @@ -220,42 +220,49 @@ return _wrapit(a, 'argmin', axis) return argmin(axis) -def searchsorted(a, v, side ='left'): - """-> array ind. Inserting v[i] before a[ind[i]] will leave a in order. +def searchsorted(a, v, side='left'): + """-> index array. Inserting v[i] before a[index[i]] maintains a in order. - Required Arguments: + Required arguments: a -- sorted 1-D array to be searched. - v -- keys to be searched for in a. + v -- array of keys to be searched for in a. - Keyword arguments + Keyword arguments: side -- {'left', 'right'}, default('left'). - If a is a 1-D array in ascending order, then + Returns: + array of indices with the same shape as a. + The array to be searched must be 1-D and is assumed to be sorted in + ascending order. + + The function call + searchsorted(a, v, side='left') - returns an array of indices i such that for each element of values the - following holds: + returns an index array with the same shape as v such that for each value i + in the index and the corresponding key in v the following holds: a[j] < key <= a[i] for all j < i, If such an index does not exist, a.size() is used. The result is such that - if the key were to be inserted in the slot before the index i, then the - order of a would be preserved and i would be the smallest index with that - property. + if the key were to be inserted into a in the slot before the index i, then + the order of a would be preserved and i would be the smallest index with + that property. - If a is a 1-D array in ascending order, then + The function call searchsorted(a, v, side='right') - returns an array of indices i such that for each element of values the - following holds: + returns an index array with the same shape as v such that for each value i + in the index and the corresponding key in v the following holds: a[j] <= key < a[i] for all j < i, - If such an index does not exist, a.size() is used. The result is that if the - key were to be inserted in the slot before the index i, then the order of a - would be preserved and i would be the largest index with that property. + If such an index does not exist, a.size() is used. The result is such that + if the key were to be inserted into a in the slot before the index i, then + the order of a would be preserved and i would be the largest index with + that property. """ try: Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-03 02:26:26 UTC (rev 3104) +++ trunk/numpy/core/src/arraymethods.c 2006-09-03 17:49:51 UTC (rev 3105) @@ -695,16 +695,16 @@ static PyObject * array_searchsorted(PyArrayObject *self, PyObject *args, PyObject *kwds) { - PyObject *values; + PyObject *keys; char *side = "left"; - static char *kwlist[] = {"values","side", NULL}; + static char *kwlist[] = {"keys", "side", NULL}; NPY_SEARCHKIND which; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s", kwlist, &values, &side)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s", kwlist, &keys, &side)) return NULL; if (strlen(side) < 1) { PyErr_SetString(PyExc_ValueError, - "Searchsorted side string must be at least length 1"); + "Searchsorted: side must be nonempty string"); return PY_FAIL; } @@ -714,11 +714,11 @@ which = NPY_SEARCHRIGHT; else { PyErr_Format(PyExc_ValueError, - "%s is an unrecognized side", side); + "%s is not a valid value of side", side); return PY_FAIL; } - return _ARET(PyArray_SearchSorted(self, values, which)); + return _ARET(PyArray_SearchSorted(self, keys, which)); } static void From numpy-svn at scipy.org Sun Sep 3 14:51:52 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Sep 2006 13:51:52 -0500 (CDT) Subject: [Numpy-svn] r3106 - trunk/numpy/lib Message-ID: <20060903185152.A7CD939C02D@new.scipy.org> Author: charris Date: 2006-09-03 13:51:51 -0500 (Sun, 03 Sep 2006) New Revision: 3106 Modified: trunk/numpy/lib/function_base.py Log: Small fix to the insert document string. Cleanup whitespace. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2006-09-03 17:49:51 UTC (rev 3105) +++ trunk/numpy/lib/function_base.py 2006-09-03 18:51:51 UTC (rev 3106) @@ -43,10 +43,10 @@ return array([float(start)]) step = (stop-start)/float((num-1)) y = _nx.arange(0, num) * step + start - y[-1] = stop + y[-1] = stop else: step = (stop-start)/float(num) - y = _nx.arange(0, num) * step + start + y = _nx.arange(0, num) * step + start if retstep: return y, step else: @@ -398,11 +398,11 @@ return a[slice1]-a[slice2] try: - add_docstring(digitize, + add_docstring(digitize, r"""digitize(x,bins) - + Return the index of the bin to which each value of x belongs. - + Each index i returned is such that bins[i-1] <= x < bins[i] if bins is monotonically increasing, or bins [i-1] > x >= bins[i] if bins is monotonically decreasing. @@ -415,7 +415,7 @@ try: add_docstring(bincount, r"""bincount(x,weights=None) - + Return the number of occurrences of each value in x. x must be a list of non-negative integers. The output, b[i], @@ -439,7 +439,7 @@ """) except RuntimeError: pass - + def angle(z, deg=0): """Return the angle of the complex argument z. """ @@ -535,7 +535,7 @@ items = list(set(x)) items.sort() return asarray(items) - + def extract(condition, arr): """Return the elements of ravel(arr) where ravel(condition) is True (in 1D). @@ -732,7 +732,7 @@ covariance matrix. If y is given it is treated as an additional (set of) - variable(s). + variable(s). Normalization is by (N-1) where N is the number of observations (unbiased estimate). If bias is 1 then normalization is by N. @@ -752,7 +752,7 @@ axis = 1 tup = (newaxis, slice(None)) - + if y is not None: y = array(y,copy=False,ndmin=2) X = concatenate((X,y),axis) @@ -772,7 +772,7 @@ return (dot(X.transpose(), X.conj()) / fact).squeeze() else: return (dot(X,X.transpose().conj())/fact).squeeze() - + def corrcoef(x, y=None, rowvar=1, bias=0): """The correlation coefficients """ @@ -948,19 +948,19 @@ #always succeed def add_newdoc(place, obj, doc): - """Adds documentation to obj which is in module place. + """Adds documentation to obj which is in module place. If doc is a string add it to obj as a docstring If doc is a tuple, then the first element is interpreted as an attribute of obj and the second as the docstring (method, docstring) - + If doc is a list, then each element of the list should be a sequence of length two --> [(method1, docstring1), (method2, docstring2), ...] - This routine never raises an error. + This routine never raises an error. """ try: new = {} @@ -1005,7 +1005,7 @@ numRows, numCols = len(y), len(x) # yes, reversed x = x.reshape(1,numCols) X = x.repeat(numRows, axis=0) - + y = y.reshape(numRows,1) Y = y.repeat(numCols, axis=1) return X, Y @@ -1020,7 +1020,7 @@ or an array of integers indicated which sub-arrays to remove. - If axis is None, then ravel the array first. + If axis is None, then ravel the array first. Example: >>> arr = [[3,4,5], @@ -1035,14 +1035,14 @@ array([[3,4,5], [6,7,8]]) """ - wrap = None + wrap = None if type(arr) is not ndarray: try: wrap = arr.__array_wrap__ except AttributeError: pass - - + + arr = asarray(arr) ndim = arr.ndim if axis is None: @@ -1055,7 +1055,7 @@ return wrap(arr) else: return arr.copy() - slobj = [slice(None)]*ndim + slobj = [slice(None)]*ndim N = arr.shape[axis] newshape = list(arr.shape) if isinstance(obj, (int, long, integer)): @@ -1069,7 +1069,7 @@ slobj[axis] = slice(obj,None) slobj2 = [slice(None)]*ndim slobj2[axis] = slice(obj+1,None) - new[slobj] = arr[slobj2] + new[slobj] = arr[slobj2] elif isinstance(obj, slice): start, stop, step = obj.indices(N) numtodel = len(xrange(start, stop, step)) @@ -1086,7 +1086,7 @@ else: slobj[axis] = slice(None, start) new[slobj] = arr[slobj] - # copy end chunck + # copy end chunck if stop == N: pass else: @@ -1097,7 +1097,7 @@ # copy middle pieces if step == 1: pass - else: # use array indexing. + else: # use array indexing. obj = arange(start, stop, step, dtype=intp) all = arange(start, stop, dtype=intp) obj = setdiff1d(all, obj) @@ -1130,14 +1130,14 @@ [4,5,6], [7,8,9]]) - >>> insertinto(a, [1,2], [[4],[5]], axis=0) + >>> insert(a, [1,2], [[4],[5]], axis=0) array([[1,2,3], [4,4,4], [4,5,6], [5,5,5], [7,8,9]) """ - wrap = None + wrap = None if type(arr) is not ndarray: try: wrap = arr.__array_wrap__ @@ -1178,7 +1178,7 @@ new[slobj] = arr[slobj2] if wrap: return wrap(new) - return new + return new elif isinstance(obj, slice): # turn it into a range object @@ -1214,4 +1214,3 @@ values = ravel(values) axis = arr.ndim-1 return concatenate((arr, values), axis=axis) - From numpy-svn at scipy.org Sun Sep 3 15:01:49 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Sep 2006 14:01:49 -0500 (CDT) Subject: [Numpy-svn] r3107 - trunk/numpy Message-ID: <20060903190149.3C4DE39C02D@new.scipy.org> Author: charris Date: 2006-09-03 14:01:47 -0500 (Sun, 03 Sep 2006) New Revision: 3107 Modified: trunk/numpy/add_newdocs.py Log: More document tweaks for searchsorted. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-03 18:51:51 UTC (rev 3106) +++ trunk/numpy/add_newdocs.py 2006-09-03 19:01:47 UTC (rev 3107) @@ -877,10 +877,10 @@ a[j] < key <= a[i] for all j < i, - If such an index does not exist, a.size() is used. The result is such that - if the key were to be inserted into a in the slot before the index i, then - the order of a would be preserved and i would be the smallest index with - that property. + If such an index does not exist, a.size() is used. Consequently, i is the + index of the first item in a that is >= key. If the key were to be inserted + into a in the slot before the index i, then the order of a would be + preserved and i would be the smallest index with that property. The method call @@ -891,10 +891,10 @@ a[j] <= key < a[i] for all j < i, - If such an index does not exist, a.size() is used. The result is such that - if the key were to be inserted into a in the slot before the index i, then - the order of a would be preserved and i would be the largest index with - that property. + If such an index does not exist, a.size() is used. Consequently, i is the + index of the first item in a that is > key. If the key were to be inserted + into a in the slot before the index i, then the order of a would be + preserved and i would be the largest index with that property. """)) From numpy-svn at scipy.org Mon Sep 4 13:06:34 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 12:06:34 -0500 (CDT) Subject: [Numpy-svn] r3108 - in trunk/numpy: . core Message-ID: <20060904170634.975D339C044@new.scipy.org> Author: charris Date: 2006-09-04 12:06:31 -0500 (Mon, 04 Sep 2006) New Revision: 3108 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/fromnumeric.py Log: Add documentation to round and around to clear up confusion from numpy's choice to round to even. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-03 19:01:47 UTC (rev 3107) +++ trunk/numpy/add_newdocs.py 2006-09-04 17:06:31 UTC (rev 3108) @@ -848,8 +848,29 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('round', - """a.round(decimals=0, out=None) + """a.round(decimals=0, out=None) -> out (a). Rounds to 'decimals' places. + Keyword arguments: + decimals -- number of decimals to round to (default 0). May be negative. + out -- existing array to use for output (default a). + + Return: + Reference to out, where None specifies the original array a. + + Round to the specified number of decimals. When 'decimals' is negative it + specifies the number of positions to the left of the decimal point. The real + and imaginary parts of complex numbers are rounded separately. Nothing is + done if the array is not of float type. + + The keyword 'out' may be used to specify a different array to hold the + result rather than the default 'a'. If the type of the array specified by + 'out' differs from that of 'a', the result is cast to the new type. + + Numpy rounds to even. Thus 1.5 and 2.5 round to 2, -0.5 and 0.5 round to 0, + etc. Results may also be surprising due to the inexact representation of + decimal fractions in IEEE floating point and the errors introduced in + scaling the numbers when 'decimals' is something other than 0. + """)) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2006-09-03 19:01:47 UTC (rev 3107) +++ trunk/numpy/core/fromnumeric.py 2006-09-04 17:06:31 UTC (rev 3108) @@ -546,11 +546,30 @@ return asarray(a).shape[axis] def round_(a, decimals=0, out=None): - """Round 'a' to the given number of decimal places. Rounding - behaviour is equivalent to Python. + """Returns reference to result. Copies a and rounds to 'decimals' places. - Return 'a' if the array is not floating point. Round both the real - and imaginary parts separately if the array is complex. + Keyword arguments: + decimals -- number of decimals to round to (default 0). May be negative. + out -- existing array to use for output (default copy of a). + + Return: + Reference to out, where None specifies a copy of the original array a. + + Round to the specified number of decimals. When 'decimals' is negative it + specifies the number of positions to the left of the decimal point. The real + and imaginary parts of complex numbers are rounded separately. Nothing is + done if the array is not of float type. + + The keyword 'out' may be used to specify a different array to hold the + result rather than the default copy of 'a'. If the type of the array + specified by 'out' differs from that of 'a', the result is cast to the new + type. + + Numpy rounds to even. Thus 1.5 and 2.5 round to 2, -0.5 and 0.5 round to 0, + etc. Results may also be surprising due to the inexact representation of + decimal fractions in IEEE floating point and the errors introduced in + scaling the numbers when 'decimals' is something other than 0. + """ try: round = a.round From numpy-svn at scipy.org Mon Sep 4 15:31:35 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 14:31:35 -0500 (CDT) Subject: [Numpy-svn] r3109 - in trunk/numpy/core: include/numpy src Message-ID: <20060904193135.38D7439C060@new.scipy.org> Author: oliphant Date: 2006-09-04 14:31:30 -0500 (Mon, 04 Sep 2006) New Revision: 3109 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arrayobject.c Log: Add Index checking for integer conversion and Python 2.5 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-04 17:06:31 UTC (rev 3108) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-04 19:31:30 UTC (rev 3109) @@ -645,6 +645,7 @@ #define PY_SSIZE_T_MIN INT_MIN #define NPY_SSIZE_T_PYFMT "i" #define constchar const char +#define PyIndex_Check(op) 0 #else #define NPY_SSIZE_T_PYFMT "n" #define constchar char Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-04 17:06:31 UTC (rev 3108) +++ trunk/numpy/core/src/arrayobject.c 2006-09-04 19:31:30 UTC (rev 3109) @@ -560,6 +560,12 @@ Py_DECREF(arr); return ret; } +#if (PY_VERSION_HEX >= 0x02050000) + if (PyIndex_Check(op)) { + long_value = (longlong) PyNumber_Index(op); + goto finish; + } +#endif if (o->ob_type->tp_as_number != NULL && \ o->ob_type->tp_as_number->nb_long != NULL) { obj = o->ob_type->tp_as_number->nb_long(o); @@ -643,6 +649,12 @@ Py_DECREF(arr); return ret; } +#if (PY_VERSION_HEX >= 0x02050000) + if (PyIndex_Check(o)) { + long_value = (longlong) PyNumber_Index(o); + goto finish; + } +#endif if (o->ob_type->tp_as_number != NULL && \ o->ob_type->tp_as_number->nb_int != NULL) { obj = o->ob_type->tp_as_number->nb_int(o); @@ -2679,7 +2691,7 @@ } if (PyInt_Check(op) || PyArray_IsScalar(op, Integer) || - PyLong_Check(op)) { + PyLong_Check(op) || PyIndex_Check(index)) { intp value; value = PyArray_PyIntAsIntp(op); if (!PyErr_Occurred()) { @@ -2792,7 +2804,7 @@ } if (PyInt_Check(index) || PyArray_IsScalar(index, Integer) || - PyLong_Check(index)) { + PyLong_Check(index) || PyIndex_Check(index)) { intp value; value = PyArray_PyIntAsIntp(index); if (PyErr_Occurred()) @@ -2890,6 +2902,7 @@ Python so that 0-dim arrays are passed as scalars */ + static PyObject * array_subscript_nice(PyArrayObject *self, PyObject *op) { @@ -2898,7 +2911,7 @@ intp vals[MAX_DIMS]; if (PyInt_Check(op) || PyArray_IsScalar(op, Integer) || \ - PyLong_Check(op)) { + PyLong_Check(op) || PyIndex_Check(op)) { intp value; value = PyArray_PyIntAsIntp(op); if (PyErr_Occurred()) From numpy-svn at scipy.org Mon Sep 4 17:52:21 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 16:52:21 -0500 (CDT) Subject: [Numpy-svn] r3110 - in trunk/numpy: . core core/code_generators core/src Message-ID: <20060904215221.7E3B639C06F@new.scipy.org> Author: oliphant Date: 2006-09-04 16:52:13 -0500 (Mon, 04 Sep 2006) New Revision: 3110 Modified: trunk/numpy/__init__.py trunk/numpy/core/code_generators/generate_umath.py trunk/numpy/core/fromnumeric.py trunk/numpy/core/src/multiarraymodule.c trunk/numpy/core/src/umathmodule.c.src Log: Fix rounding of integers with decimal < 0 Modified: trunk/numpy/__init__.py =================================================================== --- trunk/numpy/__init__.py 2006-09-04 19:31:30 UTC (rev 3109) +++ trunk/numpy/__init__.py 2006-09-04 21:52:13 UTC (rev 3110) @@ -3,14 +3,15 @@ ========== You can support the development of NumPy and SciPy by purchasing -"Guide to NumPy" at +the book "Guide to NumPy" at http://www.trelgol.com -It is being distributed for a fee for only a limited time to -cover some of the costs of development. +It is being distributed for a fee for only a few years to +cover some of the costs of development. After the restriction period +it will also be freely available. -Documentation is also available in the docstrings and at +Additional documentation is available in the docstrings and at http://www.scipy.org. """ Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2006-09-04 19:31:30 UTC (rev 3109) +++ trunk/numpy/core/code_generators/generate_umath.py 2006-09-04 21:52:13 UTC (rev 3110) @@ -432,7 +432,7 @@ 'rint' : Ufunc(1, 1, None, 'round x elementwise to the nearest integer, round halfway cases away from zero', - TD(flts, f='rint'), + TD(inexact, f='rint'), TD(M, f='rint'), ), 'arctan2' : Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2006-09-04 19:31:30 UTC (rev 3109) +++ trunk/numpy/core/fromnumeric.py 2006-09-04 21:52:13 UTC (rev 3110) @@ -556,9 +556,10 @@ Reference to out, where None specifies a copy of the original array a. Round to the specified number of decimals. When 'decimals' is negative it - specifies the number of positions to the left of the decimal point. The real - and imaginary parts of complex numbers are rounded separately. Nothing is - done if the array is not of float type. + specifies the number of positions to the left of the decimal point. The + real and imaginary parts of complex numbers are rounded separately. + Nothing is done if the array is not of float type and 'decimals' is greater + than or equal to 0. The keyword 'out' may be used to specify a different array to hold the result rather than the default copy of 'a'. If the type of the array Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-04 19:31:30 UTC (rev 3109) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-04 21:52:13 UTC (rev 3110) @@ -219,6 +219,8 @@ PyArray_Round(PyArrayObject *a, int decimals, PyArrayObject *out) { PyObject *f, *ret=NULL, *tmp, *op1, *op2; + int ret_int=0; + PyArray_Descr *my_descr; if (out && (PyArray_SIZE(out) != PyArray_SIZE(a))) { PyErr_SetString(PyExc_ValueError, "invalid output shape"); @@ -284,17 +286,24 @@ return PyObject_CallFunction(n_ops.rint, "O", a); } op1 = n_ops.multiply; - op2 = n_ops.divide; + op2 = n_ops.true_divide; } else { - op1 = n_ops.divide; + op1 = n_ops.true_divide; op2 = n_ops.multiply; decimals = -decimals; } if (!out) { - Py_INCREF(a->descr); + if (PyArray_ISINTEGER(a)) { + ret_int = 1; + my_descr = PyArray_DescrFromType(NPY_DOUBLE); + } + else { + Py_INCREF(a->descr); + my_descr = a->descr; + } out = (PyArrayObject *)PyArray_Empty(a->nd, a->dimensions, - a->descr, + my_descr, PyArray_ISFORTRAN(a)); if (out == NULL) return NULL; } @@ -313,6 +322,13 @@ finish: Py_DECREF(f); Py_DECREF(out); + if (ret_int) { + Py_INCREF(a->descr); + tmp = PyArray_CastToType((PyArrayObject *)ret, + a->descr, PyArray_ISFORTRAN(a)); + Py_DECREF(ret); + return tmp; + } return ret; } Modified: trunk/numpy/core/src/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umathmodule.c.src 2006-09-04 19:31:30 UTC (rev 3109) +++ trunk/numpy/core/src/umathmodule.c.src 2006-09-04 21:52:13 UTC (rev 3110) @@ -268,6 +268,8 @@ + + /* Define isnan, isinf, isfinite, signbit if needed */ /* Use fpclassify if possible */ /* isnan, isinf -- @@ -618,6 +620,13 @@ } static void +nc_rint at c@(c at typ@ *x, c at typ@ *r) +{ + r->real = rint at c@(x->real); + r->imag = rint at c@(x->imag); +} + +static void nc_log at c@(c at typ@ *x, c at typ@ *r) { @typ@ l = hypot at c@(x->real,x->imag); From numpy-svn at scipy.org Mon Sep 4 18:04:32 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 17:04:32 -0500 (CDT) Subject: [Numpy-svn] r3111 - trunk/numpy Message-ID: <20060904220432.805F539C066@new.scipy.org> Author: charris Date: 2006-09-04 17:04:31 -0500 (Mon, 04 Sep 2006) New Revision: 3111 Modified: trunk/numpy/add_newdocs.py Log: Update ndarray.round docs to match Travis' mods Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-04 21:52:13 UTC (rev 3110) +++ trunk/numpy/add_newdocs.py 2006-09-04 22:04:31 UTC (rev 3111) @@ -860,7 +860,7 @@ Round to the specified number of decimals. When 'decimals' is negative it specifies the number of positions to the left of the decimal point. The real and imaginary parts of complex numbers are rounded separately. Nothing is - done if the array is not of float type. + done if the array is not of float type and 'decimals' is >= 0. The keyword 'out' may be used to specify a different array to hold the result rather than the default 'a'. If the type of the array specified by From numpy-svn at scipy.org Mon Sep 4 18:42:23 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 17:42:23 -0500 (CDT) Subject: [Numpy-svn] r3112 - in trunk/numpy/core: src tests Message-ID: <20060904224223.B193A39C0A3@new.scipy.org> Author: oliphant Date: 2006-09-04 17:42:18 -0500 (Mon, 04 Sep 2006) New Revision: 3112 Modified: trunk/numpy/core/src/arrayobject.c trunk/numpy/core/tests/test_regression.py Log: Fix object array creation to revert to previous behavior Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-04 22:04:31 UTC (rev 3111) +++ trunk/numpy/core/src/arrayobject.c 2006-09-04 22:42:18 UTC (rev 3112) @@ -7146,7 +7146,7 @@ /* steals reference to typecode */ static PyObject * Array_FromSequence(PyObject *s, PyArray_Descr *typecode, int fortran, - int min_depth, int max_depth, int isobject) + int min_depth, int max_depth) { PyArrayObject *r; int nd; @@ -7157,9 +7157,6 @@ int type = typecode->type_num; int itemsize = typecode->elsize; - if (isobject) - return ObjectArray_FromNestedList(s, typecode, fortran); - stop_at_string = ((type == PyArray_OBJECT) || \ (type == PyArray_STRING && \ typecode->type == PyArray_STRINGLTR) || \ @@ -8227,17 +8224,26 @@ if (PySequence_Check(op)) { PyObject *thiserr; /* necessary but not sufficient */ - Py_INCREF(newtype); r = Array_FromSequence(op, newtype, flags & FORTRAN, - min_depth, max_depth, isobject); - if (r == NULL && \ - ((thiserr = PyErr_Occurred()) && \ - !PyErr_GivenExceptionMatches(thiserr, - PyExc_MemoryError))) { - /* It wasn't really a sequence after all. - * Try interpreting it as a scalar */ - PyErr_Clear(); + min_depth, max_depth); + if (r == NULL && (thiserr=PyErr_Occurred()) && \ + !PyErr_GivenExceptionMatches(thiserr, + PyExc_MemoryError)) { + /* If object was explicitly requested, + then try nested list object array creation + */ + if (isobject) { + PyErr_Clear(); + Py_INCREF(newtype); + r = ObjectArray_FromNestedList \ + (op, newtype, flags & FORTRAN); + seq = TRUE; + Py_DECREF(newtype); + } + else { + PyErr_Clear(); + } } else { seq = TRUE; Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-04 22:04:31 UTC (rev 3111) +++ trunk/numpy/core/tests/test_regression.py 2006-09-04 22:42:18 UTC (rev 3112) @@ -344,8 +344,8 @@ assert_equal(N.array([[1,2],3,4],dtype=object).shape, (3,)) assert_equal(N.array([[1,2],[3,4]],dtype=object).shape, (2,2)) assert_equal(N.array([(1,2),(3,4)],dtype=object).shape, (2,2)) - assert_equal(N.array([],dtype=object).shape, ()) - assert_equal(N.array([[],[],[]],dtype=object).shape, (3,)) + assert_equal(N.array([],dtype=object).shape, (0,)) + assert_equal(N.array([[],[],[]],dtype=object).shape, (3,0)) assert_equal(N.array([[3,4],[5,6],None],dtype=object).shape, (3,)) def check_lexsort(self,level=rlevel): From numpy-svn at scipy.org Mon Sep 4 19:23:45 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 18:23:45 -0500 (CDT) Subject: [Numpy-svn] r3113 - in trunk/numpy: . core Message-ID: <20060904232345.DF2A139C088@new.scipy.org> Author: oliphant Date: 2006-09-04 18:23:40 -0500 (Mon, 04 Sep 2006) New Revision: 3113 Modified: trunk/numpy/_import_tools.py trunk/numpy/core/ma.py Log: Fix ticket #271 and turn default printing of warnings off Modified: trunk/numpy/_import_tools.py =================================================================== --- trunk/numpy/_import_tools.py 2006-09-04 22:42:18 UTC (rev 3112) +++ trunk/numpy/_import_tools.py 2006-09-04 23:23:40 UTC (rev 3113) @@ -155,7 +155,7 @@ Optional keyword inputs: - - verbose - integer specifying verbosity level [default: 0]. + - verbose - integer specifying verbosity level [default: -1]. verbose=-1 will suspend also warnings. - force - when True, force reloading loaded packages [default: False]. - postpone - when True, don't load packages [default: False] @@ -168,7 +168,7 @@ self.info_modules = {} if options.get('force',False): self.imported_packages = [] - self.verbose = verbose = options.get('verbose',False) + self.verbose = verbose = options.get('verbose',-1) postpone = options.get('postpone',None) self._init_info_modules(packages or None) Modified: trunk/numpy/core/ma.py =================================================================== --- trunk/numpy/core/ma.py 2006-09-04 22:42:18 UTC (rev 3112) +++ trunk/numpy/core/ma.py 2006-09-04 23:23:40 UTC (rev 3113) @@ -1543,7 +1543,11 @@ """ af = filled(a) if isinstance(repeats, types.IntType): - repeats = tuple([repeats]*(shape(af)[axis])) + if axis is None: + num = af.size + else: + num = af.shape[axis] + repeats = tuple([repeats]*num) m = getmask(a) if m is not nomask: From numpy-svn at scipy.org Mon Sep 4 20:54:11 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 19:54:11 -0500 (CDT) Subject: [Numpy-svn] r3114 - trunk/numpy Message-ID: <20060905005411.8A5F339C088@new.scipy.org> Author: charris Date: 2006-09-04 19:54:09 -0500 (Mon, 04 Sep 2006) New Revision: 3114 Modified: trunk/numpy/add_newdocs.py Log: Document the method tofile() Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-04 23:23:40 UTC (rev 3113) +++ trunk/numpy/add_newdocs.py 2006-09-05 00:54:09 UTC (rev 3114) @@ -1035,8 +1035,26 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tofile', - """a.tofile(fid, sep="") -> None. Write the data to a file. + """a.tofile(fid, sep="", format="%s") -> None. Write the data to a file. + Required arguments: + file -- an open file object or a filename + + Keyword arguments: + sep -- separator for text output. Write binary if empty (default "") + format -- format string for text file output (default "%s") + + A convenience function for quick storage of array data. Information on + endianess and precision is lost, so this method is not a good choice for + files intended to archive data or transport data between machines with + different endianess. Some of these problems can be overcome by outputting + text files at the expense of speed and file size. + + If 'sep' is empty this method is equivalent to file.write(a.tostring()). If + 'sep' is not empty each data item is converted to the nearest Python type + and formatted using "format"%item. The resulting strings are written to the + file separated by the contents of 'sep'. + """)) From numpy-svn at scipy.org Mon Sep 4 21:43:29 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 20:43:29 -0500 (CDT) Subject: [Numpy-svn] r3115 - trunk/numpy Message-ID: <20060905014329.4F6C839C09B@new.scipy.org> Author: charris Date: 2006-09-04 20:43:27 -0500 (Mon, 04 Sep 2006) New Revision: 3115 Modified: trunk/numpy/add_newdocs.py Log: Add more docs to function fromfile() Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-05 00:54:09 UTC (rev 3114) +++ trunk/numpy/add_newdocs.py 2006-09-05 01:43:27 UTC (rev 3115) @@ -147,19 +147,33 @@ """) add_newdoc('numpy.core.multiarray','fromfile', - """fromfile(file=, dtype=float, count=-1, sep='') + """fromfile(file=, dtype=float, count=-1, sep='') -> array. - Return an array of the given data type from a (text or binary) file. - The file argument can be an open file or a string with the name of a - file to read from. If count==-1, then the entire file is read, - otherwise count is the number of items of the given type read in. If - sep is '' then read a binary file, otherwise it gives the separator - between elements in a text file. + Required arguments: + file -- open file object or string containing file name. - WARNING: This function should be used sparingly, as it is not a - platform-independent method of persistence. But it can be useful to - read in simply-formatted or binary data quickly. + Keyword arguments: + dtype -- type and order of the returned array (default float) + count -- number of items to input (default all) + sep -- separater between items if file is a text file (default "") + Return an array of the given data type from a text or binary file. The + 'file' argument can be an open file or a string with the name of a file to + read from. If 'count' == -1 the entire file is read, otherwise count is the + number of items of the given type to read in. If 'sep' is "" it means to + read binary data from the file using the specified dtype, otherwise it gives + the separator between elements in a text file. The 'dtype' value is also + used to determine the size and order of the items in binary files. + + + Data written using the tofile() method can be conveniently recovered using + this function. + + WARNING: This function should be used sparingly as the binary files are not + platform independent. In particular, they contain no endianess or datatype + information. Nevertheless it can be useful for reading in simply formatted + or binary data quickly. + """) add_newdoc('numpy.core.multiarray','frombuffer', @@ -1038,7 +1052,7 @@ """a.tofile(fid, sep="", format="%s") -> None. Write the data to a file. Required arguments: - file -- an open file object or a filename + file -- an open file object or a string containing a filename Keyword arguments: sep -- separator for text output. Write binary if empty (default "") @@ -1048,13 +1062,16 @@ endianess and precision is lost, so this method is not a good choice for files intended to archive data or transport data between machines with different endianess. Some of these problems can be overcome by outputting - text files at the expense of speed and file size. + the data as text files at the expense of speed and file size. If 'sep' is empty this method is equivalent to file.write(a.tostring()). If 'sep' is not empty each data item is converted to the nearest Python type and formatted using "format"%item. The resulting strings are written to the file separated by the contents of 'sep'. + The data produced by this method can be recovered by using the function + fromfile(). + """)) From numpy-svn at scipy.org Mon Sep 4 23:46:38 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 22:46:38 -0500 (CDT) Subject: [Numpy-svn] r3116 - tags Message-ID: <20060905034638.8BA6D39C0CC@new.scipy.org> Author: oliphant Date: 2006-09-04 22:46:26 -0500 (Mon, 04 Sep 2006) New Revision: 3116 Added: tags/1.0b5/ Log: made a copy Copied: tags/1.0b5 (from rev 3115, trunk) From numpy-svn at scipy.org Mon Sep 4 23:49:18 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 22:49:18 -0500 (CDT) Subject: [Numpy-svn] r3117 - tags/1.0b5/numpy Message-ID: <20060905034918.2201239C082@new.scipy.org> Author: oliphant Date: 2006-09-04 22:49:04 -0500 (Mon, 04 Sep 2006) New Revision: 3117 Modified: tags/1.0b5/numpy/version.py Log: Make version a release Modified: tags/1.0b5/numpy/version.py =================================================================== --- tags/1.0b5/numpy/version.py 2006-09-05 03:46:26 UTC (rev 3116) +++ tags/1.0b5/numpy/version.py 2006-09-05 03:49:04 UTC (rev 3117) @@ -1,5 +1,5 @@ version='1.0b5' -release=False +release=True if not release: import os From numpy-svn at scipy.org Mon Sep 4 23:50:34 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Sep 2006 22:50:34 -0500 (CDT) Subject: [Numpy-svn] r3118 - trunk/numpy Message-ID: <20060905035034.6C7CF39C0CC@new.scipy.org> Author: oliphant Date: 2006-09-04 22:50:20 -0500 (Mon, 04 Sep 2006) New Revision: 3118 Modified: trunk/numpy/version.py Log: Bump up version number to rc1 Modified: trunk/numpy/version.py =================================================================== --- trunk/numpy/version.py 2006-09-05 03:49:04 UTC (rev 3117) +++ trunk/numpy/version.py 2006-09-05 03:50:20 UTC (rev 3118) @@ -1,4 +1,4 @@ -version='1.0b5' +version='1.0rc1' release=False if not release: From numpy-svn at scipy.org Tue Sep 5 02:58:49 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Sep 2006 01:58:49 -0500 (CDT) Subject: [Numpy-svn] r3119 - trunk/numpy/core/src Message-ID: <20060905065849.6501E39C03A@new.scipy.org> Author: oliphant Date: 2006-09-05 01:58:18 -0500 (Tue, 05 Sep 2006) New Revision: 3119 Modified: trunk/numpy/core/src/arrayobject.c Log: Fixes for Python2.5 Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-05 03:50:20 UTC (rev 3118) +++ trunk/numpy/core/src/arrayobject.c 2006-09-05 06:58:18 UTC (rev 3119) @@ -561,8 +561,8 @@ return ret; } #if (PY_VERSION_HEX >= 0x02050000) - if (PyIndex_Check(op)) { - long_value = (longlong) PyNumber_Index(op); + if (PyIndex_Check(o)) { + long_value = (longlong) PyNumber_Index(o); goto finish; } #endif @@ -2691,7 +2691,7 @@ } if (PyInt_Check(op) || PyArray_IsScalar(op, Integer) || - PyLong_Check(op) || PyIndex_Check(index)) { + PyLong_Check(op) || PyIndex_Check(op)) { intp value; value = PyArray_PyIntAsIntp(op); if (!PyErr_Occurred()) { From numpy-svn at scipy.org Tue Sep 5 04:32:33 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Sep 2006 03:32:33 -0500 (CDT) Subject: [Numpy-svn] r3120 - trunk/numpy/fft Message-ID: <20060905083233.E4DC939C014@new.scipy.org> Author: stefan Date: 2006-09-05 03:32:14 -0500 (Tue, 05 Sep 2006) New Revision: 3120 Modified: trunk/numpy/fft/helper.py Log: Optimize fftfreq. Modified: trunk/numpy/fft/helper.py =================================================================== --- trunk/numpy/fft/helper.py 2006-09-05 06:58:18 UTC (rev 3119) +++ trunk/numpy/fft/helper.py 2006-09-05 08:32:14 UTC (rev 3120) @@ -7,6 +7,7 @@ from numpy.core import asarray, concatenate, arange, take, \ array, integer +from numpy import hstack import types def fftshift(x,axes=None): @@ -62,5 +63,4 @@ f = [0,1,...,(n-1)/2,-(n-1)/2,...,-1]/(d*n) if n is odd """ assert isinstance(n,types.IntType) or isinstance(n, integer) - k = range(0,(n-1)/2+1)+range(-(n/2),0) - return array(k,'d')/(n*d) + return hstack((arange(0,(n-1)/2 + 1), arange(-(n/2),0))) / (n*d) From numpy-svn at scipy.org Tue Sep 5 12:59:02 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Sep 2006 11:59:02 -0500 (CDT) Subject: [Numpy-svn] r3121 - trunk/numpy/core/src Message-ID: <20060905165902.ED28039C019@new.scipy.org> Author: oliphant Date: 2006-09-05 11:58:59 -0500 (Tue, 05 Sep 2006) New Revision: 3121 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix dimension error for object arrays. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-05 08:32:14 UTC (rev 3120) +++ trunk/numpy/core/src/arrayobject.c 2006-09-05 16:58:59 UTC (rev 3121) @@ -7157,15 +7157,20 @@ int type = typecode->type_num; int itemsize = typecode->elsize; - stop_at_string = ((type == PyArray_OBJECT) || \ - (type == PyArray_STRING && \ - typecode->type == PyArray_STRINGLTR) || \ - (type == PyArray_UNICODE) || \ + check_it = ((type != PyArray_STRING) && + (type != PyArray_UNICODE) && + (type != PyArray_VOID) && + (type != PyArray_CHAR)); + + stop_at_string = ((type == PyArray_OBJECT) || + (type == PyArray_STRING && + typecode->type == PyArray_STRINGLTR) || + (type == PyArray_UNICODE) || (type == PyArray_VOID)); - + stop_at_tuple = (type == PyArray_VOID && (typecode->names \ || typecode->subarray)); - + if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string, stop_at_tuple)) > 0)) { if (nd==0) @@ -7186,7 +7191,6 @@ goto fail; } - check_it = !(stop_at_string || type == PyArray_STRING); if(discover_dimensions(s,nd,d, check_it) == -1) goto fail; if (typecode->type == PyArray_CHARLTR && nd > 0 && d[nd-1]==1) { From numpy-svn at scipy.org Tue Sep 5 14:36:51 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Sep 2006 13:36:51 -0500 (CDT) Subject: [Numpy-svn] r3122 - in trunk/numpy: . core/src Message-ID: <20060905183651.F1BEB39C036@new.scipy.org> Author: charris Date: 2006-09-05 13:36:49 -0500 (Tue, 05 Sep 2006) New Revision: 3122 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/src/multiarraymodule.c Log: Docstring for tostring and small formatting change to PyArray_SearchSorted. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-05 16:58:59 UTC (rev 3121) +++ trunk/numpy/add_newdocs.py 2006-09-05 18:36:49 UTC (rev 3122) @@ -1067,7 +1067,8 @@ If 'sep' is empty this method is equivalent to file.write(a.tostring()). If 'sep' is not empty each data item is converted to the nearest Python type and formatted using "format"%item. The resulting strings are written to the - file separated by the contents of 'sep'. + file separated by the contents of 'sep'. The data is always written in "C" + (row major) order independent of the order of 'a'. The data produced by this method can be recovered by using the function fromfile(). @@ -1079,16 +1080,27 @@ """a.tolist() -> Array as hierarchical list. Copy the data portion of the array to a hierarchical python list and return - that list. + that list. Data items are converted to the nearest compatible Python type. """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring', - """a.tostring(order='C') -> binary array data as Python string. + """a.tostring(order='C') -> raw copy of array data as a Python string. - Construct a Python string containing the raw bytes in the array. + Keyword arguments: + order -- order of the data item in the copy {"C","F","A"} (default "C") + Construct a Python string containing the raw bytes in the array. The order + of the data in arrays with ndim > 1 is specified by the 'order' keyword and + this keyword overrides the order of the array. The + choices are: + + "C" -- C order (row major) + "Fortran" -- Fortran order (column major) + "Any" -- Current order of array. + None -- Same as "Any" + """)) Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-05 16:58:59 UTC (rev 3121) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-05 18:36:49 UTC (rev 3122) @@ -2659,7 +2659,8 @@ NPY_BEGIN_THREADS_DESCR(ap2->descr) local_search_left(ap1, ap2, ret); NPY_END_THREADS_DESCR(ap2->descr) - } else if (which == NPY_SEARCHRIGHT) { + } + else if (which == NPY_SEARCHRIGHT) { NPY_BEGIN_THREADS_DESCR(ap2->descr) local_search_right(ap1, ap2, ret); NPY_END_THREADS_DESCR(ap2->descr) From numpy-svn at scipy.org Tue Sep 5 23:19:34 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Sep 2006 22:19:34 -0500 (CDT) Subject: [Numpy-svn] r3123 - trunk/numpy Message-ID: <20060906031934.39A7839C00B@new.scipy.org> Author: charris Date: 2006-09-05 22:19:32 -0500 (Tue, 05 Sep 2006) New Revision: 3123 Modified: trunk/numpy/add_newdocs.py Log: Break up more of the documentation in add_newdocs Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-05 18:36:49 UTC (rev 3122) +++ trunk/numpy/add_newdocs.py 2006-09-06 03:19:32 UTC (rev 3123) @@ -35,27 +35,98 @@ ] ) -add_newdoc('numpy.core', 'flatiter', - [('__array__', -"""__array__(type=None) -Get array from iterator"""), - ('copy', -"""copy() -Get a copy of the iterator as a 1-d array"""), - ('coords', "An N-d tuple of current coordinates.") - ] - ) +############################################################################### +# +# flatiter +# +# flatiter needs a toplevel description +# +############################################################################### -add_newdoc('numpy.core', 'broadcast', - [('size', "total size of broadcasted result"), - ('index', "current index in broadcasted result"), - ('shape', "shape of broadcasted result"), - ('iters', "tuple of individual iterators"), - ('numiter', "number of iterators"), - ('nd', "number of dimensions of broadcasted result") - ] - ) +# attributes +add_newdoc('numpy.core', 'flatiter', ('base', + """documentation needed + """)) + + + +add_newdoc('numpy.core', 'flatiter', ('coords', + """An N-d tuple of current coordinates. + + """)) + + + +add_newdoc('numpy.core', 'flatiter', ('index', + """documentation needed + + """)) + + + +# functions +add_newdoc('numpy.core', 'flatiter', ('__array__', + """__array__(type=None) Get array from iterator + + """)) + + +add_newdoc('numpy.core', 'flatiter', ('copy', + """copy() Get a copy of the iterator as a 1-d array + + """)) + + +############################################################################### +# +# broadcast +# +############################################################################### + +# attributes +add_newdoc('numpy.core', 'broadcast', ('index', + """current index in broadcasted result + + """)) + + +add_newdoc('numpy.core', 'broadcast', ('iters', + """tuple of individual iterators + + """)) + + +add_newdoc('numpy.core', 'broadcast', ('nd', + """number of dimensions of broadcasted result + + """)) + + +add_newdoc('numpy.core', 'broadcast', ('numiter', + """number of iterators + + """)) + + +add_newdoc('numpy.core', 'broadcast', ('shape', + """shape of broadcasted result + + """)) + + +add_newdoc('numpy.core', 'broadcast', ('size', + """total size of broadcasted result + + """)) + + +############################################################################### +# +# numpy functions +# +############################################################################### + add_newdoc('numpy.core.multiarray','array', """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0) @@ -325,12 +396,6 @@ # # Documentation for ndarray attributes and methods # -# Todo: -# -# expand and reformat documentation. -# -# do all methods prior to Extended methods added 2005 -# ############################################################################## @@ -1019,6 +1084,8 @@ --------------------------------------------------- bool, int8, int16, int32 int32 + Warning: The arithmetic is modular and no error is raised on overflow. + Examples: >>> array([0.5, 1.5]).sum() @@ -1029,6 +1096,8 @@ array([0, 6]) >>> array([[0, 1], [0, 5]]).sum(axis=1) array([1, 5]) + >>> ones(128, dtype=int8).sum(dtype=int8) # overflow! + -128 """)) From numpy-svn at scipy.org Wed Sep 6 01:56:41 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 6 Sep 2006 00:56:41 -0500 (CDT) Subject: [Numpy-svn] r3124 - trunk/numpy/core/src Message-ID: <20060906055641.86AAD39C03D@new.scipy.org> Author: oliphant Date: 2006-09-06 00:56:32 -0500 (Wed, 06 Sep 2006) New Revision: 3124 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Fix memory leak in corner case of lexsort. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-06 03:19:32 UTC (rev 3123) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-06 05:56:32 UTC (rev 3124) @@ -2414,9 +2414,10 @@ mps[0]->dimensions, PyArray_INTP, NULL, NULL, 0, 0, NULL); - if (ret == NULL) return NULL; + + if (ret == NULL) goto fail; *((intp *)(ret->data)) = 0; - return (PyObject *)ret; + goto finish; } if (axis < 0) axis += nd; if ((axis < 0) || (axis >= nd)) { @@ -2502,8 +2503,9 @@ NPY_END_THREADS + finish: for (i=0; i Author: oliphant Date: 2006-09-06 10:33:22 -0500 (Wed, 06 Sep 2006) New Revision: 3125 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix segfault in BroadcastToShape Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-06 05:56:32 UTC (rev 3124) +++ trunk/numpy/core/src/arrayobject.c 2006-09-06 15:33:22 UTC (rev 3125) @@ -8692,7 +8692,7 @@ it->dims_m1[i]; if (i > 0) it->factors[nd-i-1] = it->factors[nd-i] * \ - it->ao->dimensions[nd-i]; + dims[nd-i]; } PyArray_ITER_RESET(it); From numpy-svn at scipy.org Wed Sep 6 18:49:53 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 6 Sep 2006 17:49:53 -0500 (CDT) Subject: [Numpy-svn] r3126 - in trunk/numpy/core: include/numpy src Message-ID: <20060906224953.6EB6839C040@new.scipy.org> Author: oliphant Date: 2006-09-06 17:49:46 -0500 (Wed, 06 Sep 2006) New Revision: 3126 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arrayobject.c Log: Code clean-up Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-06 15:33:22 UTC (rev 3125) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-06 22:49:46 UTC (rev 3126) @@ -1223,7 +1223,6 @@ npy_intp bscoord[NPY_MAXDIMS]; PyObject *indexobj; /* creating obj */ - int view; int consec; char *dataptr; Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-06 15:33:22 UTC (rev 3125) +++ trunk/numpy/core/src/arrayobject.c 2006-09-06 22:49:46 UTC (rev 3126) @@ -2526,7 +2526,8 @@ for (i=0; ind > 1 && (PyTuple_Check(index) && (PyTuple_GET_SIZE(index) == self->nd)) \ + if (self->nd > 1 && + (PyTuple_Check(index) && (PyTuple_GET_SIZE(index) == self->nd)) && PyArray_IntpFromSequence(index, vals, self->nd) == self->nd) { int i; char *item; From numpy-svn at scipy.org Wed Sep 6 20:34:33 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 6 Sep 2006 19:34:33 -0500 (CDT) Subject: [Numpy-svn] r3127 - trunk/numpy/core/src Message-ID: <20060907003433.0612839C040@new.scipy.org> Author: oliphant Date: 2006-09-06 19:34:30 -0500 (Wed, 06 Sep 2006) New Revision: 3127 Modified: trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/multiarraymodule.c Log: More code cleanup Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-06 22:49:46 UTC (rev 3126) +++ trunk/numpy/core/src/arrayobject.c 2006-09-07 00:34:30 UTC (rev 3127) @@ -12,6 +12,7 @@ by Travis Oliphant, oliphant at ee.byu.edu +Brigham Young Univeristy maintainer email: oliphant.travis at ieee.org @@ -2432,7 +2433,8 @@ PyArray_Item_INCREF(it->dataptr, PyArray_DESCR(arr)); memmove(mit->dataptr, it->dataptr, sizeof(PyObject *)); /* ignored unless VOID array with object's */ - copyswap(mit->dataptr, NULL, swap, arr); + if (swap) + copyswap(mit->dataptr, NULL, swap, arr); PyArray_MapIterNext(mit); PyArray_ITER_NEXT(it); } @@ -9699,11 +9701,6 @@ mit->ait = (PyArrayIterObject *)PyArray_IterNew((PyObject *)arr); if (mit->ait == NULL) return; - /* If this is just a view, then do nothing more */ - /* views are handled by just adjusting the strides - and dimensions of the object. - */ - /* no subspace iteration needed. Finish up and Return */ if (subnd == 0) { n = arr->nd; Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-06 22:49:46 UTC (rev 3126) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-07 00:34:30 UTC (rev 3127) @@ -5,10 +5,11 @@ Original file Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin at mit.edu - Modified extensively for numpy in 2005 + Modified for numpy in 2005 Travis E. Oliphant oliphant at ee.byu.edu + Brigham Young University */ /* $Id: multiarraymodule.c,v 1.36 2005/09/14 00:14:00 teoliphant Exp $ */ From numpy-svn at scipy.org Thu Sep 7 02:37:06 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Sep 2006 01:37:06 -0500 (CDT) Subject: [Numpy-svn] r3128 - in trunk/numpy: . core numarray oldnumeric Message-ID: <20060907063706.1399739C012@new.scipy.org> Author: oliphant Date: 2006-09-07 01:36:54 -0500 (Thu, 07 Sep 2006) New Revision: 3128 Modified: trunk/numpy/core/_internal.py trunk/numpy/ctypeslib.py trunk/numpy/numarray/alter_code1.py trunk/numpy/numarray/alter_code2.py trunk/numpy/oldnumeric/alter_code1.py trunk/numpy/oldnumeric/alter_code2.py trunk/numpy/oldnumeric/fix_default_axis.py Log: Add c_intp to ctypeslib. Add converttree to alter_code functions. Fix ctypeslib when ctypes is not available. Modified: trunk/numpy/core/_internal.py =================================================================== --- trunk/numpy/core/_internal.py 2006-09-07 00:34:30 UTC (rev 3127) +++ trunk/numpy/core/_internal.py 2006-09-07 06:36:54 UTC (rev 3128) @@ -192,10 +192,11 @@ return result def _getintp_ctype(): - if _getintp_ctype.cache: - return _getintp_ctype.cache + val = _getintp_ctype.cache + if val is not None: + return val + char = dtype('p').char import ctypes - char = dtype('p').char if (char == 'i'): val = ctypes.c_int elif char == 'l': @@ -203,7 +204,7 @@ elif char == 'q': val = ctypes.c_longlong else: - raise ValueError, "confused about intp->ctypes." + val = ctypes.c_long _getintp_ctype.cache = val return val _getintp_ctype.cache = None Modified: trunk/numpy/ctypeslib.py =================================================================== --- trunk/numpy/ctypeslib.py 2006-09-07 00:34:30 UTC (rev 3127) +++ trunk/numpy/ctypeslib.py 2006-09-07 06:36:54 UTC (rev 3128) @@ -1,116 +1,134 @@ -__all__ = ['load_library', 'ndpointer', 'test', 'ctypes_load_library'] +__all__ = ['load_library', 'ndpointer', 'test', 'ctypes_load_library', + 'c_intp'] import sys, os from numpy import integer, product, ndarray, dtype as _dtype, deprecate from numpy.core.multiarray import _flagdict, flagsobj -# Adapted from Albert Strasheim -def load_library(libname, loader_path): - if '.' not in libname: - if sys.platform == 'win32': - libname = '%s.dll' % libname - elif sys.platform == 'darwin': - libname = '%s.dylib' % libname - else: - libname = '%s.so' % libname - loader_path = os.path.abspath(loader_path) - if not os.path.isdir(loader_path): - libdir = os.path.dirname(loader_path) - else: - libdir = loader_path +try: import ctypes - libpath = os.path.join(libdir, libname) - return ctypes.cdll[libpath] +except ImportError: + ctypes = None -def _num_fromflags(flaglist): - num = 0 - for val in flaglist: - num += _flagdict[val] - return num +if ctypes is None: + def _dummy(*args, **kwds): + raise ImportError, "ctypes is not available." + load_library = _dummy + ndpointer = _dummy + ctypes_load_library = _dummy + + from numpy import intp as c_intp +else: + import numpy.core._internal as nic + c_intp = nic._getintp_ctype() + del nic + + # Adapted from Albert Strasheim + def load_library(libname, loader_path): + if '.' not in libname: + if sys.platform == 'win32': + libname = '%s.dll' % libname + elif sys.platform == 'darwin': + libname = '%s.dylib' % libname + else: + libname = '%s.so' % libname + loader_path = os.path.abspath(loader_path) + if not os.path.isdir(loader_path): + libdir = os.path.dirname(loader_path) + else: + libdir = loader_path + libpath = os.path.join(libdir, libname) + return ctypes.cdll[libpath] -def _flags_fromnum(num): - res = [] - for key, value in _flagdict.items(): - if (num & value): - res.append(key) - return res + def _num_fromflags(flaglist): + num = 0 + for val in flaglist: + num += _flagdict[val] + return num -ctypes_load_library = deprecate(load_library, 'ctypes_load_library', 'load_library') + def _flags_fromnum(num): + res = [] + for key, value in _flagdict.items(): + if (num & value): + res.append(key) + return res -class _ndptr(object): - def from_param(cls, obj): - if not isinstance(obj, ndarray): - raise TypeError, "argument must be an ndarray" - if cls._dtype_ is not None \ - and obj.dtype != cls._dtype_: - raise TypeError, "array must have data type %s" % cls._dtype_ - if cls._ndim_ is not None \ - and obj.ndim != cls._ndim_: - raise TypeError, "array must have %d dimension(s)" % cls._ndim_ - if cls._shape_ is not None \ - and obj.shape != cls._shape_: - raise TypeError, "array must have shape %s" % str(cls._shape_) - if cls._flags_ is not None \ - and ((obj.flags.num & cls._flags_) != cls._flags_): - raise TypeError, "array must have flags %s" % \ - _flags_fromnum(cls._flags_) - return obj.ctypes - from_param = classmethod(from_param) + ctypes_load_library = deprecate(load_library, 'ctypes_load_library', 'load_library') + class _ndptr(object): + def from_param(cls, obj): + if not isinstance(obj, ndarray): + raise TypeError, "argument must be an ndarray" + if cls._dtype_ is not None \ + and obj.dtype != cls._dtype_: + raise TypeError, "array must have data type %s" % cls._dtype_ + if cls._ndim_ is not None \ + and obj.ndim != cls._ndim_: + raise TypeError, "array must have %d dimension(s)" % cls._ndim_ + if cls._shape_ is not None \ + and obj.shape != cls._shape_: + raise TypeError, "array must have shape %s" % str(cls._shape_) + if cls._flags_ is not None \ + and ((obj.flags.num & cls._flags_) != cls._flags_): + raise TypeError, "array must have flags %s" % \ + _flags_fromnum(cls._flags_) + return obj.ctypes + from_param = classmethod(from_param) -# Factory for an array-checking class with from_param defined for -# use with ctypes argtypes mechanism -_pointer_type_cache = {} -def ndpointer(dtype=None, ndim=None, shape=None, flags=None): - if dtype is not None: - dtype = _dtype(dtype) - num = None - if flags is not None: - if isinstance(flags, str): - flags = flags.split(',') - elif isinstance(flags, (int, integer)): - num = flags - flags = _flags_fromnum(num) - elif isinstance(flags, flagsobj): - num = flags.num - flags = _flags_fromnum(num) - if num is None: + + # Factory for an array-checking class with from_param defined for + # use with ctypes argtypes mechanism + _pointer_type_cache = {} + def ndpointer(dtype=None, ndim=None, shape=None, flags=None): + if dtype is not None: + dtype = _dtype(dtype) + num = None + if flags is not None: + if isinstance(flags, str): + flags = flags.split(',') + elif isinstance(flags, (int, integer)): + num = flags + flags = _flags_fromnum(num) + elif isinstance(flags, flagsobj): + num = flags.num + flags = _flags_fromnum(num) + if num is None: + try: + flags = [x.strip().upper() for x in flags] + except: + raise TypeError, "invalid flags specification" + num = _num_fromflags(flags) + try: + return _pointer_type_cache[(dtype, ndim, shape, num)] + except KeyError: + pass + if dtype is None: + name = 'any' + elif dtype.names: + name = str(id(dtype)) + else: + name = dtype.str + if ndim is not None: + name += "_%dd" % ndim + if shape is not None: try: - flags = [x.strip().upper() for x in flags] - except: - raise TypeError, "invalid flags specification" - num = _num_fromflags(flags) - try: - return _pointer_type_cache[(dtype, ndim, shape, num)] - except KeyError: - pass - if dtype is None: - name = 'any' - elif dtype.names: - name = str(id(dtype)) - else: - name = dtype.str - if ndim is not None: - name += "_%dd" % ndim - if shape is not None: - try: - strshape = [str(x) for x in shape] - except TypeError: - strshape = [str(shape)] - shape = (shape,) - shape = tuple(shape) - name += "_"+"x".join(strshape) - if flags is not None: - name += "_"+"_".join(flags) - else: - flags = [] - klass = type("ndpointer_%s"%name, (_ndptr,), - {"_dtype_": dtype, - "_shape_" : shape, - "_ndim_" : ndim, - "_flags_" : num}) - _pointer_type_cache[dtype] = klass - return klass + strshape = [str(x) for x in shape] + except TypeError: + strshape = [str(shape)] + shape = (shape,) + shape = tuple(shape) + name += "_"+"x".join(strshape) + if flags is not None: + name += "_"+"_".join(flags) + else: + flags = [] + klass = type("ndpointer_%s"%name, (_ndptr,), + {"_dtype_": dtype, + "_shape_" : shape, + "_ndim_" : ndim, + "_flags_" : num}) + _pointer_type_cache[dtype] = klass + return klass def test(level=1, verbosity=1): from numpy.testing import NumpyTest Modified: trunk/numpy/numarray/alter_code1.py =================================================================== --- trunk/numpy/numarray/alter_code1.py 2006-09-07 00:34:30 UTC (rev 3127) +++ trunk/numpy/numarray/alter_code1.py 2006-09-07 06:36:54 UTC (rev 3128) @@ -52,7 +52,7 @@ - .setimaginary() --> .imag """ -__all__ = ['convertfile', 'convertall'] +__all__ = ['convertfile', 'convertall', 'converttree'] import sys import os Modified: trunk/numpy/numarray/alter_code2.py =================================================================== --- trunk/numpy/numarray/alter_code2.py 2006-09-07 00:34:30 UTC (rev 3127) +++ trunk/numpy/numarray/alter_code2.py 2006-09-07 06:36:54 UTC (rev 3128) @@ -2,12 +2,14 @@ This module converts code written for numpy.numarray to work with numpy +FIXME: finish this. + """ -#__all__ = ['convertfile', 'convertall'] +#__all__ = ['convertfile', 'convertall', 'converttree'] __all__ = [] import warnings -warnings.warn("numpy.numarray.alter_code2 is not ready yet.") +warnings.warn("numpy.numarray.alter_code2 is not working yet.") import sys @@ -15,71 +17,7 @@ import re import glob -# To convert typecharacters we need to -# Not very safe. Disabled for now.. -def replacetypechars(astr): - astr = astr.replace("'s'","'h'") - astr = astr.replace("'b'","'B'") - astr = astr.replace("'1'","'b'") - astr = astr.replace("'w'","'H'") - astr = astr.replace("'u'","'I'") - return astr -def changeimports(fstr, name, newname): - importstr = 'import %s' % name - importasstr = 'import %s as ' % name - fromstr = 'from %s import ' % name - fromall=0 - - fstr = fstr.replace(importasstr, 'import %s as ' % newname) - fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name)) - - ind = 0 - Nlen = len(fromstr) - Nlen2 = len("from %s import " % newname) - while 1: - found = fstr.find(fromstr,ind) - if (found < 0): - break - ind = found + Nlen - if fstr[ind] == '*': - continue - fstr = "%sfrom %s import %s" % (fstr[:found], newname, fstr[ind:]) - ind += Nlen2 - Nlen - return fstr, fromall - -def replaceattr(astr): - astr = astr.replace("matrixmultiply","dot") - return astr - -def replaceother(astr): - astr = re.sub(r'typecode\s*=', 'dtype=', astr) - astr = astr.replace('ArrayType', 'ndarray') - astr = astr.replace('NewAxis', 'newaxis') - return astr - -import datetime -def fromstr(filestr): - #filestr = replacetypechars(filestr) - filestr, fromall1 = changeimports(filestr, 'numpy.oldnumeric', 'numpy') - filestr, fromall1 = changeimports(filestr, 'numpy.core.multiarray', 'numpy') - filestr, fromall1 = changeimports(filestr, 'numpy.core.umath', 'numpy') - filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', - 'numpy.linalg.old') - filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random.oldrng') - filestr, fromall3 = changeimports(filestr, 'RNG.Statistics', 'numpy.random.oldrngstats') - filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random.oldrandomarray') - filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.fft.old') - filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.core.ma') - fromall = fromall1 or fromall2 or fromall3 - filestr = replaceattr(filestr) - filestr = replaceother(filestr) - today = datetime.date.today().strftime('%b %d, %Y') - name = os.path.split(sys.argv[0])[-1] - filestr = '## Automatically adapted for '\ - 'numpy %s by %s\n\n%s' % (today, name, filestr) - return filestr - def makenewfile(name, filestr): fid = file(name, 'w') fid.write(filestr) @@ -118,5 +56,15 @@ for afile in files: convertfile(afile) +def _func(arg, dirname, fnames): + convertall(dirname) + +def converttree(direc=os.path.curdir): + """Convert all .py files in the tree given + + """ + os.path.walk(direc, _func, None) + + if __name__ == '__main__': fromargs(sys.argv) Modified: trunk/numpy/oldnumeric/alter_code1.py =================================================================== --- trunk/numpy/oldnumeric/alter_code1.py 2006-09-07 00:34:30 UTC (rev 3127) +++ trunk/numpy/oldnumeric/alter_code1.py 2006-09-07 06:36:54 UTC (rev 3128) @@ -28,7 +28,7 @@ * Converts uses of type(...) is isinstance(..., ) """ -__all__ = ['convertfile', 'convertall'] +__all__ = ['convertfile', 'convertall', 'converttree'] import sys import os @@ -195,5 +195,15 @@ for afile in files: convertfile(afile) +def _func(arg, dirname, fnames): + convertall(dirname) + +def converttree(direc=os.path.curdir): + """Convert all .py files in the tree given + + """ + os.path.walk(direc, _func, None) + + if __name__ == '__main__': fromargs(sys.argv) Modified: trunk/numpy/oldnumeric/alter_code2.py =================================================================== --- trunk/numpy/oldnumeric/alter_code2.py 2006-09-07 00:34:30 UTC (rev 3127) +++ trunk/numpy/oldnumeric/alter_code2.py 2006-09-07 06:36:54 UTC (rev 3128) @@ -2,6 +2,8 @@ This module converts code written for numpy.oldnumeric to work with numpy +FIXME: Flesh this out. + Makes the following changes: * Converts typecharacters '1swu' to 'bhHI' respectively when used as typecodes @@ -17,11 +19,11 @@ oldnumeric.random_array, and oldnumeric.fft """ -#__all__ = ['convertfile', 'convertall'] +#__all__ = ['convertfile', 'convertall', 'converttree'] __all__ = [] import warnings -warnings.warn("numpy.oldnumeric.alter_code2 is not ready yet.") +warnings.warn("numpy.oldnumeric.alter_code2 is not working yet.") import sys import os @@ -131,5 +133,14 @@ for afile in files: convertfile(afile) +def _func(arg, dirname, fnames): + convertall(dirname) + +def converttree(direc=os.path.curdir): + """Convert all .py files in the tree given + + """ + os.path.walk(direc, _func, None) + if __name__ == '__main__': fromargs(sys.argv) Modified: trunk/numpy/oldnumeric/fix_default_axis.py =================================================================== --- trunk/numpy/oldnumeric/fix_default_axis.py 2006-09-07 00:34:30 UTC (rev 3127) +++ trunk/numpy/oldnumeric/fix_default_axis.py 2006-09-07 06:36:54 UTC (rev 3128) @@ -33,8 +33,7 @@ std mean """ -__all__ = ['convertfile', 'convertall', 'converttree', - 'convertfile2','convertall2', 'converttree2'] +__all__ = ['convertfile', 'convertall', 'converttree'] import sys import os From numpy-svn at scipy.org Thu Sep 7 03:04:16 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Sep 2006 02:04:16 -0500 (CDT) Subject: [Numpy-svn] r3129 - trunk/numpy/numarray Message-ID: <20060907070416.2D84639C012@new.scipy.org> Author: oliphant Date: 2006-09-07 02:04:13 -0500 (Thu, 07 Sep 2006) New Revision: 3129 Modified: trunk/numpy/numarray/alter_code1.py Log: Whitespace change in alter_code1.py Modified: trunk/numpy/numarray/alter_code1.py =================================================================== --- trunk/numpy/numarray/alter_code1.py 2006-09-07 06:36:54 UTC (rev 3128) +++ trunk/numpy/numarray/alter_code1.py 2006-09-07 07:04:13 UTC (rev 3129) @@ -59,8 +59,6 @@ import re import glob - - def changeimports(fstr, name, newname): importstr = 'import %s' % name importasstr = 'import %s as ' % name From numpy-svn at scipy.org Thu Sep 7 13:13:44 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Sep 2006 12:13:44 -0500 (CDT) Subject: [Numpy-svn] r3130 - in trunk/numpy: . core Message-ID: <20060907171344.957F439C035@new.scipy.org> Author: charris Date: 2006-09-07 12:13:42 -0500 (Thu, 07 Sep 2006) New Revision: 3130 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/fromnumeric.py Log: Documentation tweaks for searchsorted and round. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-07 07:04:13 UTC (rev 3129) +++ trunk/numpy/add_newdocs.py 2006-09-07 17:13:42 UTC (rev 3130) @@ -937,17 +937,18 @@ Reference to out, where None specifies the original array a. Round to the specified number of decimals. When 'decimals' is negative it - specifies the number of positions to the left of the decimal point. The real - and imaginary parts of complex numbers are rounded separately. Nothing is - done if the array is not of float type and 'decimals' is >= 0. + specifies the number of positions to the left of the decimal point. The + real and imaginary parts of complex numbers are rounded separately. Nothing + is done if the array is not of float type and 'decimals' is >= 0. The keyword 'out' may be used to specify a different array to hold the result rather than the default 'a'. If the type of the array specified by - 'out' differs from that of 'a', the result is cast to the new type. + 'out' differs from that of 'a', the result is cast to the new type, + otherwise the original type is kept. Floats round to floats by default. - Numpy rounds to even. Thus 1.5 and 2.5 round to 2, -0.5 and 0.5 round to 0, - etc. Results may also be surprising due to the inexact representation of - decimal fractions in IEEE floating point and the errors introduced in + Numpy rounds to even. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5 round to + 0.0, etc. Results may also be surprising due to the inexact representation + of decimal fractions in IEEE floating point and the errors introduced in scaling the numbers when 'decimals' is something other than 0. """)) @@ -960,7 +961,7 @@ v -- array of keys to be searched for in a. Keyword arguments: - side -- {'left', 'right'}, default('left'). + side -- {'left', 'right'}, (default 'left'). Returns: index array with the same shape as keys. @@ -978,9 +979,9 @@ a[j] < key <= a[i] for all j < i, If such an index does not exist, a.size() is used. Consequently, i is the - index of the first item in a that is >= key. If the key were to be inserted - into a in the slot before the index i, then the order of a would be - preserved and i would be the smallest index with that property. + index of the first item in 'a' that is >= key. If the key were to be + inserted into a in the slot before the index i, then the order of a would + be preserved and i would be the smallest index with that property. The method call @@ -992,9 +993,9 @@ a[j] <= key < a[i] for all j < i, If such an index does not exist, a.size() is used. Consequently, i is the - index of the first item in a that is > key. If the key were to be inserted - into a in the slot before the index i, then the order of a would be - preserved and i would be the largest index with that property. + index of the first item in 'a' that is > key. If the key were to be + inserted into a in the slot before the index i, then the order of a would + be preserved and i would be the largest index with that property. """)) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2006-09-07 07:04:13 UTC (rev 3129) +++ trunk/numpy/core/fromnumeric.py 2006-09-07 17:13:42 UTC (rev 3130) @@ -245,10 +245,10 @@ a[j] < key <= a[i] for all j < i, - If such an index does not exist, a.size() is used. The result is such that - if the key were to be inserted into a in the slot before the index i, then - the order of a would be preserved and i would be the smallest index with - that property. + If such an index does not exist, a.size() is used. Consequently, i is the + index of the first item in 'a' that is >= key. If the key were to be + inserted into a in the slot before the index i, then the order of a would + be preserved and i would be the smallest index with that property. The function call @@ -259,10 +259,10 @@ a[j] <= key < a[i] for all j < i, - If such an index does not exist, a.size() is used. The result is such that - if the key were to be inserted into a in the slot before the index i, then - the order of a would be preserved and i would be the largest index with - that property. + If such an index does not exist, a.size() is used. Consequently, i is the + index of the first item in 'a' that is > key. If the key were to be + inserted into a in the slot before the index i, then the order of a would + be preserved and i would be the largest index with that property. """ try: @@ -549,10 +549,10 @@ """Returns reference to result. Copies a and rounds to 'decimals' places. Keyword arguments: - decimals -- number of decimals to round to (default 0). May be negative. + decimals -- number of decimal places to round to (default 0). out -- existing array to use for output (default copy of a). - Return: + Returns: Reference to out, where None specifies a copy of the original array a. Round to the specified number of decimals. When 'decimals' is negative it @@ -562,15 +562,17 @@ than or equal to 0. The keyword 'out' may be used to specify a different array to hold the - result rather than the default copy of 'a'. If the type of the array - specified by 'out' differs from that of 'a', the result is cast to the new - type. + result rather than the default 'a'. If the type of the array specified by + 'out' differs from that of 'a', the result is cast to the new type, + otherwise the original type is kept. Floats round to floats by default. - Numpy rounds to even. Thus 1.5 and 2.5 round to 2, -0.5 and 0.5 round to 0, - etc. Results may also be surprising due to the inexact representation of - decimal fractions in IEEE floating point and the errors introduced in + Numpy rounds to even. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5 round to + 0.0, etc. Results may also be surprising due to the inexact representation + of decimal fractions in IEEE floating point and the errors introduced in scaling the numbers when 'decimals' is something other than 0. + The function around is an alias for round_. + """ try: round = a.round From numpy-svn at scipy.org Thu Sep 7 14:12:57 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Sep 2006 13:12:57 -0500 (CDT) Subject: [Numpy-svn] r3131 - trunk/numpy/core/src Message-ID: <20060907181257.4081739C035@new.scipy.org> Author: oliphant Date: 2006-09-07 13:12:53 -0500 (Thu, 07 Sep 2006) New Revision: 3131 Modified: trunk/numpy/core/src/arraymethods.c Log: Fix invalid keyword argument error in reshape method. Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-07 17:13:42 UTC (rev 3130) +++ trunk/numpy/core/src/arraymethods.c 2006-09-07 18:12:53 UTC (rev 3131) @@ -74,8 +74,12 @@ if (kwds != NULL) { PyObject *ref; ref = PyDict_GetItemString(kwds, "order"); - if (ref == NULL || \ - (PyArray_OrderConverter(ref, &order) == PY_FAIL)) + if (ref == NULL) { + PyErr_SetString(PyExc_TypeError, + "invalid keyword argument"); + return NULL; + } + if ((PyArray_OrderConverter(ref, &order) == PY_FAIL)) return NULL; } From numpy-svn at scipy.org Thu Sep 7 18:28:04 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Sep 2006 17:28:04 -0500 (CDT) Subject: [Numpy-svn] r3132 - trunk/numpy/core/tests Message-ID: <20060907222804.0F64239C012@new.scipy.org> Author: stefan Date: 2006-09-07 17:27:48 -0500 (Thu, 07 Sep 2006) New Revision: 3132 Modified: trunk/numpy/core/tests/test_regression.py Log: Add unit test for ticket #273. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-07 18:12:53 UTC (rev 3131) +++ trunk/numpy/core/tests/test_regression.py 2006-09-07 22:27:48 UTC (rev 3132) @@ -359,6 +359,11 @@ assert_equal(N.arange(4,dtype=' Author: stefan Date: 2006-09-07 17:43:47 -0500 (Thu, 07 Sep 2006) New Revision: 3133 Modified: trunk/numpy/core/tests/test_regression.py Log: Add test for ticket #271. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-07 22:27:48 UTC (rev 3132) +++ trunk/numpy/core/tests/test_regression.py 2006-09-07 22:43:47 UTC (rev 3133) @@ -359,6 +359,10 @@ assert_equal(N.arange(4,dtype=' Author: stefan Date: 2006-09-07 18:52:34 -0500 (Thu, 07 Sep 2006) New Revision: 3134 Modified: trunk/numpy/core/tests/test_regression.py Log: Tests for tickets #254 and #270. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-07 22:43:47 UTC (rev 3133) +++ trunk/numpy/core/tests/test_regression.py 2006-09-07 23:52:34 UTC (rev 3134) @@ -352,6 +352,14 @@ """Lexsort memory error""" v = N.array([1,2,3,4,5,6,7,8,9,10]) assert_equal(N.lexsort(v),0) + + def check_masked_array_multiply(self,level=rlevel): + """Ticket #254""" + a = N.ma.zeros((4,1)) + a[2,0] = N.ma.masked + b = N.zeros((4,2)) + a*b + b*a def check_swap_real(self, level=rlevel): """Ticket #265""" @@ -359,7 +367,11 @@ assert_equal(N.arange(4,dtype=' Author: stefan Date: 2006-09-07 19:11:23 -0500 (Thu, 07 Sep 2006) New Revision: 3135 Modified: trunk/numpy/core/tests/test_regression.py Log: Tests for tickets #246 and #251. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-07 23:52:34 UTC (rev 3134) +++ trunk/numpy/core/tests/test_regression.py 2006-09-08 00:11:23 UTC (rev 3135) @@ -348,11 +348,21 @@ assert_equal(N.array([[],[],[]],dtype=object).shape, (3,0)) assert_equal(N.array([[3,4],[5,6],None],dtype=object).shape, (3,)) + def check_character_array_strip(self,level=rlevel): + """Ticket #246""" + x = N.char.array(("x","x ","x ")) + for c in x: assert_equal(c,"x") + def check_lexsort(self,level=rlevel): """Lexsort memory error""" v = N.array([1,2,3,4,5,6,7,8,9,10]) assert_equal(N.lexsort(v),0) + def check_pickle_dtype(self,level=rlevel): + """Ticket #251""" + import pickle + pickle.dumps(N.float) + def check_masked_array_multiply(self,level=rlevel): """Ticket #254""" a = N.ma.zeros((4,1)) From numpy-svn at scipy.org Thu Sep 7 20:18:35 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Sep 2006 19:18:35 -0500 (CDT) Subject: [Numpy-svn] r3136 - trunk/numpy/core/tests Message-ID: <20060908001835.354A739C012@new.scipy.org> Author: stefan Date: 2006-09-07 19:18:21 -0500 (Thu, 07 Sep 2006) New Revision: 3136 Modified: trunk/numpy/core/tests/test_regression.py Log: Add ticket for ticket #243. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-08 00:11:23 UTC (rev 3135) +++ trunk/numpy/core/tests/test_regression.py 2006-09-08 00:18:21 UTC (rev 3136) @@ -348,6 +348,13 @@ assert_equal(N.array([[],[],[]],dtype=object).shape, (3,0)) assert_equal(N.array([[3,4],[5,6],None],dtype=object).shape, (3,)) + def check_mem_around(self,level=rlevel): + """Ticket #243""" + x = N.zeros((1,)) + y = [0] + decimal = 6 + N.around(abs(x-y),decimal) <= 10.0**(-decimal) + def check_character_array_strip(self,level=rlevel): """Ticket #246""" x = N.char.array(("x","x ","x ")) From numpy-svn at scipy.org Fri Sep 8 04:29:40 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 8 Sep 2006 03:29:40 -0500 (CDT) Subject: [Numpy-svn] r3137 - in trunk/numpy/f2py/lib: . research/rat Message-ID: <20060908082940.D64FA39C080@new.scipy.org> Author: pearu Date: 2006-09-08 03:29:12 -0500 (Fri, 08 Sep 2006) New Revision: 3137 Added: trunk/numpy/f2py/lib/analyzefortran.py Modified: trunk/numpy/f2py/lib/block_statements.py trunk/numpy/f2py/lib/parsefortran.py trunk/numpy/f2py/lib/research/rat/rational.f90 trunk/numpy/f2py/lib/statements.py trunk/numpy/f2py/lib/test_parser.py trunk/numpy/f2py/lib/typedecl_statements.py Log: Add analyze fortran hooks. Added: trunk/numpy/f2py/lib/analyzefortran.py =================================================================== --- trunk/numpy/f2py/lib/analyzefortran.py 2006-09-08 00:18:21 UTC (rev 3136) +++ trunk/numpy/f2py/lib/analyzefortran.py 2006-09-08 08:29:12 UTC (rev 3137) @@ -0,0 +1,134 @@ +#!/usr/bin/env python +""" +Defines FortranAnalyzer. + +Permission to use, modify, and distribute this software is given under the +terms of the NumPy License. See http://scipy.org. +NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + +Author: Pearu Peterson +Created: June 2006 +""" + +from numpy.distutils.misc_util import yellow_text, red_text + +class FortranAnalyzer: + + def __init__(self, block): + """ + block is a BeginSource instance with relevant attributes: + name - reader name + content - a list of statements + Statements are either block statements or simple statements. + Block statements have the following relevant attributes: + name - block name + blocktype - statement name (equal to lowered statement class name) + content - a list of statements + Block statements may have additional attributes: + BeginSource: top + Module: + PythonModule: + Program: + BlockData: + Interface: isabstract, generic_spec + Subroutine: prefix, args, suffix + Function: prefix, typedecl, args, suffix + Select: expr + Where: expr + Forall: specs + IfThen: expr + If: expr + Do: endlabel, loopcontrol + Associate: associations + Type: specs, params + Enum: + Simple statements have various attributes: + Assignment: variable, expr + PointerAssignment: variable, expr + Assign: items + Call: designator, items + Goto: label + ComputedGoto: items, expr + AssignedGoto: varname, items + Continue: label + Return: expr + Stop: code + Print: format, items + Read0: specs, items + Read1: format, items + Write: specs, items + Flush: specs + Wait: specs + Contains: + Allocate: spec, items + Deallocate: items + ModuleProcedure: items + Public | Private: items + Close: specs + Cycle: name + Rewind | Backspace | Endfile: specs + Open: specs + Format: specs + Save: items + Data: stmts + Nullify: items + Use: nature, name, isonly, items + Exit: name + Parameter: items + Equivalence: items + Dimension: items + Target: items + Pointer: items + Protected | Volatile | Value | Intrinsic | External | Optional: items + ArithmeticIf: expr, labels + Inquire: specs, items + Sequence: + Common: items + Intent: specs, items + Entry: name, items, result, binds + Import: items + Forall: specs, content + SpecificBinding: iname, attrs, name, bname + GenericBinding: aspec, spec, items + FinalBinding: items + Allocatable: items + Asynchronous: items + Bind: specs, items + Else: name + ElseIf: name, expr + Case: name, items + Else: name + ElseIf: name, expr + Case: name, items + Where: name, expr + ElseWhere: name, expr + Enumerator: items + FortranName: value + Threadsafe: + Depend: depends, items + Check: expr, value + CallStatement: expr + CallProtoArgument: specs + Pause: value + """ + self.block = block + print block.item + def analyze(self): + + pass + +def simple_main(): + import sys + from parsefortran import FortranParser + from readfortran import FortranFileReader + for filename in sys.argv[1:]: + reader = FortranFileReader(filename) + print yellow_text('Processing '+filename+' (mode=%r)' % (reader.mode)) + parser = FortranParser(reader) + block = parser.parse() + analyzer = FortranAnalyzer(block) + r = analyzer.analyze() + print r + +if __name__ == "__main__": + simple_main() Modified: trunk/numpy/f2py/lib/block_statements.py =================================================================== --- trunk/numpy/f2py/lib/block_statements.py 2006-09-08 00:18:21 UTC (rev 3136) +++ trunk/numpy/f2py/lib/block_statements.py 2006-09-08 08:29:12 UTC (rev 3137) @@ -8,40 +8,59 @@ from base_classes import BeginStatement, EndStatement, Statement,\ AttributeHolder, ProgramBlock from readfortran import Line -from utils import filter_stmts, parse_bind, parse_result +from utils import filter_stmts, parse_bind, parse_result, AnalyzeError class HasImplicitStmt: - a = AttributeHolder(implicit_rules = None) + a = AttributeHolder(implicit_rules = {}) def get_type(self, name): implicit_rules = self.a.implicit_rules - if implicit_rules=={}: - raise ValueError,'Implicit rules mapping is null' + if implicit_rules is None: + raise AnalyzeError,'Implicit rules mapping is null' l = name[0].lower() if implicit_rules.has_key(l): return implicit_rules[l] - # default rules + # default rules: if l in 'ijklmn': - return implicit_rules['default_integer'] - return implicit_rules['default_real'] + l = 'default_integer' + else: + l = 'default_real' + t = implicit_rules.get(l, None) + if t is None: + if l[8:]=='real': + implicit_rules[l] = t = Real(self, self.item.copy('real')) + else: + implicit_rules[l] = t = Integer(self, self.item.copy('integer')) + return t - def initialize(self): + def topyf(self, tab=' '): implicit_rules = self.a.implicit_rules - if implicit_rules is not None: - return - self.a.implicit_rules = implicit_rules = {} - real = Real(self, self.item.copy('real')) - assert real.isvalid - integer = Integer(self, self.item.copy('integer')) - assert integer.isvalid - implicit_rules['default_real'] = real - implicit_rules['default_integer'] = integer - return + if implicit_rules is None: + return tab + 'IMPLICIT NONE\n' + items = {} + for c,t in implicit_rules.items(): + if c.startswith('default'): + continue + st = t.tostr() + if items.has_key(st): + items[st].append(c) + else: + items[st] = [c] + if not items: + return tab + '! default IMPLICIT rules apply\n' + s = 'IMPLICIT' + ls = [] + for st,l in items.items(): + l.sort() + ls.append(st + ' (%s)' % (', '.join(l))) + s += ' ' + ', '.join(ls) + return tab + s + '\n' class HasUseStmt: - a = AttributeHolder(use = {}) + a = AttributeHolder(use = {}, + use_provides = {}) def get_entity(self, name): for modname, modblock in self.top.a.module.items(): @@ -49,23 +68,40 @@ if getattr(stmt,'name','') == name: return stmt return - - def initialize(self): - - return + def topyf(self): + pass + class HasVariables: a = AttributeHolder(variables = {}) + def topyf(self,tab=''): + s = '' + for name, var in self.a.variables.items(): + s += tab + str(var) + '\n' + return s + class HasTypeDecls: a = AttributeHolder(type_decls = {}) + def topyf(self, tab=''): + s = '' + for name, stmt in self.a.type_decls.items(): + s += stmt.topyf(tab=' '+tab) + return s + class HasAttributes: a = AttributeHolder(attributes = []) + def topyf(self, tab=''): + s = '' + for attr in self.a.attributes: + s += tab + attr + '\n' + return s + class HasModuleProcedures: a = AttributeHolder(module_procedures = []) @@ -136,6 +172,15 @@ return return BeginStatement.process_subitem(self, item) + def topyf(self, tab=''): # XXXX + s = '' + for name, stmt in self.a.module.items(): + s += stmt.topyf() + for name, stmt in self.a.external_subprogram.items(): + s += stmt.topyf() + for name, stmt in self.a.blockdata.items(): + s += stmt.topyf() + return s # Module class EndModule(EndStatement): @@ -166,12 +211,6 @@ def analyze(self): content = self.content[:] - [stmt.analyze() for stmt in filter_stmts(content, Use)] - HasUseStmt.initialize(self) - - [stmt.analyze() for stmt in filter_stmts(content, Implicit)] - HasImplicitStmt.initialize(self) - while content: stmt = content.pop(0) if isinstance(stmt, Contains): @@ -188,6 +227,17 @@ return + def topyf(self, tab=''): + s = tab + 'MODULE '+self.name + '\n' + s += HasImplicitStmt.topyf(self, tab=tab+' ') + s += HasTypeDecls.topyf(self, tab=tab+' ') + s += HasVariables.topyf(self, tab=tab+' ') + s += tab + ' CONTAINS\n' + for name, stmt in self.a.module_subprogram.items(): + s += stmt.topyf(tab=tab+' ') + s += tab + 'END MODULE ' + self.name + '\n' + return s + # Python Module class EndPythonModule(EndStatement): @@ -219,7 +269,8 @@ """ match = re.compile(r'end(\s*program\s*\w*|)\Z', re.I).match -class Program(BeginStatement, ProgramBlock, HasAttributes, +class Program(BeginStatement, ProgramBlock, + HasAttributes, HasImplicitStmt, HasUseStmt): """ PROGRAM [name] """ @@ -312,7 +363,8 @@ class SubProgramStatement(BeginStatement, ProgramBlock, HasImplicitStmt, HasAttributes, - HasUseStmt, HasVariables, HasTypeDecls + HasUseStmt, + HasVariables, HasTypeDecls ): """ [ ] [ ( ) ] [ ] @@ -377,6 +429,9 @@ def analyze(self): content = self.content[:] + if self.prefix: + self.a.attributes.extend(prefix.upper().split()) + variables = self.a.variables for a in self.args: assert not variables.has_key(a) @@ -384,14 +439,10 @@ variables[a] = Variable(self, a) if isinstance(self, Function): - variables[self.result] = Variable(self, self.result) + var = variables[self.result] = Variable(self, self.result) + if self.typedecl is not None: + var.set_type(self.typedecl) - [stmt.analyze() for stmt in filter_stmts(content, Use)] - HasUseStmt.initialize(self) - - [stmt.analyze() for stmt in filter_stmts(content, Implicit)] - HasImplicitStmt.initialize(self) - while content: stmt = content.pop(0) if isinstance(stmt, Contains): @@ -404,11 +455,24 @@ continue else: stmt.analyze() + if content: self.show_message('Not analyzed content: %s' % content) return + def topyf(self, tab=''): + s = tab + self.__class__.__name__.upper() + s += ' ' + self.name + ' (%s)' % (', '.join(self.args)) + if isinstance(self, Function) and self.result != self.name: + s += ' RESULT (%s)' % (self.result) + s += '\n' + s += HasImplicitStmt.topyf(self, tab=tab+' ') + s += HasTypeDecls.topyf(self, tab=tab+' ') + s += HasVariables.topyf(self, tab=tab+' ') + s += tab + 'END ' + self.__class__.__name__.upper() + ' ' + self.name + '\n' + return s + class EndSubroutine(EndStatement): """ END [SUBROUTINE [name]] @@ -728,14 +792,16 @@ class Type(BeginStatement, HasVariables, HasAttributes): """ - TYPE [ [, ] ::] [ ( ) ] + TYPE [ [ , ] :: ] [ ( ) ] = | EXTENDS ( ) | ABSTRACT | BIND(C) """ match = re.compile(r'type\b\s*').match end_stmt_cls = EndType - is_name = re.compile(r'\w+\Z').match + a = AttributeHolder(extends = None, + parameters = []) + def process_item(self): line = self.item.get_line()[4:].lstrip() if line.startswith('('): @@ -753,11 +819,11 @@ if i!=-1: self.name = line[:i].rstrip() assert line[-1]==')',`line` - self.params = line[i+1:-1].lstrip() + self.params = split_comma(line[i+1:-1].lstrip()) else: self.name = line - self.params = '' - if not self.is_name(self.name): + self.params = [] + if not is_name(self.name): self.isvalid = False return return BeginStatement.process_item(self) @@ -768,7 +834,7 @@ s += ', '.join(['']+self.specs) + ' ::' s += ' ' + self.name if self.params: - s += ' ('+self.params+')' + s += ' ('+', '.join(self.params)+')' return s def get_classes(self): @@ -777,10 +843,45 @@ def analyze(self): BeginStatement.analyze(self) - assert isinstance(self.parent,HasTypeDecls) + for spec in self.specs: + i = spec.find('(') + if i!=-1: + assert spec.endswith(')'),`spec` + s = spec[:i].rstrip().upper() + n = spec[i+1:-1].strip() + if s=='EXTENDS': + self.a.extends = n + continue + elif s=='BIND': + args,rest = parse_bind(spec) + assert not rest,`rest` + spec = 'BIND(%s)' % (', '.join(args)) + else: + spec = '%s(%s)' % (s,n) + self.warning('Unknown type-attr-spec %r' % (spec)) + else: + spec = spec.upper() + if spec not in ['PUBLIC', 'PRIVATE', 'ABSTRACT']: + self.warning('Unknown type-attr-spec %r' % (spec)) + self.a.attributes.append(spec) + self.a.parameters.extend(self.params) + assert isinstance(self.parent,HasTypeDecls),`self.parent.__class__` self.parent.a.type_decls[self.name] = self return + def topyf(self, tab=''): + s = tab + 'TYPE' + if self.a.extends is not None: + s += ', EXTENDS(%s) ::' % (self.a.extends) + s += ' ' + self.name + if self.a.parameters: + s += ' (%s)' % (', '.join(self.a.parameters)) + s += '\n' + s += HasAttributes.topyf(self, tab=tab+' ') + s += HasVariables.topyf(self, tab=tab+' ') + s += tab + 'END TYPE ' + self.name + '\n' + return s + TypeDecl = Type # Enum Modified: trunk/numpy/f2py/lib/parsefortran.py =================================================================== --- trunk/numpy/f2py/lib/parsefortran.py 2006-09-08 00:18:21 UTC (rev 3136) +++ trunk/numpy/f2py/lib/parsefortran.py 2006-09-08 08:29:12 UTC (rev 3137) @@ -156,6 +156,7 @@ parser = FortranParser(reader) parser.parse() parser.analyze() + print parser.block.topyf() #print parser.block def profile_main(): Modified: trunk/numpy/f2py/lib/research/rat/rational.f90 =================================================================== --- trunk/numpy/f2py/lib/research/rat/rational.f90 2006-09-08 00:18:21 UTC (rev 3136) +++ trunk/numpy/f2py/lib/research/rat/rational.f90 2006-09-08 08:29:12 UTC (rev 3137) @@ -18,6 +18,7 @@ end function rat_create subroutine rat_set(obj, n, d) + implicit none type(rat_struct) :: obj integer :: n,d print*,'In rat_set' Modified: trunk/numpy/f2py/lib/statements.py =================================================================== --- trunk/numpy/f2py/lib/statements.py 2006-09-08 00:18:21 UTC (rev 3136) +++ trunk/numpy/f2py/lib/statements.py 2006-09-08 08:29:12 UTC (rev 3137) @@ -156,10 +156,12 @@ def analyze(self): a = self.programblock.a + variables = a.variables if hasattr(a, 'external'): external = a.external if self.designator in external: print 'Need to analyze:',self + print self return class Goto(Statement): @@ -853,7 +855,7 @@ fn = get_module_file(self.name, d) if fn is not None: break - if 1 and fn is not None: + if fn is not None: from readfortran import FortranFileReader from parsefortran import FortranParser self.info('looking module information from %r' % (fn)) @@ -866,6 +868,11 @@ if not modules.has_key(self.name): self.warning('no information about the use module %r' % (self.name)) + return + + use_provides = self.parent.a.use_provides + + return class Exit(Statement): Modified: trunk/numpy/f2py/lib/test_parser.py =================================================================== --- trunk/numpy/f2py/lib/test_parser.py 2006-09-08 00:18:21 UTC (rev 3136) +++ trunk/numpy/f2py/lib/test_parser.py 2006-09-08 08:29:12 UTC (rev 3137) @@ -283,10 +283,10 @@ assert_equal(parse(Optional,'optional a , b'),'OPTIONAL a, b') def check_intent(self): - assert_equal(parse(Intent,'intent (in) a'),'INTENT (in) a') - assert_equal(parse(Intent,'intent(in)::a'),'INTENT (in) a') - assert_equal(parse(Intent,'intent(in) a , b'),'INTENT (in) a, b') - assert_equal(parse(Intent,'intent (in, out) a'),'INTENT (in, out) a') + assert_equal(parse(Intent,'intent (in) a'),'INTENT (IN) a') + assert_equal(parse(Intent,'intent(in)::a'),'INTENT (IN) a') + assert_equal(parse(Intent,'intent(in) a , b'),'INTENT (IN) a, b') + assert_equal(parse(Intent,'intent (in, out) a'),'INTENT (IN, OUT) a') def check_entry(self): assert_equal(parse(Entry,'entry a'), 'ENTRY a') @@ -297,7 +297,7 @@ 'ENTRY a BIND (C, NAME = "a b")') assert_equal(parse(Entry,'entry a result (b)'), 'ENTRY a RESULT (b)') assert_equal(parse(Entry,'entry a bind(d) result (b)'), - 'ENTRY a RESULT (b) BIND (d)') + 'ENTRY a RESULT (b) BIND (D)') assert_equal(parse(Entry,'entry a result (b) bind( c )'), 'ENTRY a RESULT (b) BIND (C)') assert_equal(parse(Entry,'entry a(b,*) result (g)'), @@ -475,6 +475,9 @@ assert_equal(parse(Implicit,'implicit'),'IMPLICIT NONE') assert_equal(parse(Implicit,'implicit integer (i-m)'), 'IMPLICIT INTEGER ( i-m )') - + assert_equal(parse(Implicit,'implicit integer (i-m,p,q-r)'), + 'IMPLICIT INTEGER ( i-m, p, q-r )') + assert_equal(parse(Implicit,'implicit integer (i-m), real (z)'), + 'IMPLICIT INTEGER ( i-m ), REAL ( z )') if __name__ == "__main__": NumpyTest().run() Modified: trunk/numpy/f2py/lib/typedecl_statements.py =================================================================== --- trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-08 00:18:21 UTC (rev 3136) +++ trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-08 08:29:12 UTC (rev 3137) @@ -390,10 +390,12 @@ implicit_rules = self.parent.a.implicit_rules if not self.items: if implicit_rules: - raise AnalyzeError,'IMPLICIT NONE implies emtpy implicit_rules'\ - ' but got %r' % (implicit_rules) + self.warning('overriding previously set implicit rule mapping'\ + ' %r.' % (implicit_rules)) + self.parent.a.implicit_rules = None return if implicit_rules is None: + self.warning('overriding previously set IMPLICIT NONE') self.parent.a.implicit_rules = implicit_rules = {} for stmt,specs in self.items: s,e = specs From numpy-svn at scipy.org Fri Sep 8 12:56:50 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 8 Sep 2006 11:56:50 -0500 (CDT) Subject: [Numpy-svn] r3138 - trunk/numpy/distutils Message-ID: <20060908165650.AEB0939C0D4@new.scipy.org> Author: rkern Date: 2006-09-08 11:56:50 -0500 (Fri, 08 Sep 2006) New Revision: 3138 Modified: trunk/numpy/distutils/ccompiler.py Log: Fix #198 Modified: trunk/numpy/distutils/ccompiler.py =================================================================== --- trunk/numpy/distutils/ccompiler.py 2006-09-08 08:29:12 UTC (rev 3137) +++ trunk/numpy/distutils/ccompiler.py 2006-09-08 16:56:50 UTC (rev 3138) @@ -198,7 +198,7 @@ # 'CCSHARED', 'LDSHARED', 'SO') try: self.compiler_so.remove('-Wstrict-prototypes') - except ValueError: + except (AttributeError, ValueError): pass if hasattr(self,'compiler') and self.compiler[0].find('cc')>=0: From numpy-svn at scipy.org Fri Sep 8 13:17:35 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 8 Sep 2006 12:17:35 -0500 (CDT) Subject: [Numpy-svn] r3139 - trunk/numpy/oldnumeric Message-ID: <20060908171735.C3BD339C084@new.scipy.org> Author: oliphant Date: 2006-09-08 12:17:31 -0500 (Fri, 08 Sep 2006) New Revision: 3139 Modified: trunk/numpy/oldnumeric/mlab.py Log: Fix functions in oldnumeric.mlab Modified: trunk/numpy/oldnumeric/mlab.py =================================================================== --- trunk/numpy/oldnumeric/mlab.py 2006-09-08 16:56:50 UTC (rev 3138) +++ trunk/numpy/oldnumeric/mlab.py 2006-09-08 17:17:31 UTC (rev 3139) @@ -12,6 +12,7 @@ from numpy.linalg import eig, svd from numpy.random import rand, randn +import numpy as nn from typeconv import convtypecode From numpy-svn at scipy.org Mon Sep 11 12:52:34 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 11 Sep 2006 11:52:34 -0500 (CDT) Subject: [Numpy-svn] r3140 - trunk/numpy/core/src Message-ID: <20060911165234.07F6839C0CA@new.scipy.org> Author: oliphant Date: 2006-09-11 11:52:31 -0500 (Mon, 11 Sep 2006) New Revision: 3140 Modified: trunk/numpy/core/src/ufuncobject.c Log: Fix ReplaceLoopBySignature. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-08 17:17:31 UTC (rev 3139) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-11 16:52:31 UTC (rev 3140) @@ -7,7 +7,8 @@ This supports mathematical (and Boolean) functions on arrays and other python objects. Math on large arrays of basic C types is rather efficient. - Travis E. Oliphant (2005-2006), oliphant at ee.byu.edu (oliphant.travis at ieee.org) + Travis E. Oliphant 2005, 2006 oliphant at ee.byu.edu (oliphant.travis at ieee.org) + Brigham Young University based on the @@ -3030,20 +3031,23 @@ PyUFuncGenericFunction *oldfunc) { int i,j; + int res = -1; /* Find the location of the matching signature */ for (i=0; intypes; i++) { for (j=0; jnargs; j++) { if (signature[j] == func->types[i*func->nargs+j]) break; } - if (j >= func->nargs) return -1; + if (j >= func->nargs) continue; if (oldfunc != NULL) { *oldfunc = func->functions[i]; } func->functions[i] = newfunc; + res = 0; + break; } - return -1; + return res; } From numpy-svn at scipy.org Mon Sep 11 18:32:41 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 11 Sep 2006 17:32:41 -0500 (CDT) Subject: [Numpy-svn] r3141 - trunk/numpy/random/mtrand Message-ID: <20060911223241.30AF639C00D@new.scipy.org> Author: rkern Date: 2006-09-11 17:32:39 -0500 (Mon, 11 Sep 2006) New Revision: 3141 Modified: trunk/numpy/random/mtrand/mtrand.c trunk/numpy/random/mtrand/mtrand.pyx Log: Pass the converted array arguments instead of the scalars. Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2006-09-11 16:52:31 UTC (rev 3140) +++ trunk/numpy/random/mtrand/mtrand.c 2006-09-11 22:32:39 UTC (rev 3141) @@ -1,16 +1,10 @@ -/* Generated by Pyrex 0.9.4.1 on Tue Aug 1 14:19:59 2006 */ +/* Generated by Pyrex 0.9.3.1 on Mon Sep 11 17:34:30 2006 */ #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -__PYX_EXTERN_C double pow(double, double); #include "string.h" #include "math.h" #include "numpy/arrayobject.h" @@ -38,10 +32,11 @@ static PyObject *__pyx_b; static int __pyx_lineno; static char *__pyx_filename; -static char **__pyx_f; +staticforward char **__pyx_f; /* Declarations from mtrand */ +staticforward PyTypeObject __pyx_type_6mtrand_RandomState; struct __pyx_obj_6mtrand_RandomState { PyObject_HEAD @@ -187,13 +182,13 @@ PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_size); - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":128 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":128 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":129 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":129 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -202,7 +197,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":131 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":131 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -217,34 +212,34 @@ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); + Py_INCREF(((PyObject *)__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":132 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":132 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":133 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":133 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":134 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":134 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":135 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); __pyx_L3:; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":136 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":136 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -281,35 +276,35 @@ 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); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + __pyx_v_itera = Py_None; Py_INCREF((PyObject *) __pyx_v_itera); + __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":148 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":148 */ __pyx_v_scalar = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":149 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":149 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":150 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":150 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":151 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":151 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":153 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":153 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":154 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":154 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":155 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":155 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -318,33 +313,33 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":157 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":157 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":158 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":158 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":159 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":159 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":160 */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":160 */ + __pyx_2 = PyArray_IterNew(((PyObject *)((PyObject *)__pyx_v_oa))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_itera)); - __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); + __pyx_v_itera = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":161 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":161 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":162 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":162 */ (__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":163 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":163 */ PyArray_ITER_NEXT(__pyx_v_itera); __pyx_L5:; } @@ -355,7 +350,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":165 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":165 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -370,25 +365,25 @@ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); + Py_INCREF(((PyObject *)__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":166 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":166 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":167 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":167 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":168 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":168 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":169 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":170 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":170 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); __pyx_L8:; } @@ -397,18 +392,18 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":172 */ - __pyx_3 = PyArray_MultiIterNew(2,((void (*))arrayObject),((void (*))__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":172 */ + __pyx_3 = PyArray_MultiIterNew(2,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_3)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); + __pyx_v_multi = ((PyObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":174 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":174 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":175 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":175 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} Py_INCREF(__pyx_k60p); @@ -423,17 +418,17 @@ } __pyx_L10:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":176 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":176 */ __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":177 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":177 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":178 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":178 */ (__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":179 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":179 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); __pyx_L11:; } @@ -443,12 +438,12 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":180 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":180 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -487,40 +482,40 @@ 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); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":193 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":193 */ __pyx_v_scalar = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":194 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":194 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_ob->nd == 0); } if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":195 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":195 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":196 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":196 */ __pyx_v_ob_data = ((double (*))__pyx_v_ob->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":197 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":197 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":199 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":200 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":200 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":201 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":201 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -529,37 +524,37 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":203 */ - __pyx_2 = PyArray_MultiIterNew(2,((void (*))__pyx_v_oa),((void (*))__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":203 */ + __pyx_2 = PyArray_MultiIterNew(2,((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); + __pyx_v_multi = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":204 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":204 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":205 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":205 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":206 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":206 */ __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":207 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":207 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":208 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":208 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":209 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":209 */ (__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":210 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":210 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -570,7 +565,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":212 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":212 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -585,25 +580,25 @@ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); + Py_INCREF(((PyObject *)__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":213 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":213 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":214 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":214 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":215 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":215 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":216 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":216 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":217 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":217 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); __pyx_L8:; } @@ -612,18 +607,18 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":219 */ - __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 = 219; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":219 */ + __pyx_4 = PyArray_MultiIterNew(3,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_4)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); + __pyx_v_multi = ((PyObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":220 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":220 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":221 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":221 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} Py_INCREF(__pyx_k61p); @@ -638,23 +633,23 @@ } __pyx_L10:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":222 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":222 */ __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":223 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":223 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":224 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":224 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":225 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":225 */ (__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":226 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":226 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":227 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":227 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); __pyx_L11:; } @@ -664,12 +659,12 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":228 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":228 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -710,13 +705,13 @@ 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); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":243 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":243 */ __pyx_v_scalar = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":244 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":244 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_ob->nd == 0); @@ -726,30 +721,30 @@ } if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":245 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":245 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":246 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":246 */ __pyx_v_ob_data = ((double (*))__pyx_v_ob->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":247 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":247 */ __pyx_v_oc_data = ((double (*))__pyx_v_oc->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":248 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":248 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":250 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":250 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":251 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":251 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":252 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":252 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -758,40 +753,40 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":254 */ - __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 = 254; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":254 */ + __pyx_2 = PyArray_MultiIterNew(3,((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob)),((void (*))((PyObject *)__pyx_v_oc))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); + __pyx_v_multi = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":255 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":255 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":256 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":256 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":257 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":257 */ __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":258 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":258 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":259 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":259 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":260 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":260 */ __pyx_v_oc_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":261 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":261 */ (__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":262 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":262 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -802,7 +797,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":264 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":264 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -817,25 +812,25 @@ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); + Py_INCREF(((PyObject *)__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":265 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":265 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":266 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":266 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":267 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":267 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":268 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":268 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":269 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":269 */ (__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])); __pyx_L8:; } @@ -844,18 +839,18 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":271 */ - __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 = 271; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":271 */ + __pyx_4 = PyArray_MultiIterNew(4,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob)),((void (*))((PyObject *)__pyx_v_oc))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_4)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); + __pyx_v_multi = ((PyObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":273 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":273 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":274 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":274 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;} Py_INCREF(__pyx_k62p); @@ -870,23 +865,23 @@ } __pyx_L10:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":275 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":275 */ __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":276 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":276 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":277 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":277 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":278 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":278 */ __pyx_v_oc_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":279 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":279 */ (__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":280 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":280 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L11:; } @@ -896,12 +891,12 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":281 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":281 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -932,13 +927,13 @@ PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_size); - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":289 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":289 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":290 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":290 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -947,7 +942,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":292 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":292 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -960,34 +955,34 @@ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":293 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":293 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":294 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":294 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":295 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":295 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":296 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":296 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); __pyx_L3:; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":297 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":297 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1023,40 +1018,40 @@ 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); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":309 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":309 */ __pyx_v_scalar = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":310 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":310 */ __pyx_1 = (__pyx_v_on->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_op->nd == 0); } if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":311 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":311 */ __pyx_v_on_data = ((long (*))__pyx_v_on->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":312 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":312 */ __pyx_v_op_data = ((double (*))__pyx_v_op->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":313 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":313 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":315 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":315 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":316 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":316 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":317 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":317 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -1065,37 +1060,37 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":319 */ - __pyx_2 = PyArray_MultiIterNew(2,((void (*))__pyx_v_on),((void (*))__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":319 */ + __pyx_2 = PyArray_MultiIterNew(2,((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_op))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); + __pyx_v_multi = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":320 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":320 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":321 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":321 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":322 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":322 */ __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":323 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":323 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":324 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":324 */ __pyx_v_op_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":325 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":325 */ (__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":326 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":326 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -1106,7 +1101,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":328 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":328 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1119,25 +1114,25 @@ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":329 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":329 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":330 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":330 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":331 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":331 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":332 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":332 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":333 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":333 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); __pyx_L8:; } @@ -1146,18 +1141,18 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":335 */ - __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 = 335; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":335 */ + __pyx_4 = PyArray_MultiIterNew(3,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_op))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_4)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); + __pyx_v_multi = ((PyObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":336 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":336 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":337 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":337 */ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} Py_INCREF(__pyx_k63p); @@ -1172,23 +1167,23 @@ } __pyx_L10:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":338 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":338 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":339 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":339 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":340 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":340 */ __pyx_v_op_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":341 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":341 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":342 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":342 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":343 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":343 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); __pyx_L11:; } @@ -1198,12 +1193,12 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":345 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":345 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1244,13 +1239,13 @@ 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); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":359 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":359 */ __pyx_v_scalar = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":360 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":360 */ __pyx_1 = (__pyx_v_on->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_om->nd == 0); @@ -1260,30 +1255,30 @@ } if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":361 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":361 */ __pyx_v_scalar = 1; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":362 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":362 */ __pyx_v_on_data = ((long (*))__pyx_v_on->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":363 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":363 */ __pyx_v_om_data = ((long (*))__pyx_v_om->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":364 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":364 */ __pyx_v_oN_data = ((long (*))__pyx_v_oN->data); goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":366 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":366 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":367 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":367 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":368 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":368 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -1292,40 +1287,40 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":370 */ - __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 = 370; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":370 */ + __pyx_2 = PyArray_MultiIterNew(3,((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_om)),((void (*))((PyObject *)__pyx_v_oN))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); + __pyx_v_multi = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":371 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":371 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":372 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":372 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":373 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":373 */ __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":374 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":374 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":375 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":375 */ __pyx_v_om_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":376 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":376 */ __pyx_v_oN_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":377 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":377 */ (__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":378 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":378 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -1336,7 +1331,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":380 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":380 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1349,25 +1344,25 @@ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":381 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":381 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":382 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":382 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":383 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":383 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":384 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":384 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":385 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":385 */ (__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])); __pyx_L8:; } @@ -1376,18 +1371,18 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":387 */ - __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 = 387; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":387 */ + __pyx_4 = PyArray_MultiIterNew(4,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_om)),((void (*))((PyObject *)__pyx_v_oN))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_4)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); + __pyx_v_multi = ((PyObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":389 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":389 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":390 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":390 */ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} Py_INCREF(__pyx_k64p); @@ -1402,23 +1397,23 @@ } __pyx_L10:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":391 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":391 */ __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":392 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":392 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":393 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":393 */ __pyx_v_om_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":394 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":394 */ __pyx_v_oN_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":395 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":395 */ (__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":396 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":396 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L11:; } @@ -1428,12 +1423,12 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":398 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":398 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1472,35 +1467,35 @@ 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); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); + __pyx_v_itera = Py_None; Py_INCREF((PyObject *) __pyx_v_itera); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":410 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":410 */ __pyx_v_scalar = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":411 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":411 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":412 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":412 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":413 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":413 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":415 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":415 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":416 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":416 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":417 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":417 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -1509,33 +1504,33 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":419 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":419 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":420 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":420 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":421 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":421 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":422 */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":422 */ + __pyx_2 = PyArray_IterNew(((PyObject *)((PyObject *)__pyx_v_oa))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_itera)); - __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); + __pyx_v_itera = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":423 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":423 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":424 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":424 */ (__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":425 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":425 */ PyArray_ITER_NEXT(__pyx_v_itera); __pyx_L5:; } @@ -1546,7 +1541,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":427 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":427 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1559,25 +1554,25 @@ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__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":428 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":428 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":429 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":429 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":430 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":430 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":431 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":431 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":432 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":432 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); __pyx_L8:; } @@ -1586,18 +1581,18 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":434 */ - __pyx_3 = PyArray_MultiIterNew(2,((void (*))arrayObject),((void (*))__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":434 */ + __pyx_3 = PyArray_MultiIterNew(2,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_3)); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); + __pyx_v_multi = ((PyObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":435 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":435 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":436 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":436 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} Py_INCREF(__pyx_k65p); @@ -1612,17 +1607,17 @@ } __pyx_L10:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":437 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":437 */ __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":438 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":438 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":439 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":439 */ (__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":440 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":440 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); __pyx_L11:; } @@ -1632,12 +1627,12 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":441 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":441 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1662,31 +1657,31 @@ long __pyx_v_i; double __pyx_r; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":446 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":446 */ __pyx_v_sum = (__pyx_v_darr[0]); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":447 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":447 */ __pyx_v_c = 0.0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":448 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":448 */ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":449 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":449 */ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":450 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":450 */ __pyx_v_t = (__pyx_v_sum + __pyx_v_y); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":451 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":451 */ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":452 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":452 */ __pyx_v_sum = __pyx_v_t; __pyx_L2:; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":453 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":453 */ __pyx_r = __pyx_v_sum; goto __pyx_L0; @@ -1711,10 +1706,10 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_seed); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":476 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":476 */ ((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":478 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":478 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); @@ -1743,14 +1738,14 @@ int __pyx_1; Py_INCREF(__pyx_v_self); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":481 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":481 */ __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":482 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":482 */ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":483 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":483 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = 0; goto __pyx_L2; } @@ -1782,13 +1777,13 @@ 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); + arrayObject_obj = Py_None; Py_INCREF((PyObject *) arrayObject_obj); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":497 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":497 */ __pyx_1 = __pyx_v_seed == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":498 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":498 */ __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } @@ -1805,26 +1800,26 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":500 */ - __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":500 */ + __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; 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":502 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":502 */ __pyx_3 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); + Py_INCREF(((PyObject *)__pyx_3)); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":503 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":503 */ 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); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1854,9 +1849,9 @@ 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); + arrayObject_state = Py_None; Py_INCREF((PyObject *) arrayObject_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":512 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":512 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -1870,15 +1865,15 @@ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__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":513 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":513 */ memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long )))); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":514 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":514 */ __pyx_3 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} Py_INCREF(__pyx_n_MT19937); @@ -1891,7 +1886,7 @@ __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -1929,11 +1924,11 @@ 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); + arrayObject_obj = Py_None; Py_INCREF((PyObject *) arrayObject_obj); + __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name); + __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":525 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":525 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -1941,12 +1936,12 @@ __pyx_v_algorithm_name = __pyx_2; __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":526 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":526 */ if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; if (__pyx_3) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":527 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":527 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} Py_INCREF(__pyx_k68p); @@ -1961,7 +1956,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":528 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":528 */ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} Py_DECREF(__pyx_v_key); @@ -1974,18 +1969,18 @@ if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":529 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":529 */ __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); + Py_INCREF(((PyObject *)__pyx_4)); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":530 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":530 */ __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624); if (__pyx_3) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":531 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":531 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_INCREF(__pyx_k69p); @@ -2000,13 +1995,13 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":532 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":532 */ memcpy(((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":533 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":533 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2033,7 +2028,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":537 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":537 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} @@ -2043,7 +2038,7 @@ __pyx_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2068,7 +2063,7 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":540 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":540 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; goto __pyx_L1;} Py_INCREF(__pyx_v_state); @@ -2078,7 +2073,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2107,7 +2102,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":543 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":543 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2130,7 +2125,7 @@ __pyx_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2157,13 +2152,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":551 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":551 */ __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 = 551; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2187,13 +2182,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":558 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":558 */ __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 = 558; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2236,40 +2231,40 @@ Py_INCREF(__pyx_v_low); Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":573 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":573 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":574 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":574 */ __pyx_v_lo = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":575 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":575 */ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} __pyx_v_hi = __pyx_2; goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":577 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":577 */ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;} __pyx_v_lo = __pyx_2; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":578 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":578 */ __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} __pyx_v_hi = __pyx_2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":580 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":580 */ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":581 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":581 */ __pyx_1 = (__pyx_v_diff < 0); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":582 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":582 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;} Py_INCREF(__pyx_k70p); @@ -2284,11 +2279,11 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":584 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":584 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":585 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":585 */ __pyx_3 = PyLong_FromUnsignedLong((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 = 585; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; @@ -2297,7 +2292,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":587 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":587 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -2310,34 +2305,34 @@ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); + Py_INCREF(((PyObject *)__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":588 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":588 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":589 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":589 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":590 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":590 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":591 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":591 */ (__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))); __pyx_L5:; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":592 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":592 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L4:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); @@ -2363,31 +2358,31 @@ 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; + 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); + __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":600 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":600 */ __pyx_v_bytes = PyMem_Malloc(__pyx_v_length); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":601 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":601 */ 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":602 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":602 */ __pyx_1 = PyString_FromStringAndSize(((char (*))__pyx_v_bytes),__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;} Py_DECREF(__pyx_v_bytestring); __pyx_v_bytestring = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":603 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":603 */ PyMem_Free(__pyx_v_bytes); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":604 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":604 */ Py_INCREF(__pyx_v_bytestring); __pyx_r = __pyx_v_bytestring; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2424,26 +2419,26 @@ 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); + __pyx_v_olow = Py_None; Py_INCREF((PyObject *) __pyx_v_olow); + __pyx_v_ohigh = Py_None; Py_INCREF((PyObject *) __pyx_v_ohigh); + __pyx_v_odiff = Py_None; Py_INCREF((PyObject *) __pyx_v_odiff); + __pyx_v_temp = Py_None; Py_INCREF(__pyx_v_temp); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":615 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":615 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_olow)); - __pyx_v_olow = ((PyArrayObject *)__pyx_1); + __pyx_v_olow = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":616 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":616 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_ohigh)); - __pyx_v_ohigh = ((PyArrayObject *)__pyx_1); + __pyx_v_ohigh = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":617 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":617 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_subtract); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2459,23 +2454,23 @@ __pyx_v_temp = __pyx_3; __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":618 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":618 */ Py_INCREF(__pyx_v_temp); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":620 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":620 */ __pyx_2 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_odiff)); - __pyx_v_odiff = ((PyArrayObject *)__pyx_2); + __pyx_v_odiff = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":621 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":621 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2519,7 +2514,7 @@ } Py_INCREF(__pyx_v_self); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":634 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":634 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; goto __pyx_L1;} Py_INCREF(__pyx_v_args); @@ -2534,7 +2529,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":635 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":635 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} @@ -2547,7 +2542,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":637 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":637 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} @@ -2562,7 +2557,7 @@ } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2598,7 +2593,7 @@ } Py_INCREF(__pyx_v_self); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":649 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":649 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; goto __pyx_L1;} Py_INCREF(__pyx_v_args); @@ -2613,7 +2608,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":650 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":650 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} @@ -2626,7 +2621,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":652 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":652 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} Py_INCREF(__pyx_v_args); @@ -2640,7 +2635,7 @@ } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2676,16 +2671,16 @@ Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":661 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":661 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":662 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":662 */ Py_INCREF(__pyx_v_low); Py_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":663 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":663 */ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} Py_DECREF(__pyx_v_low); __pyx_v_low = __pyx_2; @@ -2694,7 +2689,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":664 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":664 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} @@ -2713,7 +2708,7 @@ __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -2741,13 +2736,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":672 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":672 */ __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 = 672; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2789,24 +2784,24 @@ 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); + __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":681 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":681 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_1); + __pyx_v_oloc = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":682 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":682 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":683 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":683 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2832,7 +2827,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":684 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":684 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} Py_INCREF(__pyx_k72p); @@ -2847,13 +2842,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":685 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":685 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2899,24 +2894,24 @@ 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); + __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); + __pyx_v_ob = Py_None; Py_INCREF((PyObject *) __pyx_v_ob); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":694 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":694 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_1); + __pyx_v_oa = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":695 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":695 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_ob)); - __pyx_v_ob = ((PyArrayObject *)__pyx_1); + __pyx_v_ob = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":697 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":697 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2942,7 +2937,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":698 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":698 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; goto __pyx_L1;} Py_INCREF(__pyx_k73p); @@ -2957,7 +2952,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":699 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":699 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -2983,7 +2978,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":700 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":700 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;} Py_INCREF(__pyx_k74p); @@ -2998,13 +2993,13 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":701 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":701 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_oa,__pyx_v_ob); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3046,16 +3041,16 @@ 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); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":709 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":709 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":710 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":710 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3081,7 +3076,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":711 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":711 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;} Py_INCREF(__pyx_k75p); @@ -3096,13 +3091,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":712 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":712 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3131,13 +3126,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":719 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":719 */ __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 = 719; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3171,16 +3166,16 @@ 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); + __pyx_v_oshape = Py_None; Py_INCREF((PyObject *) __pyx_v_oshape); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":727 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":727 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oshape)); - __pyx_v_oshape = ((PyArrayObject *)__pyx_1); + __pyx_v_oshape = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":728 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":728 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3206,7 +3201,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":729 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":729 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; goto __pyx_L1;} Py_INCREF(__pyx_k76p); @@ -3221,13 +3216,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":730 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":730 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3272,24 +3267,24 @@ 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); + __pyx_v_oshape = Py_None; Py_INCREF((PyObject *) __pyx_v_oshape); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":739 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":739 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oshape)); - __pyx_v_oshape = ((PyArrayObject *)__pyx_1); + __pyx_v_oshape = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":740 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":740 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":741 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":741 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3315,7 +3310,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":742 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":742 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;} Py_INCREF(__pyx_k77p); @@ -3330,7 +3325,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":743 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":743 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3356,7 +3351,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":744 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":744 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} Py_INCREF(__pyx_k78p); @@ -3371,13 +3366,13 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":745 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":745 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3423,24 +3418,24 @@ 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); + __pyx_v_odfnum = Py_None; Py_INCREF((PyObject *) __pyx_v_odfnum); + __pyx_v_odfden = Py_None; Py_INCREF((PyObject *) __pyx_v_odfden); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":754 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":754 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_odfnum)); - __pyx_v_odfnum = ((PyArrayObject *)__pyx_1); + __pyx_v_odfnum = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":755 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":755 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyArrayObject *)__pyx_1); + __pyx_v_odfden = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":756 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":756 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3466,7 +3461,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":757 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":757 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;} Py_INCREF(__pyx_k79p); @@ -3481,7 +3476,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":758 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":758 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3507,7 +3502,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":759 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":759 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} Py_INCREF(__pyx_k80p); @@ -3522,13 +3517,13 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":760 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":760 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3581,32 +3576,32 @@ 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); + __pyx_v_odfnum = Py_None; Py_INCREF((PyObject *) __pyx_v_odfnum); + __pyx_v_odfden = Py_None; Py_INCREF((PyObject *) __pyx_v_odfden); + __pyx_v_ononc = Py_None; Py_INCREF((PyObject *) __pyx_v_ononc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":770 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":770 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_odfnum)); - __pyx_v_odfnum = ((PyArrayObject *)__pyx_1); + __pyx_v_odfnum = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":771 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":771 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyArrayObject *)__pyx_1); + __pyx_v_odfden = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":772 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":772 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyArrayObject *)__pyx_1); + __pyx_v_ononc = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":774 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":774 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3632,7 +3627,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":775 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":775 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} Py_INCREF(__pyx_k81p); @@ -3647,7 +3642,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":776 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":776 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3673,7 +3668,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":777 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":777 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} Py_INCREF(__pyx_k82p); @@ -3688,7 +3683,7 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":778 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":778 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -3714,7 +3709,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":779 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":779 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} Py_INCREF(__pyx_k83p); @@ -3729,13 +3724,13 @@ } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":780 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":780 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3778,16 +3773,16 @@ 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); + __pyx_v_odf = Py_None; Py_INCREF((PyObject *) __pyx_v_odf); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":789 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":789 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyArrayObject *)__pyx_1); + __pyx_v_odf = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":790 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":790 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3813,7 +3808,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":791 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":791 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; goto __pyx_L1;} Py_INCREF(__pyx_k84p); @@ -3828,13 +3823,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":792 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":792 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3878,24 +3873,24 @@ 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); + __pyx_v_odf = Py_None; Py_INCREF((PyObject *) __pyx_v_odf); + __pyx_v_ononc = Py_None; Py_INCREF((PyObject *) __pyx_v_ononc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":801 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":801 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyArrayObject *)__pyx_1); + __pyx_v_odf = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":802 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":802 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyArrayObject *)__pyx_1); + __pyx_v_ononc = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":803 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":803 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3921,7 +3916,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":804 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":804 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; goto __pyx_L1;} Py_INCREF(__pyx_k85p); @@ -3936,7 +3931,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":805 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":805 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3962,7 +3957,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":806 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":806 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} Py_INCREF(__pyx_k86p); @@ -3977,13 +3972,13 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":807 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":807 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4014,13 +4009,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":815 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":815 */ __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 = 815; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4054,16 +4049,16 @@ 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); + __pyx_v_odf = Py_None; Py_INCREF((PyObject *) __pyx_v_odf); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":823 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":823 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyArrayObject *)__pyx_1); + __pyx_v_odf = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":824 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":824 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4089,7 +4084,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":825 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":825 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} Py_INCREF(__pyx_k87p); @@ -4104,13 +4099,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":826 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":826 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4152,24 +4147,24 @@ 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); + __pyx_v_omu = Py_None; Py_INCREF((PyObject *) __pyx_v_omu); + __pyx_v_okappa = Py_None; Py_INCREF((PyObject *) __pyx_v_okappa); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":836 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":836 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_omu)); - __pyx_v_omu = ((PyArrayObject *)__pyx_1); + __pyx_v_omu = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":837 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":837 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_okappa)); - __pyx_v_okappa = ((PyArrayObject *)__pyx_1); + __pyx_v_okappa = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":838 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":838 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4195,7 +4190,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":839 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":839 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} Py_INCREF(__pyx_k88p); @@ -4210,13 +4205,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":840 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":840 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4257,16 +4252,16 @@ 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); + __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":848 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":848 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_1); + __pyx_v_oa = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":849 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":849 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4292,7 +4287,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":850 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":850 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} Py_INCREF(__pyx_k89p); @@ -4307,13 +4302,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":851 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":851 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4351,18 +4346,18 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "d|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":859 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":859 */ __pyx_1 = PyFloat_FromDouble(__pyx_v_a); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} __pyx_2 = PyArray_FROM_OTF(__pyx_1,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_2); + __pyx_v_oa = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":860 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":860 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4388,7 +4383,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":861 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":861 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} Py_INCREF(__pyx_k90p); @@ -4403,13 +4398,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":862 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":862 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4446,18 +4441,18 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "d|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":870 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":870 */ __pyx_1 = PyFloat_FromDouble(__pyx_v_a); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;} __pyx_2 = PyArray_FROM_OTF(__pyx_1,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_INCREF(((PyObject *)__pyx_2)); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_2); + __pyx_v_oa = ((PyObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":871 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":871 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4483,7 +4478,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":872 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":872 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} Py_INCREF(__pyx_k91p); @@ -4498,13 +4493,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":873 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":873 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4547,24 +4542,24 @@ 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); + __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":882 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":882 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_1); + __pyx_v_oloc = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":883 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":883 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":884 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":884 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4590,7 +4585,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":885 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":885 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; goto __pyx_L1;} Py_INCREF(__pyx_k92p); @@ -4605,13 +4600,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":886 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":886 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4657,24 +4652,24 @@ 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); + __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":895 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":895 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_1); + __pyx_v_oloc = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":896 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":896 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":897 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":897 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4700,7 +4695,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":898 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":898 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; goto __pyx_L1;} Py_INCREF(__pyx_k93p); @@ -4715,13 +4710,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":899 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":899 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4767,24 +4762,24 @@ 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); + __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":908 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":908 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyArrayObject *)__pyx_1); + __pyx_v_oloc = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":909 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":909 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":910 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":910 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4810,7 +4805,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":911 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":911 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; goto __pyx_L1;} Py_INCREF(__pyx_k94p); @@ -4825,13 +4820,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":912 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":912 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4877,24 +4872,24 @@ 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); + __pyx_v_omean = Py_None; Py_INCREF((PyObject *) __pyx_v_omean); + __pyx_v_osigma = Py_None; Py_INCREF((PyObject *) __pyx_v_osigma); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":926 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":926 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); - __pyx_v_omean = ((PyArrayObject *)__pyx_1); + __pyx_v_omean = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":927 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":927 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_osigma)); - __pyx_v_osigma = ((PyArrayObject *)__pyx_1); + __pyx_v_osigma = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":928 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":928 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4920,7 +4915,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":929 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":929 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} Py_INCREF(__pyx_k95p); @@ -4935,15 +4930,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":930 */ - if (!__Pyx_TypeTest(__pyx_v_mean, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_v_sigma, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,((PyArrayObject *)__pyx_v_mean),((PyArrayObject *)__pyx_v_sigma)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":930 */ + __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4985,16 +4978,16 @@ 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); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":938 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":938 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":939 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":939 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5020,7 +5013,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":940 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":940 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} Py_INCREF(__pyx_k96p); @@ -5035,13 +5028,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":941 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":941 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5085,24 +5078,24 @@ 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); + __pyx_v_omean = Py_None; Py_INCREF((PyObject *) __pyx_v_omean); + __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":950 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":950 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); - __pyx_v_omean = ((PyArrayObject *)__pyx_1); + __pyx_v_omean = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":951 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":951 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_1); + __pyx_v_oscale = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":952 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":952 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5128,7 +5121,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":953 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":953 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} Py_INCREF(__pyx_k97p); @@ -5166,7 +5159,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":955 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":955 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} Py_INCREF(__pyx_k98p); @@ -5181,13 +5174,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":956 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":956 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5241,32 +5234,32 @@ 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); + __pyx_v_oleft = Py_None; Py_INCREF((PyObject *) __pyx_v_oleft); + __pyx_v_omode = Py_None; Py_INCREF((PyObject *) __pyx_v_omode); + __pyx_v_oright = Py_None; Py_INCREF((PyObject *) __pyx_v_oright); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":967 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":967 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oleft)); - __pyx_v_oleft = ((PyArrayObject *)__pyx_1); + __pyx_v_oleft = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":968 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":968 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_omode)); - __pyx_v_omode = ((PyArrayObject *)__pyx_1); + __pyx_v_omode = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":969 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":969 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oright)); - __pyx_v_oright = ((PyArrayObject *)__pyx_1); + __pyx_v_oright = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":971 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":971 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5291,7 +5284,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":972 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":972 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;} Py_INCREF(__pyx_k99p); @@ -5306,7 +5299,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":973 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":973 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5331,7 +5324,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":974 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":974 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} Py_INCREF(__pyx_k100p); @@ -5346,7 +5339,7 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":975 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":975 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5371,7 +5364,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":976 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":976 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;} Py_INCREF(__pyx_k101p); @@ -5386,13 +5379,13 @@ } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":977 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":977 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5442,24 +5435,24 @@ 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); + __pyx_v_on = Py_None; Py_INCREF((PyObject *) __pyx_v_on); + __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":988 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":988 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_on)); - __pyx_v_on = ((PyArrayObject *)__pyx_1); + __pyx_v_on = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":989 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":989 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_1); + __pyx_v_op = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":990 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":990 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5485,7 +5478,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":991 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":991 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} Py_INCREF(__pyx_k102p); @@ -5500,7 +5493,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":992 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":992 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -5526,7 +5519,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":993 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":993 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; goto __pyx_L1;} Py_INCREF(__pyx_k103p); @@ -5541,7 +5534,7 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":994 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":994 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -5567,7 +5560,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":995 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":995 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; goto __pyx_L1;} Py_INCREF(__pyx_k104p); @@ -5582,13 +5575,13 @@ } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":996 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":996 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5636,24 +5629,24 @@ 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); + __pyx_v_on = Py_None; Py_INCREF((PyObject *) __pyx_v_on); + __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1005 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1005 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_on)); - __pyx_v_on = ((PyArrayObject *)__pyx_1); + __pyx_v_on = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_1); + __pyx_v_op = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1007 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1007 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5679,7 +5672,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1008 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1008 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} Py_INCREF(__pyx_k105p); @@ -5694,7 +5687,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1009 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1009 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -5720,7 +5713,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; goto __pyx_L1;} Py_INCREF(__pyx_k106p); @@ -5735,7 +5728,7 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1011 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1011 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -5761,7 +5754,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1012 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1012 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; goto __pyx_L1;} Py_INCREF(__pyx_k107p); @@ -5776,13 +5769,13 @@ } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1013 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1013 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5824,16 +5817,16 @@ 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); + __pyx_v_olam = Py_None; Py_INCREF((PyObject *) __pyx_v_olam); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_olam)); - __pyx_v_olam = ((PyArrayObject *)__pyx_1); + __pyx_v_olam = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1023 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1023 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5859,7 +5852,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} Py_INCREF(__pyx_k108p); @@ -5874,13 +5867,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1025 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1025 */ __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_olam); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5919,16 +5912,16 @@ 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); + __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1033 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1033 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyArrayObject *)__pyx_1); + __pyx_v_oa = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1034 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1034 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5954,7 +5947,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1035 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1035 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; goto __pyx_L1;} Py_INCREF(__pyx_k109p); @@ -5969,13 +5962,13 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1036 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1036 */ __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6016,16 +6009,16 @@ 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); + __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1045 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1045 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_1); + __pyx_v_op = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1046 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1046 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6051,7 +6044,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1047 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1047 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__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_k110p); @@ -6066,7 +6059,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1048 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1048 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6092,7 +6085,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1049 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1049 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} Py_INCREF(__pyx_k111p); @@ -6107,13 +6100,13 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1050 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1050 */ __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 = 1050; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6167,32 +6160,32 @@ 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); + __pyx_v_ongood = Py_None; Py_INCREF((PyObject *) __pyx_v_ongood); + __pyx_v_onbad = Py_None; Py_INCREF((PyObject *) __pyx_v_onbad); + __pyx_v_onsample = Py_None; Py_INCREF((PyObject *) __pyx_v_onsample); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1066 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1066 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_ongood)); - __pyx_v_ongood = ((PyArrayObject *)__pyx_1); + __pyx_v_ongood = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_onbad)); - __pyx_v_onbad = ((PyArrayObject *)__pyx_1); + __pyx_v_onbad = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_onsample)); - __pyx_v_onsample = ((PyArrayObject *)__pyx_1); + __pyx_v_onsample = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1069 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1069 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6218,7 +6211,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} Py_INCREF(__pyx_k112p); @@ -6233,7 +6226,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1071 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1071 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6259,7 +6252,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} Py_INCREF(__pyx_k113p); @@ -6274,7 +6267,7 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1073 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1073 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6310,7 +6303,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} Py_INCREF(__pyx_k114p); @@ -6325,7 +6318,7 @@ } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1075 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1075 */ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; @@ -6351,7 +6344,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1076 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1076 */ __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;} Py_INCREF(__pyx_k115p); @@ -6366,13 +6359,13 @@ } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1077 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1077 */ __pyx_4 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ongood,__pyx_v_onbad,__pyx_v_onsample); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6418,16 +6411,16 @@ 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); + __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1086 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1086 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_1); + __pyx_v_op = ((PyObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6453,7 +6446,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1088 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1088 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} Py_INCREF(__pyx_k116p); @@ -6468,7 +6461,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1089 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1089 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6494,7 +6487,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1090 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1090 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} Py_INCREF(__pyx_k117p); @@ -6509,13 +6502,13 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1091 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1091 */ __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 = 1091; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6580,15 +6573,15 @@ 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); + __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape); + __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape); + __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x); + __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd); + __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u); + __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s); + __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1112 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1112 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6602,7 +6595,7 @@ __pyx_v_mean = __pyx_3; __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1113 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1113 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6616,11 +6609,11 @@ __pyx_v_cov = __pyx_2; __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1114 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1114 */ __pyx_4 = __pyx_v_size == Py_None; if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1115 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1115 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_1; @@ -6629,14 +6622,14 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1117 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1117 */ 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":1118 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1118 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} @@ -6652,7 +6645,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1119 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1119 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; goto __pyx_L1;} Py_INCREF(__pyx_k118p); @@ -6667,7 +6660,7 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1120 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1120 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;} @@ -6699,7 +6692,7 @@ } if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1121 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1121 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} Py_INCREF(__pyx_k119p); @@ -6714,7 +6707,7 @@ } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1122 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1122 */ __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} @@ -6731,7 +6724,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1123 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1123 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} Py_INCREF(__pyx_k120p); @@ -6746,7 +6739,7 @@ } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1125 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1125 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} @@ -6761,7 +6754,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1126 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1126 */ __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape); @@ -6772,7 +6765,7 @@ } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1127 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1127 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} @@ -6785,7 +6778,7 @@ __pyx_v_final_shape = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1128 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1128 */ __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} @@ -6800,7 +6793,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1132 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1132 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} @@ -6823,7 +6816,7 @@ __pyx_v_x = __pyx_5; __pyx_5 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1133 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1133 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6862,7 +6855,7 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1142 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1142 */ __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} Py_INCREF(__pyx_n_svd); PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd); @@ -6874,7 +6867,7 @@ __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1144 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1144 */ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} Py_INCREF(__pyx_v_cov); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov); @@ -6895,7 +6888,7 @@ if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_dot); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6922,7 +6915,7 @@ __pyx_v_x = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1148 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1148 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6938,7 +6931,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1149 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1149 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); @@ -6949,12 +6942,12 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1150 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1150 */ Py_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7013,12 +7006,12 @@ 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); + arrayObject_parr = Py_None; Py_INCREF((PyObject *) arrayObject_parr); + arrayObject_mnarr = Py_None; Py_INCREF((PyObject *) arrayObject_mnarr); + __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape); + __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1168 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1168 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; goto __pyx_L1;} Py_INCREF(__pyx_v_pvals); @@ -7030,21 +7023,21 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_d = __pyx_4; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1169 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1169 */ __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); + Py_INCREF(((PyObject *)__pyx_1)); Py_DECREF(((PyObject *)arrayObject_parr)); arrayObject_parr = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1170 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1170 */ __pyx_v_pix = ((double (*))arrayObject_parr->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1172 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1172 */ __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0); if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1173 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1173 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} Py_INCREF(__pyx_k123p); @@ -7059,11 +7052,11 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1175 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1175 */ __pyx_5 = __pyx_v_size == Py_None; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1176 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1176 */ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); @@ -7086,7 +7079,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} Py_INCREF(__pyx_v_size); @@ -7100,7 +7093,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); @@ -7113,7 +7106,7 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -7130,76 +7123,76 @@ __pyx_v_multin = __pyx_3; __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1183 */ - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1183 */ + Py_INCREF(((PyObject *)__pyx_v_multin)); Py_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ __pyx_v_mnix = ((long (*))arrayObject_mnarr->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1185 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1185 */ __pyx_v_i = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ while (1) { __pyx_L4:; __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); if (!__pyx_5) break; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ __pyx_v_Sum = 1.0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1188 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1188 */ __pyx_v_dn = __pyx_v_n; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1189 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1189 */ __pyx_4 = (__pyx_v_d - 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1190 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1190 */ (__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":1191 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1191 */ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1192 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1192 */ __pyx_5 = (__pyx_v_dn <= 0); if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ goto __pyx_L7; goto __pyx_L8; } __pyx_L8:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1194 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1194 */ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j])); __pyx_L6:; } __pyx_L7:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1195 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1195 */ __pyx_5 = (__pyx_v_dn > 0); if (__pyx_5) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1196 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1196 */ (__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":1198 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1198 */ __pyx_v_i = (__pyx_v_i + __pyx_v_d); } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1200 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1200 */ Py_INCREF(__pyx_v_multin); __pyx_r = __pyx_v_multin; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7235,7 +7228,7 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_x); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1211 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1211 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} Py_INCREF(__pyx_v_x); @@ -7251,16 +7244,16 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_i = __pyx_4; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ while (1) { __pyx_L2:; __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1213 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1213 */ __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":1214 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1214 */ __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;} __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -7276,12 +7269,12 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1215 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1215 */ __pyx_v_i = (__pyx_v_i - 1); } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7311,9 +7304,9 @@ 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); + __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1223 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1223 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} Py_INCREF(__pyx_v_x); @@ -7327,7 +7320,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1224 */ + /* "/opt/svn/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_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7344,7 +7337,7 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -7360,7 +7353,7 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1227 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1227 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} Py_INCREF(__pyx_v_arr); @@ -7370,12 +7363,12 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ Py_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(__pyx_r); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7687,7 +7680,7 @@ 0, /*bf_getcharbuffer*/ }; -PyTypeObject __pyx_type_6mtrand_RandomState = { +statichere PyTypeObject __pyx_type_6mtrand_RandomState = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "mtrand.RandomState", /*tp_name*/ @@ -7708,7 +7701,7 @@ 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*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*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*/ @@ -7740,10 +7733,8 @@ {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - -PyMODINIT_FUNC initmtrand(void); /*proto*/ -PyMODINIT_FUNC initmtrand(void) { +DL_EXPORT(void) initmtrand(void); /*proto*/ +DL_EXPORT(void) initmtrand(void) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; @@ -7762,7 +7753,6 @@ 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 = 24; goto __pyx_L1;}; __pyx_b = PyImport_AddModule("__builtin__"); @@ -7778,37 +7768,37 @@ if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":118 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":118 */ import_array(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":120 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":120 */ __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":475 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":475 */ Py_INCREF(Py_None); __pyx_k2 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":485 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":485 */ Py_INCREF(Py_None); __pyx_k3 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":546 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":546 */ Py_INCREF(Py_None); __pyx_k4 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":553 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":553 */ Py_INCREF(Py_None); __pyx_k5 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":560 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":560 */ Py_INCREF(Py_None); __pyx_k6 = Py_None; Py_INCREF(Py_None); __pyx_k7 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":606 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":606 */ __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} __pyx_k8 = __pyx_1; __pyx_1 = 0; @@ -7818,17 +7808,17 @@ Py_INCREF(Py_None); __pyx_k10 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":654 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":654 */ Py_INCREF(Py_None); __pyx_k11 = Py_None; Py_INCREF(Py_None); __pyx_k12 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":667 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":667 */ Py_INCREF(Py_None); __pyx_k13 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":674 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":674 */ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;} __pyx_k14 = __pyx_3; __pyx_3 = 0; @@ -7838,73 +7828,73 @@ Py_INCREF(Py_None); __pyx_k16 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":687 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":687 */ Py_INCREF(Py_None); __pyx_k17 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":703 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":703 */ __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; 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":714 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":714 */ Py_INCREF(Py_None); __pyx_k20 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":721 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":721 */ Py_INCREF(Py_None); __pyx_k21 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":732 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":732 */ __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; 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":747 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":747 */ Py_INCREF(Py_None); __pyx_k24 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":762 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":762 */ Py_INCREF(Py_None); __pyx_k25 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":783 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":783 */ Py_INCREF(Py_None); __pyx_k26 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":794 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":794 */ Py_INCREF(Py_None); __pyx_k27 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":810 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":810 */ Py_INCREF(Py_None); __pyx_k28 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":817 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":817 */ Py_INCREF(Py_None); __pyx_k29 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":828 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":828 */ Py_INCREF(Py_None); __pyx_k30 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":842 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":842 */ Py_INCREF(Py_None); __pyx_k31 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":853 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":853 */ Py_INCREF(Py_None); __pyx_k32 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":864 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":864 */ Py_INCREF(Py_None); __pyx_k33 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":875 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":875 */ __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; goto __pyx_L1;} __pyx_k34 = __pyx_7; __pyx_7 = 0; @@ -7914,7 +7904,7 @@ Py_INCREF(Py_None); __pyx_k36 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":888 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":888 */ __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; goto __pyx_L1;} __pyx_k37 = __pyx_9; __pyx_9 = 0; @@ -7924,7 +7914,7 @@ Py_INCREF(Py_None); __pyx_k39 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":901 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":901 */ __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; goto __pyx_L1;} __pyx_k40 = __pyx_11; __pyx_11 = 0; @@ -7934,7 +7924,7 @@ Py_INCREF(Py_None); __pyx_k42 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":914 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":914 */ __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; goto __pyx_L1;} __pyx_k43 = __pyx_13; __pyx_13 = 0; @@ -7944,376 +7934,376 @@ Py_INCREF(Py_None); __pyx_k45 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":932 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":932 */ __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; 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":943 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":943 */ Py_INCREF(Py_None); __pyx_k48 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":958 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":958 */ Py_INCREF(Py_None); __pyx_k49 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":981 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":981 */ Py_INCREF(Py_None); __pyx_k50 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":998 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":998 */ Py_INCREF(Py_None); __pyx_k51 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1016 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1016 */ __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; 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":1027 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1027 */ Py_INCREF(Py_None); __pyx_k54 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1038 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1038 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1052 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1052 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1080 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1080 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1094 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1094 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1152 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1152 */ Py_INCREF(Py_None); __pyx_k59 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1230 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1230 */ __pyx_17 = PyTuple_New(0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; goto __pyx_L1;} __pyx_18 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_17); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; 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 = 1230; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1231 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1231 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; 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 = 1231; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1232 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1232 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; 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 = 1232; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1233 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1233 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; 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 = 1233; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; 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 = 1234; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1235 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1235 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; 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 = 1235; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1236 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1236 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; 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 = 1236; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1237 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1237 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; 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 = 1237; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1238 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1238 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; 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 = 1238; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1239 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1239 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; 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 = 1239; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1240 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1240 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; 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 = 1240; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1241 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1241 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; 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 = 1241; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1242 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1242 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; 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 = 1242; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; 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 = 1243; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1244 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1244 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; 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 = 1244; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1245 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1245 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; 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 = 1245; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1246 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1246 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; 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 = 1246; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1247 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1247 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; 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 = 1247; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1248 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1248 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; 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 = 1248; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1249 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1249 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; 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 = 1249; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1250 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1250 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; 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 = 1250; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1251 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1251 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; 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 = 1251; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1252 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1252 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; 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 = 1252; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1253 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1253 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; 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 = 1253; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; 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 = 1254; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1255 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1255 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; 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 = 1255; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; 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 = 1256; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1257 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1257 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; 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 = 1257; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; 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 = 1258; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1259 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1259 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; 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 = 1259; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1260 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1260 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; 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 = 1260; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1261 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1261 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; 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 = 1261; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1262 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1262 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; 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 = 1262; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1263 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1263 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; 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 = 1263; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1264 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1264 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; 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 = 1264; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1266 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1266 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; 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 = 1266; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1267 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1267 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; 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 = 1267; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1268 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1268 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; 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 = 1268; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1269 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1269 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; 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 = 1269; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1270 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1270 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; 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 = 1270; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1271 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1271 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; 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 = 1271; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1272 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1272 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; 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 = 1272; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1274 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1274 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; 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 = 1274; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1275 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1275 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; 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 = 1275; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; 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 = 1277; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1278 */ + /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1278 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; @@ -8346,13 +8336,10 @@ "mtrand.pyx", "numpy.pxi", }; +statichere char **__pyx_f = __pyx_filenames; /* Runtime support code */ -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - static int __Pyx_GetStarArgs( PyObject **args, PyObject **kwds, Modified: trunk/numpy/random/mtrand/mtrand.pyx =================================================================== --- trunk/numpy/random/mtrand/mtrand.pyx 2006-09-11 16:52:31 UTC (rev 3140) +++ trunk/numpy/random/mtrand/mtrand.pyx 2006-09-11 22:32:39 UTC (rev 3141) @@ -927,7 +927,7 @@ osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED) if _sp.any(_sp.less_equal(osigma, 0.0)): raise ValueError("sigma <= 0.0") - return cont2_array(self.internal_state, rk_lognormal, size, mean, sigma) + return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) def rayleigh(self, scale=1.0, size=None): """Rayleigh distribution. From numpy-svn at scipy.org Mon Sep 11 19:22:57 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 11 Sep 2006 18:22:57 -0500 (CDT) Subject: [Numpy-svn] r3142 - in trunk/numpy/core: include/numpy src Message-ID: <20060911232257.90C2139C00D@new.scipy.org> Author: oliphant Date: 2006-09-11 18:22:54 -0500 (Mon, 11 Sep 2006) New Revision: 3142 Modified: trunk/numpy/core/include/numpy/ufuncobject.h trunk/numpy/core/src/multiarraymodule.c trunk/numpy/core/src/ufuncobject.c Log: Improve the getting and setting of ufunc loops for user-defined types. Modified: trunk/numpy/core/include/numpy/ufuncobject.h =================================================================== --- trunk/numpy/core/include/numpy/ufuncobject.h 2006-09-11 22:32:39 UTC (rev 3141) +++ trunk/numpy/core/include/numpy/ufuncobject.h 2006-09-11 23:22:54 UTC (rev 3142) @@ -187,7 +187,17 @@ PyObject *callable; } PyUFunc_PyFuncData; +/* A linked-list of function information for + user-defined 1-d loops. + */ +typedef struct _loop1d_info { + PyUFuncGenericFunction func; + void *data; + int *arg_types; + struct _loop1d_info *next; +} PyUFunc_Loop1d; + #include "__ufunc_api.h" #define UFUNC_PYVALS_NAME "UFUNC_PYVALS" Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-11 22:32:39 UTC (rev 3141) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-11 23:22:54 UTC (rev 3142) @@ -1731,7 +1731,6 @@ } - /*OBJECT_API*/ static PyArrayObject ** PyArray_ConvertToCommonType(PyObject *op, int *retn) Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-11 22:32:39 UTC (rev 3141) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-11 23:22:54 UTC (rev 3142) @@ -616,7 +616,49 @@ } } +static char *_types_msg = "function not supported for these types, " \ + "and can't coerce safely to supported types"; + +/* Called for non-NULL user-defined functions. + The object should be a CObject pointing to a linked-list of functions + storing the function, data, and signature of all user-defined functions. + There must be a match with the input argument types or an error + will occur. + */ +static int +_find_matching_userloop(PyObject *obj, int *arg_types, + PyArray_SCALARKIND *scalars, + PyUFuncGenericFunction *function, void **data, + int nargs) +{ + PyUFunc_Loop1d *funcdata; + int i; + funcdata = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(obj); + while (funcdata != NULL) { + for (i=0; iarg_types[i], + scalars[i])) + break; + } + if (i==nargs) { /* match found */ + *function = funcdata->func; + *data = funcdata->data; + /* Make sure actual arg_types supported + by the loop are used */ + for (i=0; iarg_types[i]; + } + return 0; + } + funcdata = funcdata->next; + } + PyErr_SetString(PyExc_TypeError, _types_msg); + return -1; +} + /* Called to determine coercion + Can change arg_types. */ static int @@ -639,8 +681,7 @@ if (userdef > 0) { PyObject *key, *obj; - int *this_types=NULL; - + int ret; obj = NULL; key = PyInt_FromLong((long) userdef); if (key == NULL) return -1; @@ -652,37 +693,13 @@ " with no registered loops"); return -1; } - if PyTuple_Check(obj) { - PyObject *item; - *function = (PyUFuncGenericFunction) \ - PyCObject_AsVoidPtr(PyTuple_GET_ITEM(obj,0)); - item = PyTuple_GET_ITEM(obj, 2); - if (PyCObject_Check(item)) { - *data = PyCObject_AsVoidPtr(item); - } - item = PyTuple_GET_ITEM(obj, 1); - if (PyCObject_Check(item)) { - this_types = PyCObject_AsVoidPtr(item); - } - } - else { - *function = (PyUFuncGenericFunction) \ - PyCObject_AsVoidPtr(obj); - *data = NULL; - } - - if (this_types == NULL) { - for (i=1; inargs; i++) { - arg_types[i] = userdef; - } - } - else { - for (i=1; inargs; i++) { - arg_types[i] = this_types[i]; - } - } - Py_DECREF(obj); - return 0; + /* extract the correct function + data and argtypes + */ + ret = _find_matching_userloop(obj, arg_types, scalars, + function, data, self->nargs); + Py_DECREF(obj); + return ret; } start_type = arg_types[0]; @@ -707,9 +724,7 @@ if (j == self->nin) break; } if(i>=self->ntypes) { - PyErr_SetString(PyExc_TypeError, - "function not supported for these types, "\ - "and can't coerce safely to supported types"); + PyErr_SetString(PyExc_TypeError, _types_msg); return -1; } for(j=0; jnargs; j++) @@ -876,7 +891,7 @@ #undef _GETATTR_ static int -construct_matrices(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps) +construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps) { int nargs, i, maxsize; int arg_types[NPY_MAXARGS]; @@ -963,7 +978,8 @@ } } - /* Create copies for some of the arrays if appropriate */ + /* Create copies for some of the arrays if they are small + enough and not already contiguous */ if (_create_copies(loop, arg_types, mps) < 0) return -1; /* Create Iterators for the Inputs */ @@ -1344,8 +1360,8 @@ &(loop->bufsize), &(loop->errormask), &(loop->errobj)) < 0) goto fail; - /* Setup the matrices */ - if (construct_matrices(loop, args, mps) < 0) goto fail; + /* Setup the arrays */ + if (construct_arrays(loop, args, mps) < 0) goto fail; PyUFunc_clearfperr(); @@ -1421,7 +1437,7 @@ /* This generic function is called with the ufunc object, the arguments to it, and an array of (pointers to) PyArrayObjects which are NULL. The - arguments are parsed and placed in mps in construct_loop (construct_matrices) + arguments are parsed and placed in mps in construct_loop (construct_arrays) */ /*UFUNC_API*/ @@ -3087,6 +3103,45 @@ return (PyObject *)self; } +typedef struct { + PyObject_HEAD + void *c_obj; +} _simple_cobj; + +#define _SETCPTR(cobj, val) ((_simple_cobj *)(cobj))->c_obj = (val) + +/* return 1 if arg1 > arg2, 0 if arg1 == arg2, and -1 if arg1 < arg2 + */ +static int +cmp_arg_types(int *arg1, int *arg2, int n) +{ + while (n--) { + if (*arg1 > *arg2) + return 1; + else if (*arg1 < *arg2) + return -1; + arg1++; arg2++; + } + return 0; +} + +/* This frees the linked-list structure + when the CObject is destroyed (removed + from the internal dictionary) +*/ +static void +_loop1d_list_free(void *ptr) +{ + PyUFunc_Loop1d *funcdata; + if (ptr == NULL) return; + funcdata = (PyUFunc_Loop1d *)ptr; + if (funcdata == NULL) return; + _pya_free(funcdata->arg_types); + _loop1d_list_free(funcdata->next); + _pya_free(funcdata); +} + + /*UFUNC_API*/ static int PyUFunc_RegisterLoopForType(PyUFuncObject *ufunc, @@ -3096,9 +3151,12 @@ void *data) { PyArray_Descr *descr; + PyUFunc_Loop1d *funcdata; PyObject *key, *cobj; - int ret; + int i; + int *newtypes=NULL; + descr=PyArray_DescrFromType(usertype); if ((usertype < PyArray_USERDEF) || (descr==NULL)) { PyErr_SetString(PyExc_TypeError, @@ -3112,49 +3170,90 @@ } key = PyInt_FromLong((long) usertype); if (key == NULL) return -1; - cobj = PyCObject_FromVoidPtr((void *)function, NULL); - if (cobj == NULL) {Py_DECREF(key); return -1;} - if (data == NULL && arg_types == NULL) { - ret = PyDict_SetItem(ufunc->userloops, key, cobj); - Py_DECREF(cobj); - Py_DECREF(key); - return ret; - } - else { - PyObject *cobj2, *cobj3, *tmp; - if (arg_types == NULL) { - cobj2 = Py_None; - Py_INCREF(cobj2); - } - else { - cobj2 = PyCObject_FromVoidPtr((void *)arg_types, NULL); - if (cobj2 == NULL) { - Py_DECREF(cobj); - Py_DECREF(key); - return -1; - } - } - if (data == NULL) { - cobj3 = Py_None; - Py_INCREF(cobj3); - } - else { - cobj3 = PyCObject_FromVoidPtr(data, NULL); - if (cobj3 == NULL) { - Py_DECREF(cobj2); - Py_DECREF(cobj); - Py_DECREF(key); - return -1; - } - } - tmp=Py_BuildValue("NNN", cobj, cobj2, cobj3); - ret = PyDict_SetItem(ufunc->userloops, key, tmp); - Py_DECREF(tmp); - Py_DECREF(key); - return ret; - } + funcdata = _pya_malloc(sizeof(PyUFunc_Loop1d)); + if (funcdata == NULL) goto fail; + newtypes = _pya_malloc(sizeof(int)*ufunc->nargs); + if (newtypes == NULL) goto fail; + if (arg_types != NULL) { + for (i=0; inargs; i++) { + newtypes[i] = arg_types[i]; + } + } + else { + for (i=0; inargs; i++) { + newtypes[i] = usertype; + } + } + + funcdata->func = function; + funcdata->arg_types = newtypes; + funcdata->data = data; + funcdata->next = NULL; + + /* Get entry for this user-defined type*/ + cobj = PyDict_GetItem(ufunc->userloops, key); + + /* If it's not there, then make one and return. */ + if (cobj == NULL) { + cobj = PyCObject_FromVoidPtr((void *)function, + _loop1d_list_free); + if (cobj == NULL) goto fail; + PyDict_SetItem(ufunc->userloops, key, cobj); + Py_DECREF(cobj); + Py_DECREF(key); + return 0; + } + else { + PyUFunc_Loop1d *current, *prev=NULL; + int cmp; + /* There is already at least 1 loop. Place this one in + lexicographic order. If the next one signature + is exactly like this one, then just replace. + Otherwise insert. + */ + current = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(cobj); + while (current != NULL) { + cmp = cmp_arg_types(current->arg_types, newtypes, + ufunc->nargs); + if (cmp >= 0) break; + prev = current; + current = current->next; + } + if (cmp == 0) { /* just replace it with new function */ + current->func = function; + current->data = data; + _pya_free(newtypes); + _pya_free(funcdata); + } + else { /* insert it before the current one + by hacking the internals of cobject to + replace the function pointer --- + can't use API because destructor is set. + */ + funcdata->next = current; + if (prev == NULL) { /* place this at front */ + _SETCPTR(cobj, funcdata); + } + else { + prev->next = funcdata; + } + } + } + Py_DECREF(key); + return 0; + + + fail: + Py_DECREF(key); + _pya_free(funcdata); + _pya_free(newtypes); + if (!PyErr_Occurred()) PyErr_NoMemory(); + return -1; } +#undef _SETCPTR + + static void ufunc_dealloc(PyUFuncObject *self) { From numpy-svn at scipy.org Mon Sep 11 19:31:22 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 11 Sep 2006 18:31:22 -0500 (CDT) Subject: [Numpy-svn] r3143 - trunk/numpy/core/src Message-ID: <20060911233122.30A5939C00C@new.scipy.org> Author: oliphant Date: 2006-09-11 18:31:20 -0500 (Mon, 11 Sep 2006) New Revision: 3143 Modified: trunk/numpy/core/src/ufuncobject.c Log: Add some comments about grabbing the CObject implementation. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-11 23:22:54 UTC (rev 3142) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-11 23:31:20 UTC (rev 3143) @@ -3103,6 +3103,15 @@ return (PyObject *)self; } +/* This is the first-part of the CObject structure. + + I don't think this will change, but if it should, then + this needs to be fixed. The exposed C-API was insufficient + because I needed to replace the pointer and it wouldn't + let me with a destructor set (even though it works fine + with the destructor). + */ + typedef struct { PyObject_HEAD void *c_obj; @@ -3156,7 +3165,6 @@ int i; int *newtypes=NULL; - descr=PyArray_DescrFromType(usertype); if ((usertype < PyArray_USERDEF) || (descr==NULL)) { PyErr_SetString(PyExc_TypeError, From numpy-svn at scipy.org Mon Sep 11 20:38:42 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 11 Sep 2006 19:38:42 -0500 (CDT) Subject: [Numpy-svn] r3144 - trunk/numpy/core/src Message-ID: <20060912003842.4870C39C00C@new.scipy.org> Author: oliphant Date: 2006-09-11 19:38:39 -0500 (Mon, 11 Sep 2006) New Revision: 3144 Modified: trunk/numpy/core/src/ufuncobject.c Log: Update type comparison to be based on equivalence classes and safe casting defining the ordering. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-11 23:31:20 UTC (rev 3143) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-12 00:38:39 UTC (rev 3144) @@ -3125,11 +3125,10 @@ cmp_arg_types(int *arg1, int *arg2, int n) { while (n--) { - if (*arg1 > *arg2) - return 1; - else if (*arg1 < *arg2) + if (PyArray_EquivTypenums(*arg1, *arg2)) continue; + if (PyArray_CanCastSafely(*arg1, *arg2)) return -1; - arg1++; arg2++; + return 1; } return 0; } From numpy-svn at scipy.org Wed Sep 13 16:16:01 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 15:16:01 -0500 (CDT) Subject: [Numpy-svn] r3145 - trunk/numpy/core/src Message-ID: <20060913201601.E9DFC39C01C@new.scipy.org> Author: oliphant Date: 2006-09-13 15:15:39 -0500 (Wed, 13 Sep 2006) New Revision: 3145 Modified: trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/ufuncobject.c Log: Allow .item() for fast selection of Python scalars from a numpy array. Re-name a few confusing constants in ufuncobject.c Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-12 00:38:39 UTC (rev 3144) +++ trunk/numpy/core/src/arraymethods.c 2006-09-13 20:15:39 UTC (rev 3145) @@ -452,14 +452,86 @@ static PyObject * array_toscalar(PyArrayObject *self, PyObject *args) { - if (!PyArg_ParseTuple(args, "")) return NULL; - if (self->nd == 0 || PyArray_SIZE(self) == 1) - return self->descr->f->getitem(self->data, self); - else { - PyErr_SetString(PyExc_ValueError, "can only convert an" \ - " array of size 1 to Python scalar."); - return NULL; - } + int n, nd; + n = PyTuple_GET_SIZE(args); + + if (n==1) { + PyObject *obj; + obj = PyTuple_GET_ITEM(args, 0); + if (PyTuple_Check(obj)) { + args = obj; + n = PyTuple_GET_SIZE(args); + } + } + + if (n==0) { + if (self->nd == 0 || PyArray_SIZE(self) == 1) + return self->descr->f->getitem(self->data, self); + else { + PyErr_SetString(PyExc_ValueError, + "can only convert an array " \ + " of size 1 to a Python scalar"); + return NULL; + } + } + else if (n != self->nd && (n > 1 || self->nd==0)) { + PyErr_SetString(PyExc_ValueError, + "incorrect number of indices for " \ + "array"); + return NULL; + } + else if (n==1) { /* allows for flat getting as well as 1-d case */ + intp value, loc, index, factor; + intp factors[MAX_DIMS]; + value = PyArray_PyIntAsIntp(PyTuple_GET_ITEM(args, 0)); + if (error_converting(value)) { + PyErr_SetString(PyExc_ValueError, "invalid integer"); + return NULL; + } + if (value >= PyArray_SIZE(self)) { + PyErr_SetString(PyExc_ValueError, + "index out of bounds"); + return NULL; + } + if (self->nd == 1) { + return self->descr->f->getitem(self->data + value, + self); + } + nd = self->nd; + factor = 1; + while (nd--) { + factors[nd] = factor; + factor *= self->dimensions[nd]; + } + loc = 0; + for (nd=0; nd < self->nd; nd++) { + index = value / factors[nd]; + value = value % factors[nd]; + loc += self->strides[nd]*index; + } + + return self->descr->f->getitem(self->data + loc, + self); + + } + else { + intp loc, index[MAX_DIMS]; + nd = PyArray_IntpFromSequence(args, index, MAX_DIMS); + if (nd < n) return NULL; + loc = 0; + while (nd--) { + if (index[nd] < 0) + index[nd] += self->dimensions[nd]; + if (index[nd] < 0 || + index[nd] >= self->dimensions[nd]) { + PyErr_SetString(PyExc_ValueError, + "index out of bounds"); + return NULL; + } + loc += self->strides[nd]*index[nd]; + } + return self->descr->f->getitem(self->data + loc, self); + } } Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-12 00:38:39 UTC (rev 3144) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-13 20:15:39 UTC (rev 3145) @@ -578,9 +578,9 @@ #define NO_UFUNCLOOP 0 -#define ZERODIM_REDUCELOOP 0 +#define ZERO_EL_REDUCELOOP 0 #define ONE_UFUNCLOOP 1 -#define ONEDIM_REDUCELOOP 1 +#define ONE_EL_REDUCELOOP 1 #define NOBUFFER_UFUNCLOOP 2 #define NOBUFFER_REDUCELOOP 2 #define BUFFER_UFUNCLOOP 3 @@ -1832,12 +1832,12 @@ aar = *arr; if (loop->N == 0) { - loop->meth = ZERODIM_REDUCELOOP; + loop->meth = ZERO_EL_REDUCELOOP; } else if (PyArray_ISBEHAVED_RO(aar) && \ otype == (aar)->descr->type_num) { if (loop->N == 1) { - loop->meth = ONEDIM_REDUCELOOP; + loop->meth = ONE_EL_REDUCELOOP; } else { loop->meth = NOBUFFER_UFUNCLOOP; @@ -1856,7 +1856,7 @@ else loop->obj = 0; - if (loop->meth == ZERODIM_REDUCELOOP) { + if (loop->meth == ZERO_EL_REDUCELOOP) { idarr = _getidentity(self, otype, str); if (idarr == NULL) goto fail; if (idarr->descr->elsize > UFUNC_MAXIDENTITY) { @@ -1913,10 +1913,10 @@ outsize = PyArray_MultiplyList(loop_i, aar->nd); } if (ind_size == 0) { - loop->meth = ZERODIM_REDUCELOOP; + loop->meth = ZERO_EL_REDUCELOOP; return loop; } - if (loop->meth == ONEDIM_REDUCELOOP) + if (loop->meth == ONE_EL_REDUCELOOP) loop->meth = NOBUFFER_REDUCELOOP; break; } @@ -1938,7 +1938,7 @@ loop->outsize = loop->ret->descr->elsize; loop->bufptr[1] = loop->ret->data; - if (loop->meth == ZERODIM_REDUCELOOP) { + if (loop->meth == ZERO_EL_REDUCELOOP) { loop->size = PyArray_SIZE(loop->ret); return loop; } @@ -1946,7 +1946,7 @@ loop->it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)aar); if (loop->it == NULL) return NULL; - if (loop->meth == ONEDIM_REDUCELOOP) { + if (loop->meth == ONE_EL_REDUCELOOP) { loop->size = loop->it->size; return loop; } @@ -2046,7 +2046,7 @@ NPY_LOOP_BEGIN_THREADS switch(loop->meth) { - case ZERODIM_REDUCELOOP: + case ZERO_EL_REDUCELOOP: /* fprintf(stderr, "ZERO..%d\n", loop->size); */ for(i=0; isize; i++) { if (loop->obj) Py_INCREF(*((PyObject **)loop->idptr)); @@ -2054,7 +2054,7 @@ loop->bufptr[1] += loop->outsize; } break; - case ONEDIM_REDUCELOOP: + case ONE_EL_REDUCELOOP: /*fprintf(stderr, "ONEDIM..%d\n", loop->size); */ while(loop->index < loop->size) { if (loop->obj) @@ -2189,7 +2189,7 @@ NPY_LOOP_BEGIN_THREADS switch(loop->meth) { - case ZERODIM_REDUCELOOP: /* Accumulate */ + case ZERO_EL_REDUCELOOP: /* Accumulate */ /* fprintf(stderr, "ZERO..%d\n", loop->size); */ for(i=0; isize; i++) { if (loop->obj) @@ -2198,7 +2198,7 @@ loop->bufptr[1] += loop->outsize; } break; - case ONEDIM_REDUCELOOP: /* Accumulate */ + case ONE_EL_REDUCELOOP: /* Accumulate */ /* fprintf(stderr, "ONEDIM..%d\n", loop->size); */ while(loop->index < loop->size) { if (loop->obj) @@ -2369,7 +2369,7 @@ NPY_LOOP_BEGIN_THREADS switch(loop->meth) { /* zero-length index -- return array immediately */ - case ZERODIM_REDUCELOOP: + case ZERO_EL_REDUCELOOP: /* fprintf(stderr, "ZERO..\n"); */ break; /* NOBUFFER -- behaved array and same type */ From numpy-svn at scipy.org Wed Sep 13 18:06:57 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 17:06:57 -0500 (CDT) Subject: [Numpy-svn] r3146 - in trunk/numpy/core: . src Message-ID: <20060913220657.E3EF139C012@new.scipy.org> Author: oliphant Date: 2006-09-13 17:06:48 -0500 (Wed, 13 Sep 2006) New Revision: 3146 Modified: trunk/numpy/core/ma.py trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/scalartypes.inc.src Log: Add itemset method to parallel item method Modified: trunk/numpy/core/ma.py =================================================================== --- trunk/numpy/core/ma.py 2006-09-13 20:15:39 UTC (rev 3145) +++ trunk/numpy/core/ma.py 2006-09-13 22:06:48 UTC (rev 3146) @@ -1360,17 +1360,23 @@ return self._data.dtype dtype = property(fget=_get_dtype, doc="type of the array elements.") - def item(self): - "Return Python scalar if possible." + def item(self, *args): + "Return Python scalar if possible" if self._mask is not nomask: - m = fromnumeric.ravel(self._mask) + m = self._mask.item(*args) try: if m[0]: return masked except IndexError: return masked - return self._data.item() + return self._data.item(*args) + def itemset(self, *args): + "Set Python scalar into array" + item = args[-1] + args = args[:-1] + self[args] = item + def tolist(self, fill_value=None): "Convert to list" return self.filled(fill_value).tolist() Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-13 20:15:39 UTC (rev 3145) +++ trunk/numpy/core/src/arraymethods.c 2006-09-13 22:06:48 UTC (rev 3146) @@ -534,7 +534,121 @@ } } +static PyObject * +array_setscalar(PyArrayObject *self, PyObject *args) { + int n, nd; + int ret = -1; + PyObject *obj; + n = PyTuple_GET_SIZE(args)-1; + + if (n < 0) { + PyErr_SetString(PyExc_ValueError, + "setitem must have at least one argument"); + return NULL; + } + obj = PyTuple_GET_ITEM(args, n); + if (n==0) { + if (self->nd == 0 || PyArray_SIZE(self) == 1) { + ret = self->descr->f->setitem(obj, self->data, self); + } + else { + PyErr_SetString(PyExc_ValueError, + "can only place a scalar for an " + " array of size 1"); + return NULL; + } + } + else if (n != self->nd && (n > 1 || self->nd==0)) { + PyErr_SetString(PyExc_ValueError, + "incorrect number of indices for " \ + "array"); + return NULL; + } + else if (n==1) { /* allows for flat setting as well as 1-d case */ + intp value, loc, index, factor; + intp factors[MAX_DIMS]; + PyObject *indobj; + indobj = PyTuple_GET_ITEM(args, 0); + if (PyTuple_Check(indobj)) { + PyObject *res; + PyObject *newargs; + PyObject *tmp; + int i, nn; + nn = PyTuple_GET_SIZE(indobj); + newargs = PyTuple_New(nn+1); + Py_INCREF(obj); + for (i=0; i= PyArray_SIZE(self)) { + PyErr_SetString(PyExc_ValueError, + "index out of bounds"); + return NULL; + } + if (self->nd == 1) { + ret = self->descr->f->setitem(obj, self->data + value, + self); + goto finish; + } + nd = self->nd; + factor = 1; + while (nd--) { + factors[nd] = factor; + factor *= self->dimensions[nd]; + } + loc = 0; + for (nd=0; nd < self->nd; nd++) { + index = value / factors[nd]; + value = value % factors[nd]; + loc += self->strides[nd]*index; + } + + ret = self->descr->f->setitem(obj, self->data + loc, self); + } + else { + intp loc, index[MAX_DIMS]; + PyObject *tupargs; + tupargs = PyTuple_GetSlice(args, 1, n+1); + nd = PyArray_IntpFromSequence(tupargs, index, MAX_DIMS); + Py_DECREF(tupargs); + if (nd < n) return NULL; + loc = 0; + while (nd--) { + if (index[nd] < 0) + index[nd] += self->dimensions[nd]; + if (index[nd] < 0 || + index[nd] >= self->dimensions[nd]) { + PyErr_SetString(PyExc_ValueError, + "index out of bounds"); + return NULL; + } + loc += self->strides[nd]*index[nd]; + } + ret = self->descr->f->setitem(obj, self->data + loc, self); + } + + finish: + if (ret < 0) return NULL; + Py_INCREF(Py_None); + return Py_None; +} + + + static PyObject * array_cast(PyArrayObject *self, PyObject *args) { @@ -1683,6 +1797,8 @@ METH_VARARGS | METH_KEYWORDS, NULL}, {"item", (PyCFunction)array_toscalar, METH_VARARGS, NULL}, + {"itemset", (PyCFunction) array_setscalar, + METH_VARARGS, NULL}, {"max", (PyCFunction)array_max, METH_VARARGS | METH_KEYWORDS, NULL}, {"mean", (PyCFunction)array_mean, Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2006-09-13 20:15:39 UTC (rev 3145) +++ trunk/numpy/core/src/scalartypes.inc.src 2006-09-13 22:06:48 UTC (rev 3146) @@ -827,7 +827,6 @@ - static PyObject * gentype_typedescr_get(PyObject *self) { @@ -1068,6 +1067,13 @@ /**end repeat**/ static PyObject * +gentype_itemset(PyObject *self, PyObject *args) +{ + PyErr_SetString(PyExc_ValueError, "array-scalars are immutable"); + return NULL; +} + +static PyObject * gentype_squeeze(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -1281,13 +1287,13 @@ return Py_None; } - /* need to fill in doc-strings for these methods on import -- copy from array docstrings */ static PyMethodDef gentype_methods[] = { {"tolist", (PyCFunction)gentype_tolist, 1, NULL}, {"item", (PyCFunction)gentype_item, METH_VARARGS, NULL}, + {"itemset", (PyCFunction)gentype_itemset, METH_VARARGS, NULL}, {"tofile", (PyCFunction)gentype_tofile, METH_VARARGS|METH_KEYWORDS, NULL}, {"tostring", (PyCFunction)gentype_tostring, METH_VARARGS, NULL}, From numpy-svn at scipy.org Wed Sep 13 19:56:09 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 18:56:09 -0500 (CDT) Subject: [Numpy-svn] r3147 - in trunk/numpy: core/src core/tests random/mtrand Message-ID: <20060913235609.E6F8839C0B2@new.scipy.org> Author: oliphant Date: 2006-09-13 18:55:37 -0500 (Wed, 13 Sep 2006) New Revision: 3147 Modified: trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/arrayobject.c trunk/numpy/core/tests/test_defmatrix.py trunk/numpy/random/mtrand/distributions.c trunk/numpy/random/mtrand/mtrand.c trunk/numpy/random/mtrand/mtrand.pyx Log: Fix random.poisson(0) to return 0 (#229) Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-13 22:06:48 UTC (rev 3146) +++ trunk/numpy/core/src/arraymethods.c 2006-09-13 23:55:37 UTC (rev 3147) @@ -543,7 +543,7 @@ if (n < 0) { PyErr_SetString(PyExc_ValueError, - "setitem must have at least one argument"); + "itemset must have at least one argument"); return NULL; } obj = PyTuple_GET_ITEM(args, n); Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-13 22:06:48 UTC (rev 3146) +++ trunk/numpy/core/src/arrayobject.c 2006-09-13 23:55:37 UTC (rev 3147) @@ -3391,6 +3391,18 @@ return 1; } } +#if (PY_VERSION_HEX >= 0x02050000) + if (PyIndex_Check(o2)) { + Py_ssize_t val; + val = PyNumber_Index(obj); + if (val == -1 && PyErr_Occurred()) { + PyErr_Clear(); + return 0; + } + *exp = (double) val; + return 1; + } +#endif return 0; } @@ -3398,10 +3410,9 @@ static PyObject * fast_scalar_power(PyArrayObject *a1, PyObject *o2, int inplace) { double exp; - if (PyArray_Check(a1) && (PyArray_ISFLOAT(a1) || - PyArray_ISCOMPLEX(a1))) { - if (array_power_is_scalar(o2, &exp)) { - PyObject *fastop = NULL; + if (PyArray_Check(a1) && array_power_is_scalar(o2, &exp)) { + PyObject *fastop = NULL; + if (PyArray_ISFLOAT(a1) || PyArray_ISCOMPLEX(a1)) { if (exp == 1.0) { /* we have to do this one special, as the "copy" method of array objects isn't set @@ -3433,6 +3444,17 @@ fastop); } } + else if (exp==2.0) { + fastop = n_ops.multiply; + if (inplace) { + return PyArray_GenericInplaceBinaryFunction \ + (a1, (PyObject *)a1, fastop); + } + else { + return PyArray_GenericBinaryFunction \ + (a1, (PyObject *)a1, fastop); + } + } } return NULL; } Modified: trunk/numpy/core/tests/test_defmatrix.py =================================================================== --- trunk/numpy/core/tests/test_defmatrix.py 2006-09-13 22:06:48 UTC (rev 3146) +++ trunk/numpy/core/tests/test_defmatrix.py 2006-09-13 23:55:37 UTC (rev 3147) @@ -149,7 +149,7 @@ 'searchsorted', 'setflags', 'setfield', 'sort', 'take', 'tofile', 'tolist', 'tostring', 'all', 'any', 'sum', 'argmax', 'argmin', 'min', 'max', 'mean', 'var', 'ptp', - 'prod', 'std', 'ctypes' + 'prod', 'std', 'ctypes', 'itemset' ] for attrib in dir(a): if attrib.startswith('_') or attrib in excluded_methods: Modified: trunk/numpy/random/mtrand/distributions.c =================================================================== --- trunk/numpy/random/mtrand/distributions.c 2006-09-13 22:06:48 UTC (rev 3146) +++ trunk/numpy/random/mtrand/distributions.c 2006-09-13 23:55:37 UTC (rev 3147) @@ -524,8 +524,12 @@ { return rk_poisson_ptrs(state, lam); } - else + else if (lam == 0) { + return 0; + } + else + { return rk_poisson_mult(state, lam); } } Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2006-09-13 22:06:48 UTC (rev 3146) +++ trunk/numpy/random/mtrand/mtrand.c 2006-09-13 23:55:37 UTC (rev 3147) @@ -1,10 +1,16 @@ -/* Generated by Pyrex 0.9.3.1 on Mon Sep 11 17:34:30 2006 */ +/* Generated by Pyrex 0.9.4.1 on Wed Sep 13 17:52:51 2006 */ #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" +#else +#define __PYX_EXTERN_C extern +#endif +__PYX_EXTERN_C double pow(double, double); #include "string.h" #include "math.h" #include "numpy/arrayobject.h" @@ -32,11 +38,10 @@ static PyObject *__pyx_b; static int __pyx_lineno; static char *__pyx_filename; -staticforward char **__pyx_f; +static char **__pyx_f; /* Declarations from mtrand */ -staticforward PyTypeObject __pyx_type_6mtrand_RandomState; struct __pyx_obj_6mtrand_RandomState { PyObject_HEAD @@ -182,13 +187,13 @@ PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_size); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":128 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":128 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":129 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":129 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -197,7 +202,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":131 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":131 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -212,34 +217,34 @@ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)__pyx_4)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":132 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":132 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":133 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":133 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":134 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":134 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":135 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); __pyx_L3:; } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":136 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":136 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -276,35 +281,35 @@ npy_intp __pyx_5; Py_INCREF(__pyx_v_size); Py_INCREF(__pyx_v_oa); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - __pyx_v_itera = Py_None; Py_INCREF((PyObject *) __pyx_v_itera); - __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); + 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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":148 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":148 */ __pyx_v_scalar = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":149 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":149 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":150 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":150 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":151 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":151 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":153 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":153 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":154 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":154 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":155 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":155 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -313,33 +318,33 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":157 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":157 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":158 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":158 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":159 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":159 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":160 */ - __pyx_2 = PyArray_IterNew(((PyObject *)((PyObject *)__pyx_v_oa))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":160 */ + __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_itera)); - __pyx_v_itera = ((PyObject *)__pyx_2); + __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":161 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":161 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":162 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":162 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double (*))__pyx_v_itera->dataptr)[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":163 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":163 */ PyArray_ITER_NEXT(__pyx_v_itera); __pyx_L5:; } @@ -350,7 +355,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":165 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":165 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -365,25 +370,25 @@ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)__pyx_4)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":166 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":166 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":167 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":167 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":168 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":168 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":169 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":170 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":170 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); __pyx_L8:; } @@ -392,18 +397,18 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":172 */ - __pyx_3 = PyArray_MultiIterNew(2,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_3)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":172 */ + __pyx_3 = PyArray_MultiIterNew(2,((void (*))arrayObject),((void (*))__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_3); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":174 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":174 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":175 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":175 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} Py_INCREF(__pyx_k60p); @@ -418,17 +423,17 @@ } __pyx_L10:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":176 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":176 */ __pyx_5 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":177 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":177 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":178 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":178 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":179 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":179 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); __pyx_L11:; } @@ -438,12 +443,12 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":180 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":180 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -482,40 +487,40 @@ Py_INCREF(__pyx_v_size); Py_INCREF(__pyx_v_oa); Py_INCREF(__pyx_v_ob); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":193 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":193 */ __pyx_v_scalar = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":194 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":194 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_ob->nd == 0); } if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":195 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":195 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":196 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":196 */ __pyx_v_ob_data = ((double (*))__pyx_v_ob->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":197 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":197 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":199 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":200 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":200 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":201 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":201 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -524,37 +529,37 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":203 */ - __pyx_2 = PyArray_MultiIterNew(2,((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":203 */ + __pyx_2 = PyArray_MultiIterNew(2,((void (*))__pyx_v_oa),((void (*))__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_2); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":204 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":204 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":205 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":205 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":206 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":206 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":207 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":207 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":208 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":208 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":209 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":209 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":210 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":210 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -565,7 +570,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":212 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":212 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -580,25 +585,25 @@ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)__pyx_5)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":213 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":213 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":214 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":214 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":215 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":215 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":216 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":216 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":217 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":217 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); __pyx_L8:; } @@ -607,18 +612,18 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":219 */ - __pyx_4 = PyArray_MultiIterNew(3,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_4)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":219 */ + __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 = 219; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_4); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":220 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":220 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":221 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":221 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} Py_INCREF(__pyx_k61p); @@ -633,23 +638,23 @@ } __pyx_L10:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":222 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":222 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":223 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":223 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":224 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":224 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":225 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":225 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":226 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":226 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":227 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":227 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); __pyx_L11:; } @@ -659,12 +664,12 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":228 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":228 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -705,13 +710,13 @@ Py_INCREF(__pyx_v_oa); Py_INCREF(__pyx_v_ob); Py_INCREF(__pyx_v_oc); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":243 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":243 */ __pyx_v_scalar = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":244 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":244 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_ob->nd == 0); @@ -721,30 +726,30 @@ } if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":245 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":245 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":246 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":246 */ __pyx_v_ob_data = ((double (*))__pyx_v_ob->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":247 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":247 */ __pyx_v_oc_data = ((double (*))__pyx_v_oc->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":248 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":248 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":250 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":250 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":251 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":251 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":252 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":252 */ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -753,40 +758,40 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":254 */ - __pyx_2 = PyArray_MultiIterNew(3,((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob)),((void (*))((PyObject *)__pyx_v_oc))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":254 */ + __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 = 254; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_2); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":255 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":255 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":256 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":256 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":257 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":257 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":258 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":258 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":259 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":259 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":260 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":260 */ __pyx_v_oc_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":261 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":261 */ (__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])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":262 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":262 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -797,7 +802,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":264 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":264 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -812,25 +817,25 @@ __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)__pyx_5)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":265 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":265 */ __pyx_v_array_data = ((double (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":266 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":266 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":267 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":267 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":268 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":268 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":269 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":269 */ (__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])); __pyx_L8:; } @@ -839,18 +844,18 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":271 */ - __pyx_4 = PyArray_MultiIterNew(4,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa)),((void (*))((PyObject *)__pyx_v_ob)),((void (*))((PyObject *)__pyx_v_oc))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_4)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":271 */ + __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 = 271; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_4); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":273 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":273 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":274 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":274 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;} Py_INCREF(__pyx_k62p); @@ -865,23 +870,23 @@ } __pyx_L10:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":275 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":275 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":276 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":276 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":277 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":277 */ __pyx_v_ob_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":278 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":278 */ __pyx_v_oc_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":279 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":279 */ (__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])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":280 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":280 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L11:; } @@ -891,12 +896,12 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":281 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":281 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -927,13 +932,13 @@ PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_size); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":289 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":289 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":290 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":290 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -942,7 +947,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":292 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":292 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -955,34 +960,34 @@ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":293 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":293 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":294 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":294 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":295 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":295 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":296 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":296 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); __pyx_L3:; } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":297 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":297 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1018,40 +1023,40 @@ Py_INCREF(__pyx_v_size); Py_INCREF(__pyx_v_on); Py_INCREF(__pyx_v_op); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":309 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":309 */ __pyx_v_scalar = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":310 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":310 */ __pyx_1 = (__pyx_v_on->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_op->nd == 0); } if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":311 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":311 */ __pyx_v_on_data = ((long (*))__pyx_v_on->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":312 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":312 */ __pyx_v_op_data = ((double (*))__pyx_v_op->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":313 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":313 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":315 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":315 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":316 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":316 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":317 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":317 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -1060,37 +1065,37 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":319 */ - __pyx_2 = PyArray_MultiIterNew(2,((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_op))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":319 */ + __pyx_2 = PyArray_MultiIterNew(2,((void (*))__pyx_v_on),((void (*))__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_2); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":320 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":320 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":321 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":321 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":322 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":322 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":323 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":323 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":324 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":324 */ __pyx_v_op_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":325 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":325 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":326 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":326 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -1101,7 +1106,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":328 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":328 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1114,25 +1119,25 @@ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":329 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":329 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":330 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":330 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":331 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":331 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":332 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":332 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":333 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":333 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); __pyx_L8:; } @@ -1141,18 +1146,18 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":335 */ - __pyx_4 = PyArray_MultiIterNew(3,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_op))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_4)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":335 */ + __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 = 335; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_4); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":336 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":336 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":337 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":337 */ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} Py_INCREF(__pyx_k63p); @@ -1167,23 +1172,23 @@ } __pyx_L10:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":338 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":338 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":339 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":339 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":340 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":340 */ __pyx_v_op_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":341 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":341 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":342 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":342 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":343 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":343 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); __pyx_L11:; } @@ -1193,12 +1198,12 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":345 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":345 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1239,13 +1244,13 @@ Py_INCREF(__pyx_v_on); Py_INCREF(__pyx_v_om); Py_INCREF(__pyx_v_oN); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":359 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":359 */ __pyx_v_scalar = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":360 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":360 */ __pyx_1 = (__pyx_v_on->nd == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_om->nd == 0); @@ -1255,30 +1260,30 @@ } if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":361 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":361 */ __pyx_v_scalar = 1; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":362 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":362 */ __pyx_v_on_data = ((long (*))__pyx_v_on->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":363 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":363 */ __pyx_v_om_data = ((long (*))__pyx_v_om->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":364 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":364 */ __pyx_v_oN_data = ((long (*))__pyx_v_oN->data); goto __pyx_L2; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":366 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":366 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":367 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":367 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":368 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":368 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -1287,40 +1292,40 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":370 */ - __pyx_2 = PyArray_MultiIterNew(3,((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_om)),((void (*))((PyObject *)__pyx_v_oN))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":370 */ + __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 = 370; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_2); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":371 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":371 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":372 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":372 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":373 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":373 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":374 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":374 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":375 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":375 */ __pyx_v_om_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":376 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":376 */ __pyx_v_oN_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":377 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":377 */ (__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])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":378 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":378 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L5:; } @@ -1331,7 +1336,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":380 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":380 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1344,25 +1349,25 @@ __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":381 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":381 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":382 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":382 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":383 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":383 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":384 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":384 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":385 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":385 */ (__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])); __pyx_L8:; } @@ -1371,18 +1376,18 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":387 */ - __pyx_4 = PyArray_MultiIterNew(4,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_on)),((void (*))((PyObject *)__pyx_v_om)),((void (*))((PyObject *)__pyx_v_oN))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_4)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":387 */ + __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 = 387; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_4); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":389 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":389 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":390 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":390 */ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} Py_INCREF(__pyx_k64p); @@ -1397,23 +1402,23 @@ } __pyx_L10:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":391 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":391 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":392 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":392 */ __pyx_v_on_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":393 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":393 */ __pyx_v_om_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":394 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":394 */ __pyx_v_oN_data = ((long (*))PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":395 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":395 */ (__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])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":396 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":396 */ PyArray_MultiIter_NEXT(__pyx_v_multi); __pyx_L11:; } @@ -1423,12 +1428,12 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":398 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":398 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1467,35 +1472,35 @@ npy_intp __pyx_5; Py_INCREF(__pyx_v_size); Py_INCREF(__pyx_v_oa); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); - __pyx_v_multi = Py_None; Py_INCREF((PyObject *) __pyx_v_multi); - __pyx_v_itera = Py_None; Py_INCREF((PyObject *) __pyx_v_itera); + 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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":410 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":410 */ __pyx_v_scalar = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":411 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":411 */ __pyx_1 = (__pyx_v_oa->nd == 0); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":412 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":412 */ __pyx_v_oa_data = ((double (*))__pyx_v_oa->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":413 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":413 */ __pyx_v_scalar = 1; goto __pyx_L2; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":415 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":415 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":416 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":416 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":417 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":417 */ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -1504,33 +1509,33 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":419 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":419 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":420 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":420 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":421 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":421 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":422 */ - __pyx_2 = PyArray_IterNew(((PyObject *)((PyObject *)__pyx_v_oa))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":422 */ + __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_itera)); - __pyx_v_itera = ((PyObject *)__pyx_2); + __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":423 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":423 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":424 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":424 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double (*))__pyx_v_itera->dataptr)[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":425 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":425 */ PyArray_ITER_NEXT(__pyx_v_itera); __pyx_L5:; } @@ -1541,7 +1546,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":427 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":427 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1554,25 +1559,25 @@ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":428 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":428 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":429 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":429 */ __pyx_1 = __pyx_v_scalar; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":430 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":430 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":431 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":431 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":432 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":432 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); __pyx_L8:; } @@ -1581,18 +1586,18 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":434 */ - __pyx_3 = PyArray_MultiIterNew(2,((void (*))((PyObject *)arrayObject)),((void (*))((PyObject *)__pyx_v_oa))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_3)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":434 */ + __pyx_3 = PyArray_MultiIterNew(2,((void (*))arrayObject),((void (*))__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyObject *)__pyx_3); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":435 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":435 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":436 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":436 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} Py_INCREF(__pyx_k65p); @@ -1607,17 +1612,17 @@ } __pyx_L10:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":437 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":437 */ __pyx_5 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":438 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":438 */ __pyx_v_oa_data = ((double (*))PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":439 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":439 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":440 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":440 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); __pyx_L11:; } @@ -1627,12 +1632,12 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":441 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":441 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1657,31 +1662,31 @@ long __pyx_v_i; double __pyx_r; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":446 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":446 */ __pyx_v_sum = (__pyx_v_darr[0]); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":447 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":447 */ __pyx_v_c = 0.0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":448 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":448 */ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":449 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":449 */ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":450 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":450 */ __pyx_v_t = (__pyx_v_sum + __pyx_v_y); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":451 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":451 */ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":452 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":452 */ __pyx_v_sum = __pyx_v_t; __pyx_L2:; } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":453 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":453 */ __pyx_r = __pyx_v_sum; goto __pyx_L0; @@ -1706,10 +1711,10 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_seed); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":476 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":476 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state )))); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":478 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":478 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); @@ -1738,14 +1743,14 @@ int __pyx_1; Py_INCREF(__pyx_v_self); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":481 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":481 */ __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":482 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":482 */ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":483 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":483 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = 0; goto __pyx_L2; } @@ -1777,13 +1782,13 @@ 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 = Py_None; Py_INCREF((PyObject *) arrayObject_obj); + arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":497 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":497 */ __pyx_1 = __pyx_v_seed == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":498 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":498 */ __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } @@ -1800,26 +1805,26 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":500 */ - __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":500 */ + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":502 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":502 */ __pyx_3 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_3)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":503 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":503 */ 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(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -1849,9 +1854,9 @@ static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - arrayObject_state = Py_None; Py_INCREF((PyObject *) arrayObject_state); + arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":512 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":512 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -1865,15 +1870,15 @@ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)arrayObject_state)); arrayObject_state = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":513 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":513 */ memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long )))); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":514 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":514 */ __pyx_3 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} Py_INCREF(__pyx_n_MT19937); @@ -1886,7 +1891,7 @@ __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -1924,11 +1929,11 @@ 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 = Py_None; Py_INCREF((PyObject *) arrayObject_obj); - __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name); - __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key); + 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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":525 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":525 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -1936,12 +1941,12 @@ __pyx_v_algorithm_name = __pyx_2; __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":526 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":526 */ if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; if (__pyx_3) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":527 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":527 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} Py_INCREF(__pyx_k68p); @@ -1956,7 +1961,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":528 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":528 */ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} Py_DECREF(__pyx_v_key); @@ -1969,18 +1974,18 @@ if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":529 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":529 */ __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_4)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":530 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":530 */ __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624); if (__pyx_3) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":531 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":531 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_INCREF(__pyx_k69p); @@ -1995,13 +2000,13 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":532 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":532 */ memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long )))); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":533 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":533 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2028,7 +2033,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":537 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":537 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} @@ -2038,7 +2043,7 @@ __pyx_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2063,7 +2068,7 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_state); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":540 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":540 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; goto __pyx_L1;} Py_INCREF(__pyx_v_state); @@ -2073,7 +2078,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2102,7 +2107,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":543 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":543 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2125,7 +2130,7 @@ __pyx_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2152,13 +2157,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":551 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":551 */ __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 = 551; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2182,13 +2187,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":558 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":558 */ __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 = 558; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2231,40 +2236,40 @@ Py_INCREF(__pyx_v_low); Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - arrayObject = Py_None; Py_INCREF((PyObject *) arrayObject); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":573 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":573 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":574 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":574 */ __pyx_v_lo = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":575 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":575 */ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} __pyx_v_hi = __pyx_2; goto __pyx_L2; } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":577 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":577 */ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;} __pyx_v_lo = __pyx_2; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":578 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":578 */ __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} __pyx_v_hi = __pyx_2; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":580 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":580 */ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":581 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":581 */ __pyx_1 = (__pyx_v_diff < 0); if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":582 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":582 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;} Py_INCREF(__pyx_k70p); @@ -2279,11 +2284,11 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":584 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":584 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":585 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":585 */ __pyx_3 = PyLong_FromUnsignedLong((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 = 585; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; @@ -2292,7 +2297,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":587 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":587 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -2305,34 +2310,34 @@ __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)__pyx_3)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":588 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":588 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":589 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":589 */ __pyx_v_array_data = ((long (*))arrayObject->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":590 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":590 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":591 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":591 */ (__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))); __pyx_L5:; } __pyx_L6:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":592 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":592 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; } __pyx_L4:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); @@ -2358,31 +2363,31 @@ 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; + 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(__pyx_v_bytestring); + __pyx_v_bytestring = Py_None; Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":600 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":600 */ __pyx_v_bytes = PyMem_Malloc(__pyx_v_length); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":601 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":601 */ rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":602 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":602 */ __pyx_1 = PyString_FromStringAndSize(((char (*))__pyx_v_bytes),__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;} Py_DECREF(__pyx_v_bytestring); __pyx_v_bytestring = __pyx_1; __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":603 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":603 */ PyMem_Free(__pyx_v_bytes); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":604 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":604 */ Py_INCREF(__pyx_v_bytestring); __pyx_r = __pyx_v_bytestring; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2419,26 +2424,26 @@ Py_INCREF(__pyx_v_low); Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - __pyx_v_olow = Py_None; Py_INCREF((PyObject *) __pyx_v_olow); - __pyx_v_ohigh = Py_None; Py_INCREF((PyObject *) __pyx_v_ohigh); - __pyx_v_odiff = Py_None; Py_INCREF((PyObject *) __pyx_v_odiff); - __pyx_v_temp = Py_None; Py_INCREF(__pyx_v_temp); + __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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":615 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":615 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_olow)); - __pyx_v_olow = ((PyObject *)__pyx_1); + __pyx_v_olow = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":616 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":616 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_ohigh)); - __pyx_v_ohigh = ((PyObject *)__pyx_1); + __pyx_v_ohigh = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":617 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":617 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_subtract); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2454,23 +2459,23 @@ __pyx_v_temp = __pyx_3; __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":618 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":618 */ Py_INCREF(__pyx_v_temp); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":620 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":620 */ __pyx_2 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_odiff)); - __pyx_v_odiff = ((PyObject *)__pyx_2); + __pyx_v_odiff = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":621 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":621 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2514,7 +2519,7 @@ } Py_INCREF(__pyx_v_self); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":634 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":634 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; goto __pyx_L1;} Py_INCREF(__pyx_v_args); @@ -2529,7 +2534,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":635 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":635 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} @@ -2542,7 +2547,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":637 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":637 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} @@ -2557,7 +2562,7 @@ } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2593,7 +2598,7 @@ } Py_INCREF(__pyx_v_self); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":649 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":649 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; goto __pyx_L1;} Py_INCREF(__pyx_v_args); @@ -2608,7 +2613,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":650 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":650 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} @@ -2621,7 +2626,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":652 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":652 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} Py_INCREF(__pyx_v_args); @@ -2635,7 +2640,7 @@ } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2671,16 +2676,16 @@ Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":661 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":661 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":662 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":662 */ Py_INCREF(__pyx_v_low); Py_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":663 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":663 */ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} Py_DECREF(__pyx_v_low); __pyx_v_low = __pyx_2; @@ -2689,7 +2694,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":664 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":664 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} @@ -2708,7 +2713,7 @@ __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); @@ -2736,13 +2741,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":672 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":672 */ __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 = 672; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2784,24 +2789,24 @@ Py_INCREF(__pyx_v_loc); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":681 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":681 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = ((PyObject *)__pyx_1); + __pyx_v_oloc = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":682 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":682 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyObject *)__pyx_1); + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":683 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":683 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2827,7 +2832,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":684 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":684 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} Py_INCREF(__pyx_k72p); @@ -2842,13 +2847,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":685 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":685 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -2894,24 +2899,24 @@ Py_INCREF(__pyx_v_a); Py_INCREF(__pyx_v_b); Py_INCREF(__pyx_v_size); - __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); - __pyx_v_ob = Py_None; Py_INCREF((PyObject *) __pyx_v_ob); + __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":694 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":694 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyObject *)__pyx_1); + __pyx_v_oa = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":695 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":695 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_ob)); - __pyx_v_ob = ((PyObject *)__pyx_1); + __pyx_v_ob = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":697 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":697 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2937,7 +2942,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":698 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":698 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; goto __pyx_L1;} Py_INCREF(__pyx_k73p); @@ -2952,7 +2957,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":699 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":699 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -2978,7 +2983,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":700 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":700 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;} Py_INCREF(__pyx_k74p); @@ -2993,13 +2998,13 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":701 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":701 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_oa,__pyx_v_ob); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3041,16 +3046,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":709 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":709 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyObject *)__pyx_1); + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":710 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":710 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3076,7 +3081,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":711 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":711 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;} Py_INCREF(__pyx_k75p); @@ -3091,13 +3096,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":712 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":712 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3126,13 +3131,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":719 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":719 */ __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 = 719; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3166,16 +3171,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_shape); Py_INCREF(__pyx_v_size); - __pyx_v_oshape = Py_None; Py_INCREF((PyObject *) __pyx_v_oshape); + __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":727 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":727 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oshape)); - __pyx_v_oshape = ((PyObject *)__pyx_1); + __pyx_v_oshape = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":728 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":728 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3201,7 +3206,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":729 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":729 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; goto __pyx_L1;} Py_INCREF(__pyx_k76p); @@ -3216,13 +3221,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":730 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":730 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3267,24 +3272,24 @@ Py_INCREF(__pyx_v_shape); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_oshape = Py_None; Py_INCREF((PyObject *) __pyx_v_oshape); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":739 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":739 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oshape)); - __pyx_v_oshape = ((PyObject *)__pyx_1); + __pyx_v_oshape = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":740 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":740 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyObject *)__pyx_1); + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":741 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":741 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3310,7 +3315,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":742 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":742 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;} Py_INCREF(__pyx_k77p); @@ -3325,7 +3330,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":743 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":743 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3351,7 +3356,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":744 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":744 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} Py_INCREF(__pyx_k78p); @@ -3366,13 +3371,13 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":745 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":745 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3418,24 +3423,24 @@ Py_INCREF(__pyx_v_dfnum); Py_INCREF(__pyx_v_dfden); Py_INCREF(__pyx_v_size); - __pyx_v_odfnum = Py_None; Py_INCREF((PyObject *) __pyx_v_odfnum); - __pyx_v_odfden = Py_None; Py_INCREF((PyObject *) __pyx_v_odfden); + __pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":754 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":754 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_odfnum)); - __pyx_v_odfnum = ((PyObject *)__pyx_1); + __pyx_v_odfnum = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":755 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":755 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyObject *)__pyx_1); + __pyx_v_odfden = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":756 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":756 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3461,7 +3466,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":757 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":757 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;} Py_INCREF(__pyx_k79p); @@ -3476,7 +3481,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":758 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":758 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3502,7 +3507,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":759 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":759 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} Py_INCREF(__pyx_k80p); @@ -3517,13 +3522,13 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":760 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":760 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3576,32 +3581,32 @@ Py_INCREF(__pyx_v_dfden); Py_INCREF(__pyx_v_nonc); Py_INCREF(__pyx_v_size); - __pyx_v_odfnum = Py_None; Py_INCREF((PyObject *) __pyx_v_odfnum); - __pyx_v_odfden = Py_None; Py_INCREF((PyObject *) __pyx_v_odfden); - __pyx_v_ononc = Py_None; Py_INCREF((PyObject *) __pyx_v_ononc); + __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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":770 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":770 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_odfnum)); - __pyx_v_odfnum = ((PyObject *)__pyx_1); + __pyx_v_odfnum = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":771 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":771 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyObject *)__pyx_1); + __pyx_v_odfden = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":772 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":772 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyObject *)__pyx_1); + __pyx_v_ononc = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":774 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":774 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3627,7 +3632,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":775 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":775 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} Py_INCREF(__pyx_k81p); @@ -3642,7 +3647,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":776 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":776 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3668,7 +3673,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":777 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":777 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} Py_INCREF(__pyx_k82p); @@ -3683,7 +3688,7 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":778 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":778 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -3709,7 +3714,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":779 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":779 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} Py_INCREF(__pyx_k83p); @@ -3724,13 +3729,13 @@ } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":780 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":780 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3773,16 +3778,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_df); Py_INCREF(__pyx_v_size); - __pyx_v_odf = Py_None; Py_INCREF((PyObject *) __pyx_v_odf); + __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":789 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":789 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyObject *)__pyx_1); + __pyx_v_odf = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":790 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":790 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3808,7 +3813,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":791 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":791 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; goto __pyx_L1;} Py_INCREF(__pyx_k84p); @@ -3823,13 +3828,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":792 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":792 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -3873,24 +3878,24 @@ Py_INCREF(__pyx_v_df); Py_INCREF(__pyx_v_nonc); Py_INCREF(__pyx_v_size); - __pyx_v_odf = Py_None; Py_INCREF((PyObject *) __pyx_v_odf); - __pyx_v_ononc = Py_None; Py_INCREF((PyObject *) __pyx_v_ononc); + __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":801 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":801 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyObject *)__pyx_1); + __pyx_v_odf = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":802 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":802 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyObject *)__pyx_1); + __pyx_v_ononc = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":803 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":803 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -3916,7 +3921,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":804 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":804 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; goto __pyx_L1;} Py_INCREF(__pyx_k85p); @@ -3931,7 +3936,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":805 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":805 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3957,7 +3962,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":806 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":806 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} Py_INCREF(__pyx_k86p); @@ -3972,13 +3977,13 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":807 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":807 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4009,13 +4014,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":815 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":815 */ __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 = 815; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4049,16 +4054,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_df); Py_INCREF(__pyx_v_size); - __pyx_v_odf = Py_None; Py_INCREF((PyObject *) __pyx_v_odf); + __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":823 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":823 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_odf)); - __pyx_v_odf = ((PyObject *)__pyx_1); + __pyx_v_odf = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":824 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":824 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4084,7 +4089,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":825 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":825 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} Py_INCREF(__pyx_k87p); @@ -4099,13 +4104,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":826 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":826 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4147,24 +4152,24 @@ Py_INCREF(__pyx_v_mu); Py_INCREF(__pyx_v_kappa); Py_INCREF(__pyx_v_size); - __pyx_v_omu = Py_None; Py_INCREF((PyObject *) __pyx_v_omu); - __pyx_v_okappa = Py_None; Py_INCREF((PyObject *) __pyx_v_okappa); + __pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":836 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":836 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_omu)); - __pyx_v_omu = ((PyObject *)__pyx_1); + __pyx_v_omu = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":837 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":837 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_okappa)); - __pyx_v_okappa = ((PyObject *)__pyx_1); + __pyx_v_okappa = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":838 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":838 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4190,7 +4195,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":839 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":839 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} Py_INCREF(__pyx_k88p); @@ -4205,13 +4210,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":840 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":840 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4252,16 +4257,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_a); Py_INCREF(__pyx_v_size); - __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); + __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":848 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":848 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyObject *)__pyx_1); + __pyx_v_oa = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":849 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":849 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4287,7 +4292,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":850 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":850 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} Py_INCREF(__pyx_k89p); @@ -4302,13 +4307,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":851 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":851 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4346,18 +4351,18 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "d|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); + __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":859 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":859 */ __pyx_1 = PyFloat_FromDouble(__pyx_v_a); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} __pyx_2 = PyArray_FROM_OTF(__pyx_1,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyObject *)__pyx_2); + __pyx_v_oa = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":860 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":860 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4383,7 +4388,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":861 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":861 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} Py_INCREF(__pyx_k90p); @@ -4398,13 +4403,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":862 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":862 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4441,18 +4446,18 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "d|O", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); + __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":870 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":870 */ __pyx_1 = PyFloat_FromDouble(__pyx_v_a); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;} __pyx_2 = PyArray_FROM_OTF(__pyx_1,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_INCREF(((PyObject *)__pyx_2)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyObject *)__pyx_2); + __pyx_v_oa = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":871 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":871 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4478,7 +4483,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":872 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":872 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} Py_INCREF(__pyx_k91p); @@ -4493,13 +4498,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":873 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":873 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4542,24 +4547,24 @@ Py_INCREF(__pyx_v_loc); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":882 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":882 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = __pyx_1; + __pyx_v_oloc = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":883 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":883 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = __pyx_1; + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":884 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":884 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4585,7 +4590,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":885 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":885 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; goto __pyx_L1;} Py_INCREF(__pyx_k92p); @@ -4600,13 +4605,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":886 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":886 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4652,24 +4657,24 @@ Py_INCREF(__pyx_v_loc); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":895 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":895 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = __pyx_1; + __pyx_v_oloc = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":896 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":896 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = __pyx_1; + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":897 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":897 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4695,7 +4700,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":898 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":898 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; goto __pyx_L1;} Py_INCREF(__pyx_k93p); @@ -4710,13 +4715,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":899 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":899 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4762,24 +4767,24 @@ Py_INCREF(__pyx_v_loc); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_oloc = Py_None; Py_INCREF((PyObject *) __pyx_v_oloc); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":908 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":908 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); - __pyx_v_oloc = __pyx_1; + __pyx_v_oloc = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":909 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":909 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = __pyx_1; + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":910 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":910 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4805,7 +4810,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":911 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":911 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; goto __pyx_L1;} Py_INCREF(__pyx_k94p); @@ -4820,13 +4825,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":912 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":912 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4872,24 +4877,24 @@ Py_INCREF(__pyx_v_mean); Py_INCREF(__pyx_v_sigma); Py_INCREF(__pyx_v_size); - __pyx_v_omean = Py_None; Py_INCREF((PyObject *) __pyx_v_omean); - __pyx_v_osigma = Py_None; Py_INCREF((PyObject *) __pyx_v_osigma); + __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":926 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":926 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); - __pyx_v_omean = __pyx_1; + __pyx_v_omean = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":927 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":927 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_osigma)); - __pyx_v_osigma = __pyx_1; + __pyx_v_osigma = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":928 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":928 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -4915,7 +4920,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":929 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":929 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} Py_INCREF(__pyx_k95p); @@ -4930,13 +4935,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":930 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":930 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -4978,16 +4983,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":938 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":938 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyObject *)__pyx_1); + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":939 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":939 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5013,7 +5018,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":940 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":940 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} Py_INCREF(__pyx_k96p); @@ -5028,13 +5033,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":941 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":941 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5078,24 +5083,24 @@ Py_INCREF(__pyx_v_mean); Py_INCREF(__pyx_v_scale); Py_INCREF(__pyx_v_size); - __pyx_v_omean = Py_None; Py_INCREF((PyObject *) __pyx_v_omean); - __pyx_v_oscale = Py_None; Py_INCREF((PyObject *) __pyx_v_oscale); + __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":950 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":950 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); - __pyx_v_omean = __pyx_1; + __pyx_v_omean = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":951 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":951 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = __pyx_1; + __pyx_v_oscale = ((PyArrayObject *)__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":952 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":952 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5121,7 +5126,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":953 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":953 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} Py_INCREF(__pyx_k97p); @@ -5159,7 +5164,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":955 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":955 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} Py_INCREF(__pyx_k98p); @@ -5174,13 +5179,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":956 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":956 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5234,32 +5239,32 @@ Py_INCREF(__pyx_v_mode); Py_INCREF(__pyx_v_right); Py_INCREF(__pyx_v_size); - __pyx_v_oleft = Py_None; Py_INCREF((PyObject *) __pyx_v_oleft); - __pyx_v_omode = Py_None; Py_INCREF((PyObject *) __pyx_v_omode); - __pyx_v_oright = Py_None; Py_INCREF((PyObject *) __pyx_v_oright); + __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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":967 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":967 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oleft)); - __pyx_v_oleft = ((PyObject *)__pyx_1); + __pyx_v_oleft = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":968 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":968 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_omode)); - __pyx_v_omode = ((PyObject *)__pyx_1); + __pyx_v_omode = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":969 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":969 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oright)); - __pyx_v_oright = ((PyObject *)__pyx_1); + __pyx_v_oright = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":971 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":971 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5284,7 +5289,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":972 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":972 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;} Py_INCREF(__pyx_k99p); @@ -5299,7 +5304,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":973 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":973 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5324,7 +5329,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":974 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":974 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} Py_INCREF(__pyx_k100p); @@ -5339,7 +5344,7 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":975 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":975 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5364,7 +5369,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":976 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":976 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;} Py_INCREF(__pyx_k101p); @@ -5379,13 +5384,13 @@ } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":977 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":977 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5435,24 +5440,24 @@ Py_INCREF(__pyx_v_n); Py_INCREF(__pyx_v_p); Py_INCREF(__pyx_v_size); - __pyx_v_on = Py_None; Py_INCREF((PyObject *) __pyx_v_on); - __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); + __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":988 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":988 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_on)); - __pyx_v_on = ((PyObject *)__pyx_1); + __pyx_v_on = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":989 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":989 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyObject *)__pyx_1); + __pyx_v_op = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":990 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":990 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5478,7 +5483,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":991 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":991 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} Py_INCREF(__pyx_k102p); @@ -5493,7 +5498,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":992 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":992 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -5519,7 +5524,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":993 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":993 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; goto __pyx_L1;} Py_INCREF(__pyx_k103p); @@ -5534,7 +5539,7 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":994 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":994 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -5560,7 +5565,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":995 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":995 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; goto __pyx_L1;} Py_INCREF(__pyx_k104p); @@ -5575,13 +5580,13 @@ } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":996 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":996 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5629,24 +5634,24 @@ Py_INCREF(__pyx_v_n); Py_INCREF(__pyx_v_p); Py_INCREF(__pyx_v_size); - __pyx_v_on = Py_None; Py_INCREF((PyObject *) __pyx_v_on); - __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); + __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1005 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1005 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_on)); - __pyx_v_on = ((PyObject *)__pyx_1); + __pyx_v_on = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyObject *)__pyx_1); + __pyx_v_op = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1007 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1007 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5672,7 +5677,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1008 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1008 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} Py_INCREF(__pyx_k105p); @@ -5687,7 +5692,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1009 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1009 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -5713,7 +5718,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; goto __pyx_L1;} Py_INCREF(__pyx_k106p); @@ -5728,7 +5733,7 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1011 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1011 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -5754,7 +5759,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1012 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1012 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; goto __pyx_L1;} Py_INCREF(__pyx_k107p); @@ -5769,13 +5774,13 @@ } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1013 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1013 */ __pyx_1 = __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_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5796,7 +5801,7 @@ static PyObject *__pyx_k108p; -static char (__pyx_k108[]) = "lam <= 0"; +static char (__pyx_k108[]) = "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 "; @@ -5817,21 +5822,21 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_lam); Py_INCREF(__pyx_v_size); - __pyx_v_olam = Py_None; Py_INCREF((PyObject *) __pyx_v_olam); + __pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_olam)); - __pyx_v_olam = ((PyObject *)__pyx_1); + __pyx_v_olam = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1023 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1023 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} @@ -5852,7 +5857,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} Py_INCREF(__pyx_k108p); @@ -5867,13 +5872,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1025 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1025 */ __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_olam); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -5912,16 +5917,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_a); Py_INCREF(__pyx_v_size); - __pyx_v_oa = Py_None; Py_INCREF((PyObject *) __pyx_v_oa); + __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1033 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1033 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_oa)); - __pyx_v_oa = ((PyObject *)__pyx_1); + __pyx_v_oa = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1034 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1034 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -5947,7 +5952,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1035 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1035 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; goto __pyx_L1;} Py_INCREF(__pyx_k109p); @@ -5962,13 +5967,13 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1036 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1036 */ __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6009,16 +6014,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_p); Py_INCREF(__pyx_v_size); - __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); + __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1045 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1045 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyObject *)__pyx_1); + __pyx_v_op = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1046 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1046 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6044,7 +6049,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1047 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1047 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__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_k110p); @@ -6059,7 +6064,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1048 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1048 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6085,7 +6090,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1049 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1049 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} Py_INCREF(__pyx_k111p); @@ -6100,13 +6105,13 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1050 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1050 */ __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 = 1050; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6160,32 +6165,32 @@ Py_INCREF(__pyx_v_nbad); Py_INCREF(__pyx_v_nsample); Py_INCREF(__pyx_v_size); - __pyx_v_ongood = Py_None; Py_INCREF((PyObject *) __pyx_v_ongood); - __pyx_v_onbad = Py_None; Py_INCREF((PyObject *) __pyx_v_onbad); - __pyx_v_onsample = Py_None; Py_INCREF((PyObject *) __pyx_v_onsample); + __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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1066 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1066 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_ongood)); - __pyx_v_ongood = ((PyObject *)__pyx_1); + __pyx_v_ongood = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_onbad)); - __pyx_v_onbad = ((PyObject *)__pyx_1); + __pyx_v_onbad = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_onsample)); - __pyx_v_onsample = ((PyObject *)__pyx_1); + __pyx_v_onsample = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1069 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1069 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6211,7 +6216,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} Py_INCREF(__pyx_k112p); @@ -6226,7 +6231,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1071 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1071 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6252,7 +6257,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} Py_INCREF(__pyx_k113p); @@ -6267,7 +6272,7 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1073 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1073 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6303,7 +6308,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} Py_INCREF(__pyx_k114p); @@ -6318,7 +6323,7 @@ } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1075 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1075 */ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; @@ -6344,7 +6349,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1076 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1076 */ __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;} Py_INCREF(__pyx_k115p); @@ -6359,13 +6364,13 @@ } __pyx_L5:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1077 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1077 */ __pyx_4 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ongood,__pyx_v_onbad,__pyx_v_onsample); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6411,16 +6416,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_p); Py_INCREF(__pyx_v_size); - __pyx_v_op = Py_None; Py_INCREF((PyObject *) __pyx_v_op); + __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1086 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1086 */ __pyx_1 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyObject *)__pyx_1); + __pyx_v_op = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6446,7 +6451,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1088 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1088 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} Py_INCREF(__pyx_k116p); @@ -6461,7 +6466,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1089 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1089 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6487,7 +6492,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1090 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1090 */ __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} Py_INCREF(__pyx_k117p); @@ -6502,13 +6507,13 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1091 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1091 */ __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 = 1091; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -6573,15 +6578,15 @@ Py_INCREF(__pyx_v_mean); Py_INCREF(__pyx_v_cov); Py_INCREF(__pyx_v_size); - __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape); - __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape); - __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x); - __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd); - __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u); - __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s); - __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v); + __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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1112 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1112 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -6595,7 +6600,7 @@ __pyx_v_mean = __pyx_3; __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1113 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1113 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6609,11 +6614,11 @@ __pyx_v_cov = __pyx_2; __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1114 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1114 */ __pyx_4 = __pyx_v_size == Py_None; if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1115 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1115 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_1; @@ -6622,14 +6627,14 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1117 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1117 */ Py_INCREF(__pyx_v_size); Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_v_size; } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1118 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1118 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} @@ -6645,7 +6650,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1119 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1119 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; goto __pyx_L1;} Py_INCREF(__pyx_k118p); @@ -6660,7 +6665,7 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1120 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1120 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;} @@ -6692,7 +6697,7 @@ } if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1121 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1121 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} Py_INCREF(__pyx_k119p); @@ -6707,7 +6712,7 @@ } __pyx_L4:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1122 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1122 */ __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} @@ -6724,7 +6729,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1123 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1123 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} Py_INCREF(__pyx_k120p); @@ -6739,7 +6744,7 @@ } __pyx_L5:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1125 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1125 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} @@ -6754,7 +6759,7 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1126 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1126 */ __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape); @@ -6765,7 +6770,7 @@ } __pyx_L6:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1127 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1127 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} @@ -6778,7 +6783,7 @@ __pyx_v_final_shape = __pyx_1; __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1128 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1128 */ __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} @@ -6793,7 +6798,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1132 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1132 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} @@ -6816,7 +6821,7 @@ __pyx_v_x = __pyx_5; __pyx_5 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1133 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1133 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6855,7 +6860,7 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1142 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1142 */ __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} Py_INCREF(__pyx_n_svd); PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd); @@ -6867,7 +6872,7 @@ __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1144 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1144 */ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} Py_INCREF(__pyx_v_cov); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov); @@ -6888,7 +6893,7 @@ if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_dot); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6915,7 +6920,7 @@ __pyx_v_x = __pyx_1; __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1148 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1148 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6931,7 +6936,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1149 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1149 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); @@ -6942,12 +6947,12 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1150 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1150 */ Py_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7006,12 +7011,12 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pvals); Py_INCREF(__pyx_v_size); - arrayObject_parr = Py_None; Py_INCREF((PyObject *) arrayObject_parr); - arrayObject_mnarr = Py_None; Py_INCREF((PyObject *) arrayObject_mnarr); - __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape); - __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin); + 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); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1168 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1168 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; goto __pyx_L1;} Py_INCREF(__pyx_v_pvals); @@ -7023,21 +7028,21 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_d = __pyx_4; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1169 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1169 */ __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; goto __pyx_L1;} - Py_INCREF(((PyObject *)__pyx_1)); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)arrayObject_parr)); arrayObject_parr = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1170 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1170 */ __pyx_v_pix = ((double (*))arrayObject_parr->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1172 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1172 */ __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0); if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1173 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1173 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} Py_INCREF(__pyx_k123p); @@ -7052,11 +7057,11 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1175 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1175 */ __pyx_5 = __pyx_v_size == Py_None; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1176 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1176 */ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); @@ -7079,7 +7084,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} Py_INCREF(__pyx_v_size); @@ -7093,7 +7098,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); @@ -7106,7 +7111,7 @@ } __pyx_L3:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -7123,76 +7128,76 @@ __pyx_v_multin = __pyx_3; __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1183 */ - Py_INCREF(((PyObject *)__pyx_v_multin)); + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1183 */ + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); Py_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ __pyx_v_mnix = ((long (*))arrayObject_mnarr->data); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1185 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1185 */ __pyx_v_i = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ while (1) { __pyx_L4:; __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); if (!__pyx_5) break; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ __pyx_v_Sum = 1.0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1188 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1188 */ __pyx_v_dn = __pyx_v_n; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1189 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1189 */ __pyx_4 = (__pyx_v_d - 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1190 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1190 */ (__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)); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1191 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1191 */ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)])); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1192 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1192 */ __pyx_5 = (__pyx_v_dn <= 0); if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ goto __pyx_L7; goto __pyx_L8; } __pyx_L8:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1194 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1194 */ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j])); __pyx_L6:; } __pyx_L7:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1195 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1195 */ __pyx_5 = (__pyx_v_dn > 0); if (__pyx_5) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1196 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1196 */ (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn; goto __pyx_L9; } __pyx_L9:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1198 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1198 */ __pyx_v_i = (__pyx_v_i + __pyx_v_d); } __pyx_L5:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1200 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1200 */ Py_INCREF(__pyx_v_multin); __pyx_r = __pyx_v_multin; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7228,7 +7233,7 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_x); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1211 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1211 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} Py_INCREF(__pyx_v_x); @@ -7244,16 +7249,16 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_i = __pyx_4; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ while (1) { __pyx_L2:; __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1213 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1213 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1214 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1214 */ __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;} __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -7269,12 +7274,12 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1215 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1215 */ __pyx_v_i = (__pyx_v_i - 1); } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7304,9 +7309,9 @@ 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(__pyx_v_arr); + __pyx_v_arr = Py_None; Py_INCREF(Py_None); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1223 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1223 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} Py_INCREF(__pyx_v_x); @@ -7320,7 +7325,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1224 */ + /* "/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_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7337,7 +7342,7 @@ } /*else*/ { - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -7353,7 +7358,7 @@ } __pyx_L2:; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1227 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1227 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} Py_INCREF(__pyx_v_arr); @@ -7363,12 +7368,12 @@ Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ Py_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -7680,7 +7685,7 @@ 0, /*bf_getcharbuffer*/ }; -statichere PyTypeObject __pyx_type_6mtrand_RandomState = { +PyTypeObject __pyx_type_6mtrand_RandomState = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "mtrand.RandomState", /*tp_name*/ @@ -7701,7 +7706,7 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 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*/ @@ -7733,8 +7738,10 @@ {0, 0, 0, 0} }; -DL_EXPORT(void) initmtrand(void); /*proto*/ -DL_EXPORT(void) initmtrand(void) { +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; @@ -7753,6 +7760,7 @@ 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 = 24; goto __pyx_L1;}; __pyx_b = PyImport_AddModule("__builtin__"); @@ -7768,37 +7776,37 @@ if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":118 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":118 */ import_array(); - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":120 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":120 */ __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":475 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":475 */ Py_INCREF(Py_None); __pyx_k2 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":485 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":485 */ Py_INCREF(Py_None); __pyx_k3 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":546 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":546 */ Py_INCREF(Py_None); __pyx_k4 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":553 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":553 */ Py_INCREF(Py_None); __pyx_k5 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":560 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":560 */ Py_INCREF(Py_None); __pyx_k6 = Py_None; Py_INCREF(Py_None); __pyx_k7 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":606 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":606 */ __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} __pyx_k8 = __pyx_1; __pyx_1 = 0; @@ -7808,17 +7816,17 @@ Py_INCREF(Py_None); __pyx_k10 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":654 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":654 */ Py_INCREF(Py_None); __pyx_k11 = Py_None; Py_INCREF(Py_None); __pyx_k12 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":667 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":667 */ Py_INCREF(Py_None); __pyx_k13 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":674 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":674 */ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;} __pyx_k14 = __pyx_3; __pyx_3 = 0; @@ -7828,73 +7836,73 @@ Py_INCREF(Py_None); __pyx_k16 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":687 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":687 */ Py_INCREF(Py_None); __pyx_k17 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":703 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":703 */ __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;} __pyx_k18 = __pyx_5; __pyx_5 = 0; Py_INCREF(Py_None); __pyx_k19 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":714 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":714 */ Py_INCREF(Py_None); __pyx_k20 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":721 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":721 */ Py_INCREF(Py_None); __pyx_k21 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":732 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":732 */ __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;} __pyx_k22 = __pyx_6; __pyx_6 = 0; Py_INCREF(Py_None); __pyx_k23 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":747 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":747 */ Py_INCREF(Py_None); __pyx_k24 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":762 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":762 */ Py_INCREF(Py_None); __pyx_k25 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":783 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":783 */ Py_INCREF(Py_None); __pyx_k26 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":794 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":794 */ Py_INCREF(Py_None); __pyx_k27 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":810 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":810 */ Py_INCREF(Py_None); __pyx_k28 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":817 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":817 */ Py_INCREF(Py_None); __pyx_k29 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":828 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":828 */ Py_INCREF(Py_None); __pyx_k30 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":842 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":842 */ Py_INCREF(Py_None); __pyx_k31 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":853 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":853 */ Py_INCREF(Py_None); __pyx_k32 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":864 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":864 */ Py_INCREF(Py_None); __pyx_k33 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":875 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":875 */ __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; goto __pyx_L1;} __pyx_k34 = __pyx_7; __pyx_7 = 0; @@ -7904,7 +7912,7 @@ Py_INCREF(Py_None); __pyx_k36 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":888 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":888 */ __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; goto __pyx_L1;} __pyx_k37 = __pyx_9; __pyx_9 = 0; @@ -7914,7 +7922,7 @@ Py_INCREF(Py_None); __pyx_k39 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":901 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":901 */ __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; goto __pyx_L1;} __pyx_k40 = __pyx_11; __pyx_11 = 0; @@ -7924,7 +7932,7 @@ Py_INCREF(Py_None); __pyx_k42 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":914 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":914 */ __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; goto __pyx_L1;} __pyx_k43 = __pyx_13; __pyx_13 = 0; @@ -7934,376 +7942,376 @@ Py_INCREF(Py_None); __pyx_k45 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":932 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":932 */ __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} __pyx_k46 = __pyx_15; __pyx_15 = 0; Py_INCREF(Py_None); __pyx_k47 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":943 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":943 */ Py_INCREF(Py_None); __pyx_k48 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":958 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":958 */ Py_INCREF(Py_None); __pyx_k49 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":981 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":981 */ Py_INCREF(Py_None); __pyx_k50 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":998 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":998 */ Py_INCREF(Py_None); __pyx_k51 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1016 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1016 */ __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;} __pyx_k52 = __pyx_16; __pyx_16 = 0; Py_INCREF(Py_None); __pyx_k53 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1027 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1027 */ Py_INCREF(Py_None); __pyx_k54 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1038 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1038 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1052 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1052 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1080 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1080 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1094 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1094 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1152 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1152 */ Py_INCREF(Py_None); __pyx_k59 = Py_None; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1230 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1230 */ __pyx_17 = PyTuple_New(0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; goto __pyx_L1;} __pyx_18 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_17); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; 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 = 1230; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1231 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1231 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; 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 = 1231; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1232 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1232 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; 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 = 1232; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1233 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1233 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; 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 = 1233; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; 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 = 1234; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1235 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1235 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; 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 = 1235; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1236 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1236 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; 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 = 1236; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1237 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1237 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; 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 = 1237; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1238 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1238 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; 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 = 1238; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1239 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1239 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; 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 = 1239; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1240 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1240 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; 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 = 1240; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1241 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1241 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; 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 = 1241; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1242 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1242 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; 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 = 1242; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; 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 = 1243; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1244 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1244 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; 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 = 1244; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1245 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1245 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; 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 = 1245; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1246 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1246 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; 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 = 1246; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1247 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1247 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; 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 = 1247; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1248 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1248 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; 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 = 1248; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1249 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1249 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; 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 = 1249; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1250 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1250 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; 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 = 1250; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1251 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1251 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; 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 = 1251; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1252 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1252 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; 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 = 1252; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1253 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1253 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; 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 = 1253; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; 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 = 1254; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1255 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1255 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; 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 = 1255; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; 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 = 1256; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1257 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1257 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; 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 = 1257; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; 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 = 1258; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1259 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1259 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; 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 = 1259; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1260 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1260 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; 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 = 1260; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1261 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1261 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; 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 = 1261; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1262 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1262 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; 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 = 1262; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1263 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1263 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; 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 = 1263; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1264 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1264 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; 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 = 1264; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1266 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1266 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; 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 = 1266; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1267 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1267 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; 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 = 1267; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1268 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1268 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; 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 = 1268; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1269 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1269 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; 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 = 1269; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1270 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1270 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; 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 = 1270; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1271 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1271 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; 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 = 1271; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1272 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1272 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; 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 = 1272; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1274 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1274 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; 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 = 1274; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1275 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1275 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; 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 = 1275; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; 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 = 1277; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/opt/svn/numpy/numpy/random/mtrand/mtrand.pyx":1278 */ + /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1278 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; @@ -8336,10 +8344,13 @@ "mtrand.pyx", "numpy.pxi", }; -statichere char **__pyx_f = __pyx_filenames; /* Runtime support code */ +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; +} + static int __Pyx_GetStarArgs( PyObject **args, PyObject **kwds, Modified: trunk/numpy/random/mtrand/mtrand.pyx =================================================================== --- trunk/numpy/random/mtrand/mtrand.pyx 2006-09-13 22:06:48 UTC (rev 3146) +++ trunk/numpy/random/mtrand/mtrand.pyx 2006-09-13 23:55:37 UTC (rev 3147) @@ -1020,8 +1020,8 @@ """ cdef ndarray olam olam = PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED) - if _sp.any(_sp.less_equal(olam, 0)): - raise ValueError("lam <= 0") + if _sp.any(_sp.less(olam, 0)): + raise ValueError("lam < 0") return discd_array(self.internal_state, rk_poisson, size, olam) def zipf(self, a, size=None): From numpy-svn at scipy.org Wed Sep 13 21:20:59 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 20:20:59 -0500 (CDT) Subject: [Numpy-svn] r3148 - trunk/numpy/lib Message-ID: <20060914012059.30B6539C08B@new.scipy.org> Author: oliphant Date: 2006-09-13 20:20:52 -0500 (Wed, 13 Sep 2006) New Revision: 3148 Modified: trunk/numpy/lib/index_tricks.py trunk/numpy/lib/shape_base.py trunk/numpy/lib/type_check.py Log: Fix column-stack to not transpose 2-d inputs. Fix iscomplex for strings. Add deprecation warning for c_ Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2006-09-13 23:55:37 UTC (rev 3147) +++ trunk/numpy/lib/index_tricks.py 2006-09-14 01:20:52 UTC (rev 3148) @@ -225,7 +225,7 @@ if start is None: start = 0 if step is None: step = 1 - if type(step) is type(1j): + if isinstance(step, complex): size = int(abs(step)) newobj = function_base.linspace(start, stop, num=size) else: @@ -281,18 +281,20 @@ r_ = r_class() +import warnings + class c_class(concatenator): """Translates slice objects to concatenation along the second axis. - For example: - >>> c_[array([[1],[2],[3]]), array([[4],[5],[6]])] - array([[1, 4], - [2, 5], - [3, 6]]) + This is deprecated. Use r_[...,'-1'] """ def __init__(self): concatenator.__init__(self, -1) + def __getitem__(self, obj): + warnings.warn("c_ is deprecated use r_[...,'-1']") + return concatenator.__getitem__(self, obj) + c_ = c_class() class ndenumerate(object): @@ -383,9 +385,6 @@ # Cosmetic changes by T. Oliphant 2001 # # -# This module provides a convenient method for constructing -# array indices algorithmically. It provides one importable object, -# 'index_expression'. class _index_expression_class(object): """ Modified: trunk/numpy/lib/shape_base.py =================================================================== --- trunk/numpy/lib/shape_base.py 2006-09-13 23:55:37 UTC (rev 3147) +++ trunk/numpy/lib/shape_base.py 2006-09-14 01:20:52 UTC (rev 3148) @@ -141,7 +141,7 @@ """ res = [] for ary in arys: - res.append(array(ary,copy=False,subok=2,ndmin=2)) + res.append(array(ary,copy=False,subok=True,ndmin=2)) if len(res) == 1: return res[0] else: @@ -246,10 +246,13 @@ Description: Take a sequence of 1D arrays and stack them as columns to make a single 2D array. All arrays in the sequence - must have the same length. + must have the same first dimension. 2D arrays are + stacked as-is, just like with hstack. 1D arrays are turned + into 2D columns first. + Arguments: - tup -- sequence of 1D arrays. All arrays must have the same - length. + tup -- sequence of 1D or 2D arrays. All arrays must have the same + first dimension. Examples: >>> import numpy >>> a = array((1,2,3)) @@ -260,7 +263,12 @@ [3, 4]]) """ - arrays = map(_nx.transpose,map(atleast_2d,tup)) + arrays = [] + for v in tup: + arr = array(v,copy=False,subok=True) + if arr.ndim < 2: + arr = array(arr,copy=False,subok=True,ndmin=2).T + arrays.append(arr) return _nx.concatenate(arrays,1) def dstack(tup): Modified: trunk/numpy/lib/type_check.py =================================================================== --- trunk/numpy/lib/type_check.py 2006-09-13 23:55:37 UTC (rev 3147) +++ trunk/numpy/lib/type_check.py 2006-09-14 01:20:52 UTC (rev 3148) @@ -6,7 +6,7 @@ 'common_type'] import numpy.core.numeric as _nx -from numpy.core.numeric import asarray, array, isnan, obj2sctype +from numpy.core.numeric import asarray, array, isnan, obj2sctype, zeros from ufunclike import isneginf, isposinf _typecodes_by_elsize = 'GDFgdfQqLlIiHhBb?' @@ -68,7 +68,11 @@ For scalars, return a boolean. """ - return imag(x) != 0 + ax = asarray(x) + if issubclass(ax.dtype.type, _nx.complexfloating): + return ax.imag != 0 + res = zeros(ax.shape, bool) + return +res # convet to array-scalar if needed def isreal(x): """Return a boolean array where elements are True if that element From numpy-svn at scipy.org Wed Sep 13 21:49:26 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 20:49:26 -0500 (CDT) Subject: [Numpy-svn] r3149 - in trunk/numpy: lib lib/tests oldnumeric Message-ID: <20060914014926.F3E7A39C04E@new.scipy.org> Author: oliphant Date: 2006-09-13 20:49:10 -0500 (Wed, 13 Sep 2006) New Revision: 3149 Modified: trunk/numpy/lib/function_base.py trunk/numpy/lib/tests/test_function_base.py trunk/numpy/lib/tests/test_twodim_base.py trunk/numpy/lib/twodim_base.py trunk/numpy/oldnumeric/functions.py Log: Add histogramnd and fix histogram2d Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2006-09-14 01:20:52 UTC (rev 3148) +++ trunk/numpy/lib/function_base.py 2006-09-14 01:49:10 UTC (rev 3149) @@ -4,23 +4,23 @@ 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp', 'unique', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax', 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average', - 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort', - 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman', - 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring', 'meshgrid', - 'delete', 'insert', 'append' + 'histogram', 'histogramnd', 'bincount', 'digitize', 'cov', + 'corrcoef', 'msort', 'median', 'sinc', 'hamming', 'hanning', + 'bartlett', 'blackman', 'kaiser', 'trapz', 'i0', 'add_newdoc', + 'add_docstring', 'meshgrid', 'delete', 'insert', 'append' ] import types import numpy.core.numeric as _nx from numpy.core.numeric import ones, zeros, arange, concatenate, array, \ - asarray, asanyarray, empty, empty_like, asanyarray, ndarray + asarray, asanyarray, empty, empty_like, asanyarray, ndarray, around from numpy.core.numeric import ScalarType, dot, where, newaxis, intp, \ - integer + integer, isscalar from numpy.core.umath import pi, multiply, add, arctan2, \ - frompyfunc, isnan, cos, less_equal, sqrt, sin, mod, exp + frompyfunc, isnan, cos, less_equal, sqrt, sin, mod, exp, log10 from numpy.core.fromnumeric import ravel, nonzero, choose, sort from numpy.core.numerictypes import typecodes -from numpy.lib.shape_base import atleast_1d +from numpy.lib.shape_base import atleast_1d, atleast_2d from numpy.lib.twodim_base import diag from _compiled_base import _insert, add_docstring from _compiled_base import digitize, bincount @@ -75,8 +75,7 @@ ---------- bins: Number of bins range: Lower and upper bin edges (default: [sample.min(), sample.max()]). - Does not really work, all values greater than range are stored in - the last bin. + All values greater than range are stored in the last bin. normed: If False (default), return the number of samples in each bin. If True, return a frequency distribution. @@ -104,6 +103,130 @@ else: return n, bins +def histogramnd(sample, bins=10, range=None, normed=False): + """histogramnd(sample, bins = 10, range = None, normed = False) -> H, edges + + Return the N-dimensional histogram computed from sample. + + Parameters + ---------- + sample: A sequence of N arrays, or an KxN array. + bins: A sequence of edge arrays, or a sequence of the number of bins. + If a scalar is given, it is assumed to be the number of bins + for all dimensions. + range: A sequence of lower and upper bin edges (default: [min, max]). + normed: If False, returns the number of samples in each bin. + If True, returns the frequency distribution. + + + Output + ------ + H: Histogram array. + edges: List of arrays defining the bin edges. + + Example: + x = random.randn(100,3) + H, edges = histogramnd(x, bins = (5, 6, 7)) + + See also: histogram + """ + + try: + N, D = sample.shape + except (AttributeError, ValueError): + ss = atleast_2d(sample) + sample = ss.transpose() + N, D = sample.shape + + nbin = empty(D, int) + edges = D*[None] + dedges = D*[None] + + try: + M = len(bins) + if M != D: + raise AttributeError, 'The dimension of bins must be a equal to the dimension of the sample x.' + except TypeError: + bins = D*[bins] + + if range is None: + smin = atleast_1d(sample.min(0)) + smax = atleast_1d(sample.max(0)) + else: + smin = zeros(D) + smax = zeros(D) + for i in arange(D): + smin[i], smax[i] = range[i] + + for i in arange(D): + if isscalar(bins[i]): + nbin[i] = bins[i] + edges[i] = linspace(smin[i], smax[i], nbin[i]+1) + else: + edges[i] = asarray(bins[i], float) + nbin[i] = len(edges[i])-1 + + + + Ncount = {} + nbin = asarray(nbin) + + for i in arange(D): + Ncount[i] = digitize(sample[:,i], edges[i]) + dedges[i] = diff(edges[i]) + # Remove values falling outside of bins + # Values that fall on an edge are put in the right bin. + # For the rightmost bin, we want values equal to the right + # edge to be counted in the last bin, and not as an outlier. + outliers = zeros(N, int) + for i in arange(D): + decimal = int(-log10(dedges[i].min())) +6 + on_edge = where(around(sample[:,i], decimal) == around(edges[i][-1], decimal))[0] + Ncount[i][on_edge] -= 1 + outliers += (Ncount[i] == 0) | (Ncount[i] == nbin[i]+1) + indices = where(outliers == 0)[0] + for i in arange(D): + Ncount[i] = Ncount[i][indices] - 1 + N = len(indices) + + # Flattened histogram matrix (1D) + hist = zeros(nbin.prod(), int) + + # Compute the sample indices in the flattened histogram matrix. + ni = nbin.argsort() + shape = [] + xy = zeros(N, int) + for i in arange(0, D-1): + xy += Ncount[ni[i]] * nbin[ni[i+1:]].prod() + + xy += Ncount[ni[-1]] + + # Compute the number of repetitions in xy and assign it to the flattened histmat. + if len(xy) == 0: + return zeros(nbin, int) + + flatcount = bincount(xy) + a = arange(len(flatcount)) + hist[a] = flatcount + + # Shape into a proper matrix + hist = hist.reshape(sort(nbin)) + for i,j in enumerate(ni): + hist = hist.swapaxes(i,j) + if (hist.shape == nbin).all(): + break + + if normed: + s = hist.sum() + for i in arange(D): + shape = ones(D, int) + shape[i] = nbin[i] + hist = hist / dedges[i].reshape(shape) + hist /= s + + return hist, edges + + def average(a, axis=None, weights=None, returned=False): """average(a, axis=None weights=None, returned=False) Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2006-09-14 01:20:52 UTC (rev 3148) +++ trunk/numpy/lib/tests/test_function_base.py 2006-09-14 01:49:10 UTC (rev 3149) @@ -353,6 +353,31 @@ (a,b)=histogram(linspace(0,10,100)) assert(all(a==10)) +class test_histogramnd(NumpyTestCase): + def check_simple(self): + x = array([[-.5, .5, 1.5], [-.5, 1.5, 2.5], [-.5, 2.5, .5], \ + [.5, .5, 1.5], [.5, 1.5, 2.5], [.5, 2.5, 2.5]]) + H, edges = histogramnd(x, (2,3,3), range = [[-1,1], [0,3], [0,3]]) + answer = asarray([[[0,1,0], [0,0,1], [1,0,0]], [[0,1,0], [0,0,1], [0,0,1]]]) + assert(all(H == answer)) + # Check normalization + ed = [[-2,0,2], [0,1,2,3], [0,1,2,3]] + H, edges = histogramnd(x, bins = ed, normed = True) + assert(all(H == answer/12.)) + # Check that H has the correct shape. + H, edges = histogramnd(x, (2,3,4), range = [[-1,1], [0,3], [0,4]], normed=True) + answer = asarray([[[0,1,0,0], [0,0,1,0], [1,0,0,0]], [[0,1,0,0], [0,0,1,0], [0,0,1,0]]]) + assert_array_almost_equal(H, answer/6., 4) + # Check that a sequence of arrays is accepted and H has the correct shape. + z = [squeeze(y) for y in split(x,3,axis=1)] + H, edges = histogramnd(z, bins=(4,3,2),range=[[-2,2], [0,3], [0,2]]) + answer = asarray([[[0,0],[0,0],[0,0]], + [[0,1], [0,0], [1,0]], + [[0,1], [0,0],[0,0]], + [[0,0],[0,0],[0,0]]]) + assert_array_equal(H, answer) + + class test_unique(NumpyTestCase): def check_simple(self): x = array([4,3,2,1,1,2,3,4, 0]) Modified: trunk/numpy/lib/tests/test_twodim_base.py =================================================================== --- trunk/numpy/lib/tests/test_twodim_base.py 2006-09-14 01:20:52 UTC (rev 3148) +++ trunk/numpy/lib/tests/test_twodim_base.py 2006-09-14 01:49:10 UTC (rev 3149) @@ -5,7 +5,8 @@ from numpy.testing import * set_package_path() from numpy import arange, rot90, add, fliplr, flipud, zeros, ones, eye, \ - array, diag + array, diag, histogram2d +import numpy as np restore_path() ################################################## @@ -133,13 +134,12 @@ class test_histogram2d(NumpyTestCase): def check_simple(self): - import numpy as np x = array([ 0.41702200, 0.72032449, 0.00011437481, 0.302332573, 0.146755891]) y = array([ 0.09233859, 0.18626021, 0.34556073, 0.39676747, 0.53881673]) xedges = np.linspace(0,1,10) yedges = np.linspace(0,1,10) - H = np.histogram2d(x, y, (xedges, yedges))[0] - answer = np.array([[0, 0, 0, 1, 0, 0, 0, 0, 0], + H = histogram2d(x, y, (xedges, yedges))[0] + answer = array([[0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0], @@ -148,7 +148,26 @@ [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]]) - assert_equal(H, answer) - + assert_array_equal(H.T, answer) + def check_asym(self): + x = array([1, 1, 2, 3, 4, 4, 4, 5]) + y = array([1, 3, 2, 0, 1, 2, 3, 4]) + H, xed, yed = histogram2d(x,y, (6, 5), range = [[0,6],[0,5]], normed=True) + answer = array([[0.,0,0,0,0], + [0,1,0,1,0], + [0,0,1,0,0], + [1,0,0,0,0], + [0,1,1,1,0], + [0,0,0,0,1]]) + assert_array_almost_equal(H, answer/8., 3) + def check_norm(self): + x = array([1,2,3,1,2,3,1,2,3]) + y = array([1,1,1,2,2,2,3,3,3]) + H, xed, yed = histogram2d(x,y,[[1,2,3,5], [1,2,3,5]], normed=True) + answer=array([[1,1,.5], + [1,1,.5], + [.5,.5,.25]])/9. + assert_array_almost_equal(H, answer, 3) + if __name__ == "__main__": NumpyTest().run() Modified: trunk/numpy/lib/twodim_base.py =================================================================== --- trunk/numpy/lib/twodim_base.py 2006-09-14 01:20:52 UTC (rev 3148) +++ trunk/numpy/lib/twodim_base.py 2006-09-14 01:49:10 UTC (rev 3149) @@ -2,8 +2,8 @@ """ -__all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu','tril', - 'vander','histogram2d'] +__all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu', + 'tril','vander','histogram2d'] from numpy.core.numeric import asanyarray, int_, equal, subtract, arange, \ zeros, arange, greater_equal, multiply, ones, asarray @@ -143,14 +143,21 @@ X[:,i] = x**(N-i-1) return X -def histogram2d(x,y, bins, normed = False): - """Compute the 2D histogram for a dataset (x,y) given the edges or - the number of bins. +def histogram2d(x,y, bins=10, range=None, normed=False): + """histogram2d(x,y, bins=10, range=None, normed=False) -> H, xedges, yedges + + Compute the 2D histogram from samples x,y. - Returns histogram, xedges, yedges. - The histogram array is a count of the number of samples in each bin. - The array is oriented such that H[i,j] is the number of samples falling - into binx[j] and biny[i]. + Parameters + ---------- + x,y: 1D data series. Both arrays must have the same length. + bins: Number of bins -or- [nbin x, nbin y] -or- + [bin edges] -or- [x bin edges, y bin edges]. + range: A sequence of lower and upper bin edges (default: [min, max]). + normed: True or False. + + The histogram array is a count of the number of samples in each + two dimensional bin. Setting normed to True returns a density rather than a bin count. Data falling outside of the edges are not counted. """ @@ -160,33 +167,40 @@ except TypeError: N = 1 bins = [bins] + x = asarray(x) + y = asarray(y) + if range is None: + xmin, xmax = x.min(), x.max() + ymin, ymax = y.min(), y.max() + else: + xmin, xmax = range[0] + ymin, ymax = range[1] if N == 2: if np.isscalar(bins[0]): xnbin = bins[0] - xedges = np.linspace(x.min(), x.max(), xnbin+1) - + xedges = np.linspace(xmin, xmax, xnbin+1) else: xedges = asarray(bins[0], float) xnbin = len(xedges)-1 - if np.isscalar(bins[1]): ynbin = bins[1] - yedges = np.linspace(y.min(), y.max(), ynbin+1) + yedges = np.linspace(ymin, ymax, ynbin+1) else: yedges = asarray(bins[1], float) ynbin = len(yedges)-1 elif N == 1: ynbin = xnbin = bins[0] - xedges = np.linspace(x.min(), x.max(), xnbin+1) - yedges = np.linspace(y.max(), y.min(), ynbin+1) - xedges[-1] *= 1.0001 - yedges[-1] *= 1.0001 + xedges = np.linspace(xmin, xmax, xnbin+1) + yedges = np.linspace(ymin, ymax, ynbin+1) else: yedges = asarray(bins, float) xedges = yedges.copy() ynbin = len(yedges)-1 xnbin = len(xedges)-1 + dxedges = np.diff(xedges) + dyedges = np.diff(yedges) + # Flattened histogram matrix (1D) hist = np.zeros((xnbin)*(ynbin), int) @@ -194,30 +208,41 @@ xbin = np.digitize(x,xedges) ybin = np.digitize(y,yedges) - # Remove the outliers + # Values that fall on an edge are put in the right bin. + # For the rightmost bin, we want values equal to the right + # edge to be counted in the last bin, and not as an outlier. + xdecimal = int(-np.log10(dxedges.min()))+6 + ydecimal = int(-np.log10(dyedges.min()))+6 + on_edge_x = np.where(np.around(x,xdecimal) == np.around(xedges[-1], xdecimal))[0] + on_edge_y = np.where(np.around(y,ydecimal) == np.around(yedges[-1], ydecimal))[0] + xbin[on_edge_x] -= 1 + ybin[on_edge_y] -= 1 + # Remove the true outliers outliers = (xbin==0) | (xbin==xnbin+1) | (ybin==0) | (ybin == ynbin+1) - - xbin = xbin[outliers==False] - ybin = ybin[outliers==False] + xbin = xbin[outliers==False] - 1 + ybin = ybin[outliers==False] - 1 # Compute the sample indices in the flattened histogram matrix. if xnbin >= ynbin: xy = ybin*(xnbin) + xbin - shift = xnbin + 1 + else: xy = xbin*(ynbin) + ybin - shift = ynbin + 1 + # Compute the number of repetitions in xy and assign it to the flattened # histogram matrix. + flatcount = np.bincount(xy) - indices = np.arange(len(flatcount)-shift) - hist[indices] = flatcount[shift:] + indices = np.arange(len(flatcount)) + hist[indices] = flatcount + shape = np.sort([xnbin, ynbin]) # Shape into a proper matrix - histmat = hist.reshape(xnbin, ynbin) - + histmat = hist.reshape(shape) + if (shape == (ynbin, xnbin)).all(): + histmat = histmat.T if normed: - diff2 = np.outer(np.diff(yedges), np.diff(xedges)) + diff2 = np.outer(dxedges, dyedges) histmat = histmat / diff2 / histmat.sum() return histmat, xedges, yedges Modified: trunk/numpy/oldnumeric/functions.py =================================================================== --- trunk/numpy/oldnumeric/functions.py 2006-09-14 01:20:52 UTC (rev 3148) +++ trunk/numpy/oldnumeric/functions.py 2006-09-14 01:49:10 UTC (rev 3149) @@ -119,3 +119,4 @@ def average(a, axis=0, weights=None, returned=False): return N.average(a, axis, weights, returned) + From numpy-svn at scipy.org Wed Sep 13 22:34:05 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 21:34:05 -0500 (CDT) Subject: [Numpy-svn] r3150 - in trunk/numpy/lib: . tests Message-ID: <20060914023405.57EAA39C0B2@new.scipy.org> Author: oliphant Date: 2006-09-13 21:33:55 -0500 (Wed, 13 Sep 2006) New Revision: 3150 Modified: trunk/numpy/lib/function_base.py trunk/numpy/lib/index_tricks.py trunk/numpy/lib/tests/test_index_tricks.py Log: Fix up r_ so you can specify the minimum number of dimensions to force arrays to and allow alteration of the concatenation axis and whether or not to transpose 1d arrays Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2006-09-14 01:49:10 UTC (rev 3149) +++ trunk/numpy/lib/function_base.py 2006-09-14 02:33:55 UTC (rev 3150) @@ -103,7 +103,7 @@ else: return n, bins -def histogramnd(sample, bins=10, range=None, normed=False): +def histogramnd(sample, bins=10, range=None, normed=False): """histogramnd(sample, bins = 10, range = None, normed = False) -> H, edges Return the N-dimensional histogram computed from sample. Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2006-09-14 01:49:10 UTC (rev 3149) +++ trunk/numpy/lib/index_tricks.py 2006-09-14 02:33:55 UTC (rev 3150) @@ -10,7 +10,7 @@ import sys import types import numpy.core.numeric as _nx -from numpy.core.numeric import asarray, ScalarType +from numpy.core.numeric import asarray, ScalarType, array import function_base import numpy.core.defmatrix as matrix @@ -207,6 +207,8 @@ self.col = 0 def __getitem__(self,key): + trans1d = False + ndmin = 1 if isinstance(key, str): frame = sys._getframe().f_back mymat = matrix.bmat(key,frame.f_globals,frame.f_locals) @@ -230,22 +232,47 @@ newobj = function_base.linspace(start, stop, num=size) else: newobj = _nx.arange(start, stop, step) - elif type(key[k]) is str: - if (key[k] in 'rc'): + if ndmin > 1: + newobj = array(newobj,copy=False,ndmin=ndmin) + if trans1d: + newobj = newobj.T + elif isinstance(key[k],str): + if k != 0: + raise ValueError, "special directives must be the"\ + "first entry." + key0 = key[0] + if key0 in 'rc': self.matrix = True - self.col = (key[k] == 'c') + self.col = (key0 == 'c') continue + if ',' in key0: + vec = key0.split(',') + try: + self.axis, ndmin = \ + [int(x) for x in vec[:2]] + if len(vec) == 3 and vec[2] == 't': + trans1d = True + continue + except: + raise ValueError, "unknown special directive" try: self.axis = int(key[k]) continue except (ValueError, TypeError): raise ValueError, "unknown special directive" elif type(key[k]) in ScalarType: - newobj = asarray([key[k]]) + newobj = array(key[k],ndmin=ndmin) scalars.append(k) scalar = True else: newobj = key[k] + if ndmin > 1: + tempobj = array(newobj, copy=False, subok=True) + newobj = array(newobj, copy=False, subok=True, + ndmin=ndmin) + if trans1d and tempobj.ndim == 1: + newobj = newobj.T + del tempobj objs.append(newobj) if isinstance(newobj, _nx.ndarray) and not scalar: if final_dtypedescr is None: @@ -286,13 +313,13 @@ class c_class(concatenator): """Translates slice objects to concatenation along the second axis. - This is deprecated. Use r_[...,'-1'] + This is deprecated. Use r_['-1',...] """ def __init__(self): concatenator.__init__(self, -1) def __getitem__(self, obj): - warnings.warn("c_ is deprecated use r_[...,'-1']") + warnings.warn("c_ is deprecated use r_['-1',...]") return concatenator.__getitem__(self, obj) c_ = c_class() Modified: trunk/numpy/lib/tests/test_index_tricks.py =================================================================== --- trunk/numpy/lib/tests/test_index_tricks.py 2006-09-14 01:49:10 UTC (rev 3149) +++ trunk/numpy/lib/tests/test_index_tricks.py 2006-09-14 02:33:55 UTC (rev 3150) @@ -39,7 +39,7 @@ def check_2d(self): b = rand(5,5) c = rand(5,5) - d = r_[b,c,'1'] # append columns + d = r_['1',b,c] # append columns assert(d.shape == (5,10)) assert_array_equal(d[:,:5],b) assert_array_equal(d[:,5:],c) From numpy-svn at scipy.org Wed Sep 13 23:19:13 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 22:19:13 -0500 (CDT) Subject: [Numpy-svn] r3151 - trunk/numpy/lib Message-ID: <20060914031913.19C6839C0B2@new.scipy.org> Author: oliphant Date: 2006-09-13 22:19:04 -0500 (Wed, 13 Sep 2006) New Revision: 3151 Modified: trunk/numpy/lib/index_tricks.py Log: Fix transpose implementation to work with higher dimensional arrays as well Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2006-09-14 02:33:55 UTC (rev 3150) +++ trunk/numpy/lib/index_tricks.py 2006-09-14 03:19:04 UTC (rev 3151) @@ -207,7 +207,7 @@ self.col = 0 def __getitem__(self,key): - trans1d = False + trans1d = -1 ndmin = 1 if isinstance(key, str): frame = sys._getframe().f_back @@ -234,8 +234,8 @@ newobj = _nx.arange(start, stop, step) if ndmin > 1: newobj = array(newobj,copy=False,ndmin=ndmin) - if trans1d: - newobj = newobj.T + if trans1d != -1: + newobj = newobj.swapaxes(-1,trans1d) elif isinstance(key[k],str): if k != 0: raise ValueError, "special directives must be the"\ @@ -250,8 +250,8 @@ try: self.axis, ndmin = \ [int(x) for x in vec[:2]] - if len(vec) == 3 and vec[2] == 't': - trans1d = True + if len(vec) == 3: + trans1d = int(vec[2]) continue except: raise ValueError, "unknown special directive" @@ -270,8 +270,15 @@ tempobj = array(newobj, copy=False, subok=True) newobj = array(newobj, copy=False, subok=True, ndmin=ndmin) - if trans1d and tempobj.ndim == 1: - newobj = newobj.T + if trans1d != -1 and tempobj.ndim < ndmin: + k2 = ndmin-tempobj.ndim + if (trans1d < 0): + trans1d += k2 + 1 + defaxes = range(ndmin) + k1 = trans1d + axes = defaxes[:k1] + defaxes[k2:] + \ + defaxes[k1:k2] + newobj = newobj.transpose(axes) del tempobj objs.append(newobj) if isinstance(newobj, _nx.ndarray) and not scalar: From numpy-svn at scipy.org Wed Sep 13 23:36:09 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 22:36:09 -0500 (CDT) Subject: [Numpy-svn] r3152 - trunk/numpy/core/include/numpy Message-ID: <20060914033609.869F039C063@new.scipy.org> Author: oliphant Date: 2006-09-13 22:36:03 -0500 (Wed, 13 Sep 2006) New Revision: 3152 Modified: trunk/numpy/core/include/numpy/ufuncobject.h Log: Add a few more defined checks for FreeBSD and NetBSD Modified: trunk/numpy/core/include/numpy/ufuncobject.h =================================================================== --- trunk/numpy/core/include/numpy/ufuncobject.h 2006-09-14 03:19:04 UTC (rev 3151) +++ trunk/numpy/core/include/numpy/ufuncobject.h 2006-09-14 03:36:03 UTC (rev 3152) @@ -251,7 +251,7 @@ /* Solaris --------------------------------------------------------*/ /* --------ignoring SunOS ieee_flags approach, someone else can ** deal with that! */ -#elif defined(sun) || defined(__BSD__) || defined(__OpenBSD__) +#elif defined(sun) || defined(__BSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) #include #define UFUNC_CHECK_STATUS(ret) { \ From numpy-svn at scipy.org Wed Sep 13 23:52:33 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Sep 2006 22:52:33 -0500 (CDT) Subject: [Numpy-svn] r3153 - trunk/numpy/lib Message-ID: <20060914035233.C82D739C063@new.scipy.org> Author: oliphant Date: 2006-09-13 22:52:21 -0500 (Wed, 13 Sep 2006) New Revision: 3153 Modified: trunk/numpy/lib/index_tricks.py Log: Don't deprecate c_. Use it as short-hand for a common case Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2006-09-14 03:36:03 UTC (rev 3152) +++ trunk/numpy/lib/index_tricks.py 2006-09-14 03:52:21 UTC (rev 3153) @@ -199,16 +199,18 @@ self.col = 0 return res - def __init__(self, axis=0, matrix=False): + def __init__(self, axis=0, matrix=False, ndmin=1, trans1d=-1): self._axis = axis self._matrix = matrix self.axis = axis self.matrix = matrix self.col = 0 + self.trans1d = trans1d + self.ndmin = ndmin def __getitem__(self,key): - trans1d = -1 - ndmin = 1 + trans1d = self.trans1d + ndmin = self.ndmin if isinstance(key, str): frame = sys._getframe().f_back mymat = matrix.bmat(key,frame.f_globals,frame.f_locals) @@ -320,15 +322,11 @@ class c_class(concatenator): """Translates slice objects to concatenation along the second axis. - This is deprecated. Use r_['-1',...] + This is equivalent to r_['-1,2,0',...] """ def __init__(self): - concatenator.__init__(self, -1) + concatenator.__init__(self, -1, ndmin=2, trans1d=0) - def __getitem__(self, obj): - warnings.warn("c_ is deprecated use r_['-1',...]") - return concatenator.__getitem__(self, obj) - c_ = c_class() class ndenumerate(object): From numpy-svn at scipy.org Thu Sep 14 05:01:01 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Sep 2006 04:01:01 -0500 (CDT) Subject: [Numpy-svn] r3154 - trunk/numpy Message-ID: <20060914090101.69C2539C076@new.scipy.org> Author: oliphant Date: 2006-09-14 04:00:57 -0500 (Thu, 14 Sep 2006) New Revision: 3154 Modified: trunk/numpy/ctypeslib.py Log: ndpointer will still work even without ctypes installed. Modified: trunk/numpy/ctypeslib.py =================================================================== --- trunk/numpy/ctypeslib.py 2006-09-14 03:52:21 UTC (rev 3153) +++ trunk/numpy/ctypeslib.py 2006-09-14 09:00:57 UTC (rev 3154) @@ -13,10 +13,8 @@ if ctypes is None: def _dummy(*args, **kwds): raise ImportError, "ctypes is not available." + ctypes_load_library = _dummy load_library = _dummy - ndpointer = _dummy - ctypes_load_library = _dummy - from numpy import intp as c_intp else: import numpy.core._internal as nic @@ -40,95 +38,97 @@ libpath = os.path.join(libdir, libname) return ctypes.cdll[libpath] - def _num_fromflags(flaglist): - num = 0 - for val in flaglist: - num += _flagdict[val] - return num + ctypes_load_library = deprecate(load_library, 'ctypes_load_library', + 'load_library') - def _flags_fromnum(num): - res = [] - for key, value in _flagdict.items(): - if (num & value): - res.append(key) - return res +def _num_fromflags(flaglist): + num = 0 + for val in flaglist: + num += _flagdict[val] + return num - ctypes_load_library = deprecate(load_library, 'ctypes_load_library', 'load_library') +def _flags_fromnum(num): + res = [] + for key, value in _flagdict.items(): + if (num & value): + res.append(key) + return res - class _ndptr(object): - def from_param(cls, obj): - if not isinstance(obj, ndarray): - raise TypeError, "argument must be an ndarray" - if cls._dtype_ is not None \ - and obj.dtype != cls._dtype_: - raise TypeError, "array must have data type %s" % cls._dtype_ - if cls._ndim_ is not None \ - and obj.ndim != cls._ndim_: - raise TypeError, "array must have %d dimension(s)" % cls._ndim_ - if cls._shape_ is not None \ - and obj.shape != cls._shape_: - raise TypeError, "array must have shape %s" % str(cls._shape_) - if cls._flags_ is not None \ - and ((obj.flags.num & cls._flags_) != cls._flags_): - raise TypeError, "array must have flags %s" % \ - _flags_fromnum(cls._flags_) - return obj.ctypes - from_param = classmethod(from_param) +class _ndptr(object): + def from_param(cls, obj): + if not isinstance(obj, ndarray): + raise TypeError, "argument must be an ndarray" + if cls._dtype_ is not None \ + and obj.dtype != cls._dtype_: + raise TypeError, "array must have data type %s" % cls._dtype_ + if cls._ndim_ is not None \ + and obj.ndim != cls._ndim_: + raise TypeError, "array must have %d dimension(s)" % cls._ndim_ + if cls._shape_ is not None \ + and obj.shape != cls._shape_: + raise TypeError, "array must have shape %s" % str(cls._shape_) + if cls._flags_ is not None \ + and ((obj.flags.num & cls._flags_) != cls._flags_): + raise TypeError, "array must have flags %s" % \ + _flags_fromnum(cls._flags_) + return obj.ctypes + from_param = classmethod(from_param) - # Factory for an array-checking class with from_param defined for - # use with ctypes argtypes mechanism - _pointer_type_cache = {} - def ndpointer(dtype=None, ndim=None, shape=None, flags=None): - if dtype is not None: - dtype = _dtype(dtype) - num = None - if flags is not None: - if isinstance(flags, str): - flags = flags.split(',') - elif isinstance(flags, (int, integer)): - num = flags - flags = _flags_fromnum(num) - elif isinstance(flags, flagsobj): - num = flags.num - flags = _flags_fromnum(num) - if num is None: - try: - flags = [x.strip().upper() for x in flags] - except: - raise TypeError, "invalid flags specification" - num = _num_fromflags(flags) + +# Factory for an array-checking class with from_param defined for +# use with ctypes argtypes mechanism +_pointer_type_cache = {} +def ndpointer(dtype=None, ndim=None, shape=None, flags=None): + if dtype is not None: + dtype = _dtype(dtype) + num = None + if flags is not None: + if isinstance(flags, str): + flags = flags.split(',') + elif isinstance(flags, (int, integer)): + num = flags + flags = _flags_fromnum(num) + elif isinstance(flags, flagsobj): + num = flags.num + flags = _flags_fromnum(num) + if num is None: + try: + flags = [x.strip().upper() for x in flags] + except: + raise TypeError, "invalid flags specification" + num = _num_fromflags(flags) + try: + return _pointer_type_cache[(dtype, ndim, shape, num)] + except KeyError: + pass + if dtype is None: + name = 'any' + elif dtype.names: + name = str(id(dtype)) + else: + name = dtype.str + if ndim is not None: + name += "_%dd" % ndim + if shape is not None: try: - return _pointer_type_cache[(dtype, ndim, shape, num)] - except KeyError: - pass - if dtype is None: - name = 'any' - elif dtype.names: - name = str(id(dtype)) - else: - name = dtype.str - if ndim is not None: - name += "_%dd" % ndim - if shape is not None: - try: - strshape = [str(x) for x in shape] - except TypeError: - strshape = [str(shape)] - shape = (shape,) - shape = tuple(shape) - name += "_"+"x".join(strshape) - if flags is not None: - name += "_"+"_".join(flags) - else: - flags = [] - klass = type("ndpointer_%s"%name, (_ndptr,), - {"_dtype_": dtype, - "_shape_" : shape, - "_ndim_" : ndim, - "_flags_" : num}) - _pointer_type_cache[dtype] = klass - return klass + strshape = [str(x) for x in shape] + except TypeError: + strshape = [str(shape)] + shape = (shape,) + shape = tuple(shape) + name += "_"+"x".join(strshape) + if flags is not None: + name += "_"+"_".join(flags) + else: + flags = [] + klass = type("ndpointer_%s"%name, (_ndptr,), + {"_dtype_": dtype, + "_shape_" : shape, + "_ndim_" : ndim, + "_flags_" : num}) + _pointer_type_cache[dtype] = klass + return klass def test(level=1, verbosity=1): from numpy.testing import NumpyTest From numpy-svn at scipy.org Thu Sep 14 14:55:25 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Sep 2006 13:55:25 -0500 (CDT) Subject: [Numpy-svn] r3155 - trunk/numpy/core/src Message-ID: <20060914185525.A0EB539C050@new.scipy.org> Author: oliphant Date: 2006-09-14 13:55:14 -0500 (Thu, 14 Sep 2006) New Revision: 3155 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix a.flat = [] Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-14 09:00:57 UTC (rev 3154) +++ trunk/numpy/core/src/arrayobject.c 2006-09-14 18:55:14 UTC (rev 3155) @@ -5305,15 +5305,6 @@ /* It is bad to have unitialized OBJECT pointers */ /* which could also be sub-fields of a VOID array */ if (descr->hasobject) { - /* - if (descr != &OBJECT_Descr) { - PyErr_SetString(PyExc_TypeError, - "fields with object members " \ - "not yet supported."); - goto fail; - } - */ - memset(data, 0, sd); } } @@ -5345,7 +5336,7 @@ /* update flags before finalize function */ PyArray_UpdateFlags(self, UPDATE_ALL); } - if PyCObject_Check(func) { + if PyCObject_Check(func) { /* A C-function is stored here */ PyArray_FinalizeFunc *cfunc; cfunc = PyCObject_AsVoidPtr(func); Py_DECREF(func); @@ -6473,6 +6464,11 @@ selfit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self); if (selfit == NULL) goto exit; + if (arrit->size == 0 || selfit->size == 0) { + PyErr_SetString(PyExc_ValueError, "trying to set with 0-sized array"); + goto exit; + } + swap = PyArray_ISNOTSWAPPED(self) != PyArray_ISNOTSWAPPED(arr); copyswap = self->descr->f->copyswap; if (self->descr->hasobject) { @@ -6480,8 +6476,9 @@ PyArray_Item_XDECREF(selfit->dataptr, self->descr); PyArray_Item_INCREF(arrit->dataptr, PyArray_DESCR(arr)); memmove(selfit->dataptr, arrit->dataptr, - sizeof(PyObject *)); - copyswap(selfit->dataptr, NULL, swap, self); + sizeof(PyObject **)); + if (swap) + copyswap(selfit->dataptr, NULL, swap, self); PyArray_ITER_NEXT(selfit); PyArray_ITER_NEXT(arrit); if (arrit->index == arrit->size) @@ -6493,7 +6490,8 @@ while(selfit->index < selfit->size) { memmove(selfit->dataptr, arrit->dataptr, self->descr->elsize); - copyswap(selfit->dataptr, NULL, swap, self); + if (swap) + copyswap(selfit->dataptr, NULL, swap, self); PyArray_ITER_NEXT(selfit); PyArray_ITER_NEXT(arrit); if (arrit->index == arrit->size) @@ -9219,6 +9217,11 @@ if (arrval==NULL) return -1; val_it = (PyArrayIterObject *)PyArray_IterNew(arrval); if (val_it==NULL) goto finish; + if (val_it->size == 0) { + PyErr_SetString(PyExc_ValueError, + "trying to set with zero-sized array"); + goto finish; + } /* Check for Boolean -- this is first becasue Bool is a subclass of Int */ @@ -9655,7 +9658,7 @@ /* Sub-space iteration */ if (mit->subspace != NULL) { PyArray_ITER_NEXT(mit->subspace); - if (mit->subspace->index == mit->subspace->size) { + if (mit->subspace->index >= mit->subspace->size) { /* reset coord to coordinates of beginning of the subspace */ memcpy(coord, mit->bscoord, From numpy-svn at scipy.org Thu Sep 14 17:39:24 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Sep 2006 16:39:24 -0500 (CDT) Subject: [Numpy-svn] r3156 - trunk/numpy/core/src Message-ID: <20060914213924.86A9D39C0A0@new.scipy.org> Author: oliphant Date: 2006-09-14 16:39:21 -0500 (Thu, 14 Sep 2006) New Revision: 3156 Modified: trunk/numpy/core/src/arrayobject.c Log: Eliminate unnecessary check. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-14 18:55:14 UTC (rev 3155) +++ trunk/numpy/core/src/arrayobject.c 2006-09-14 21:39:21 UTC (rev 3156) @@ -6464,7 +6464,7 @@ selfit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self); if (selfit == NULL) goto exit; - if (arrit->size == 0 || selfit->size == 0) { + if (arrit->size == 0) { PyErr_SetString(PyExc_ValueError, "trying to set with 0-sized array"); goto exit; } From numpy-svn at scipy.org Thu Sep 14 19:41:02 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Sep 2006 18:41:02 -0500 (CDT) Subject: [Numpy-svn] r3157 - trunk/numpy/core/src Message-ID: <20060914234102.2283339C060@new.scipy.org> Author: oliphant Date: 2006-09-14 18:40:52 -0500 (Thu, 14 Sep 2006) New Revision: 3157 Modified: trunk/numpy/core/src/arraymethods.c Log: Fix problem with .item(n) for 1-d case. Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-14 21:39:21 UTC (rev 3156) +++ trunk/numpy/core/src/arraymethods.c 2006-09-14 23:40:52 UTC (rev 3157) @@ -494,7 +494,8 @@ return NULL; } if (self->nd == 1) { - return self->descr->f->getitem(self->data + value, + value *= self->strides[0]; + return self->descr->f->getitem(self->data + value, self); } nd = self->nd; @@ -600,6 +601,7 @@ return NULL; } if (self->nd == 1) { + value *= self->strides[0]; ret = self->descr->f->setitem(obj, self->data + value, self); goto finish; From numpy-svn at scipy.org Fri Sep 15 12:59:20 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 11:59:20 -0500 (CDT) Subject: [Numpy-svn] r3158 - trunk/numpy/numarray Message-ID: <20060915165920.091D339C074@new.scipy.org> Author: oliphant Date: 2006-09-15 11:59:14 -0500 (Fri, 15 Sep 2006) New Revision: 3158 Modified: trunk/numpy/numarray/functions.py trunk/numpy/numarray/numerictypes.py Log: Fix numarray.info function Modified: trunk/numpy/numarray/functions.py =================================================================== --- trunk/numpy/numarray/functions.py 2006-09-14 23:40:52 UTC (rev 3157) +++ trunk/numpy/numarray/functions.py 2006-09-15 16:59:14 UTC (rev 3158) @@ -347,10 +347,10 @@ print "byteoffset: 0" print "bytestride: ", obj.strides[0] print "itemsize: ", obj.itemsize - print "aligned: ", obj.flags.isaligned + print "aligned: ", obj.flags.aligned print "contiguous: ", obj.flags.contiguous - print "buffer: ", obj.data - print "data pointer:", obj._as_paramater_, "(DEBUG ONLY)" + print "buffer: ", repr(obj.data) + print "data pointer:", obj.ctypes._as_parameter_, "(DEBUG ONLY)" print "byteorder: ", endian = obj.dtype.byteorder if endian in ['|','=']: @@ -360,7 +360,7 @@ else: print "little" print "byteswap: ", not obj.dtype.isnative - print "type: ", typefrom(obj) + print "type: ", typefrom(obj).name #clipmode is ignored if axis is not 0 and array is not 1d def put(array, indices, values, axis=0, clipmode=RAISE): Modified: trunk/numpy/numarray/numerictypes.py =================================================================== --- trunk/numpy/numarray/numerictypes.py 2006-09-14 23:40:52 UTC (rev 3157) +++ trunk/numpy/numarray/numerictypes.py 2006-09-15 16:59:14 UTC (rev 3158) @@ -530,6 +530,23 @@ for key,value in _scipy_dtypechar.items(): _scipy_dtypechar_inverse[value] = key +_val = numpy.int_(0).itemsize +if _val == 8: + _scipy_dtypechar_inverse['l'] = Int64 + _scipy_dtypechar_inverse['L'] = UInt64 +elif _val == 4: + _scipy_dtypechar_inverse['l'] = Int32 + _scipy_dtypechar_inverse['L'] = UInt32 + +del _val + +if LP64: + _scipy_dtypechar_inverse['p'] = Int64 + _scipy_dtypechar_inverse['P'] = UInt64 +else: + _scipy_dtypechar_inverse['p'] = Int32 + _scipy_dtypechar_inverse['P'] = UInt32 + def typefrom(obj): return _scipy_dtypechar_inverse[obj.dtype.char] From numpy-svn at scipy.org Fri Sep 15 13:25:02 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 12:25:02 -0500 (CDT) Subject: [Numpy-svn] r3159 - trunk/numpy/core/src Message-ID: <20060915172502.05B9339C074@new.scipy.org> Author: oliphant Date: 2006-09-15 12:24:44 -0500 (Fri, 15 Sep 2006) New Revision: 3159 Modified: trunk/numpy/core/src/arrayobject.c Log: Don't raise errors when setting with a zero-sized array, just exit Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-15 16:59:14 UTC (rev 3158) +++ trunk/numpy/core/src/arrayobject.c 2006-09-15 17:24:44 UTC (rev 3159) @@ -6464,10 +6464,7 @@ selfit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self); if (selfit == NULL) goto exit; - if (arrit->size == 0) { - PyErr_SetString(PyExc_ValueError, "trying to set with 0-sized array"); - goto exit; - } + if (arrit->size == 0) {retval = 0; goto exit;} swap = PyArray_ISNOTSWAPPED(self) != PyArray_ISNOTSWAPPED(arr); copyswap = self->descr->f->copyswap; @@ -9217,11 +9214,7 @@ if (arrval==NULL) return -1; val_it = (PyArrayIterObject *)PyArray_IterNew(arrval); if (val_it==NULL) goto finish; - if (val_it->size == 0) { - PyErr_SetString(PyExc_ValueError, - "trying to set with zero-sized array"); - goto finish; - } + if (val_it->size == 0) {retval = 0; goto finish;} /* Check for Boolean -- this is first becasue Bool is a subclass of Int */ From numpy-svn at scipy.org Fri Sep 15 14:05:32 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 13:05:32 -0500 (CDT) Subject: [Numpy-svn] r3160 - in trunk/numpy/core: code_generators include/numpy src Message-ID: <20060915180532.D585739C016@new.scipy.org> Author: oliphant Date: 2006-09-15 13:05:27 -0500 (Fri, 15 Sep 2006) New Revision: 3160 Modified: trunk/numpy/core/code_generators/multiarray_api_order.txt trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/multiarraymodule.c Log: Add DescrAlignConverter Modified: trunk/numpy/core/code_generators/multiarray_api_order.txt =================================================================== --- trunk/numpy/core/code_generators/multiarray_api_order.txt 2006-09-15 17:24:44 UTC (rev 3159) +++ trunk/numpy/core/code_generators/multiarray_api_order.txt 2006-09-15 18:05:27 UTC (rev 3160) @@ -78,3 +78,5 @@ PyArray_BroadcastToShape _PyArray_SigintHandler _PyArray_GetSigintBuf +PyArray_DescrAlignConverter +PyArray_DescrAlignConverter2 \ No newline at end of file Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-15 17:24:44 UTC (rev 3159) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-15 18:05:27 UTC (rev 3160) @@ -1478,6 +1478,7 @@ #define PyArray_ToScalar(data, arr) \ PyArray_Scalar(data, PyArray_DESCR(arr), (PyObject *)arr) + /* These might be faster without the dereferencing of obj going on inside -- of course an optimizing compiler should inline the constants inside a for loop making it a moot point Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-15 17:24:44 UTC (rev 3159) +++ trunk/numpy/core/src/arrayobject.c 2006-09-15 18:05:27 UTC (rev 3160) @@ -10729,32 +10729,10 @@ return NULL; if (align) { - conv = NULL; - if PyDict_Check(odescr) - conv = _convert_from_dict(odescr, 1); - else if PyList_Check(odescr) { - PyErr_SetString(PyExc_ValueError, - "align cannot be True" \ - " with array_descriptor " \ - "specification."); - return NULL; - } - else if PyString_Check(odescr) - conv = _convert_from_commastring(odescr, 1); - else { - PyErr_SetString(PyExc_ValueError, - "align can only be non-zero for " \ - "dictionary, list, and string objects."); - } - if (conv) return (PyObject *)conv; - if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, - "data-type-descriptor not understood"); - } - return NULL; + if (!PyArray_DescrAlignConverter(odescr, &conv)) + return NULL; } - - if (!PyArray_DescrConverter(odescr, &conv)) + else if (!PyArray_DescrConverter(odescr, &conv)) return NULL; /* Get a new copy of it unless it's already a copy */ if (copy && conv->fields == Py_None) { Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-15 17:24:44 UTC (rev 3159) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-15 18:05:27 UTC (rev 3160) @@ -4661,6 +4661,57 @@ /*MULTIARRAY_API + Get type-descriptor from an object forcing alignment if possible + None goes to DEFAULT type. +*/ +static int +PyArray_DescrAlignConverter(PyObject *obj, PyArray_Descr **at) +{ + if PyDict_Check(obj) { + *at = _convert_from_dict(obj, 1); + } + else if PyString_Check(obj) + *at = _convert_from_commastring(obj, 1); + else { + return PyArray_DescrConverter(obj, at); + } + if (*at == NULL) { + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ValueError, + "data-type-descriptor not understood"); + } + return PY_FAIL; + } + return PY_SUCCEED; +} + +/*MULTIARRAY_API + Get type-descriptor from an object forcing alignment if possible + None goes to NULL. +*/ +static int +PyArray_DescrAlignConverter2(PyObject *obj, PyArray_Descr **at) +{ + if PyDict_Check(obj) { + *at = _convert_from_dict(obj, 1); + } + else if PyString_Check(obj) + *at = _convert_from_commastring(obj, 1); + else { + return PyArray_DescrConverter2(obj, at); + } + if (*at == NULL) { + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ValueError, + "data-type-descriptor not understood"); + } + return PY_FAIL; + } + return PY_SUCCEED; +} + + +/*MULTIARRAY_API Get typenum from an object -- None goes to NULL */ static int From numpy-svn at scipy.org Fri Sep 15 14:24:36 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 13:24:36 -0500 (CDT) Subject: [Numpy-svn] r3161 - trunk/numpy/core Message-ID: <20060915182436.223C039C016@new.scipy.org> Author: oliphant Date: 2006-09-15 13:24:30 -0500 (Fri, 15 Sep 2006) New Revision: 3161 Modified: trunk/numpy/core/_internal.py Log: Fix .descr of aligned structures Modified: trunk/numpy/core/_internal.py =================================================================== --- trunk/numpy/core/_internal.py 2006-09-15 18:05:27 UTC (rev 3160) +++ trunk/numpy/core/_internal.py 2006-09-15 18:24:30 UTC (rev 3161) @@ -87,7 +87,9 @@ offset = 0 for field in ordered_fields: if field[1] > offset: - result.append(('','|V%d' % (field[1]-offset))) + num = field[1] - offset + result.append(('','|V%d' % num)) + offset += num if len(field) > 3: name = (field[2],field[3]) else: From numpy-svn at scipy.org Fri Sep 15 15:31:51 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 14:31:51 -0500 (CDT) Subject: [Numpy-svn] r3162 - trunk/numpy/core Message-ID: <20060915193151.9BAE939C016@new.scipy.org> Author: oliphant Date: 2006-09-15 14:31:48 -0500 (Fri, 15 Sep 2006) New Revision: 3162 Modified: trunk/numpy/core/numerictypes.py Log: Add 'a' to sctypeDict. Fixes #279 Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2006-09-15 18:24:30 UTC (rev 3161) +++ trunk/numpy/core/numerictypes.py 2006-09-15 19:31:48 UTC (rev 3162) @@ -444,7 +444,7 @@ # Add additional strings to the sctypeDict _toadd = ['int', 'float', 'complex', 'bool', 'object', 'string', ('str', allTypes['string_']), - 'unicode', 'object'] + 'unicode', 'object', ('a', allTypes['string_'])] for name in _toadd: if isinstance(name, tuple): From numpy-svn at scipy.org Fri Sep 15 15:48:29 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 14:48:29 -0500 (CDT) Subject: [Numpy-svn] r3163 - trunk/numpy/lib Message-ID: <20060915194829.7441D39C0CE@new.scipy.org> Author: oliphant Date: 2006-09-15 14:48:27 -0500 (Fri, 15 Sep 2006) New Revision: 3163 Modified: trunk/numpy/lib/utils.py Log: Clean up info(ndarray) Modified: trunk/numpy/lib/utils.py =================================================================== --- trunk/numpy/lib/utils.py 2006-09-15 19:31:48 UTC (rev 3162) +++ trunk/numpy/lib/utils.py 2006-09-15 19:48:27 UTC (rev 3163) @@ -213,7 +213,6 @@ thedict[modname] = moddict return thedict, dictlist - def info(object=None,maxwidth=76,output=sys.stdout,toplevel='numpy'): """Get help information for a function, class, or module. @@ -276,16 +275,16 @@ elif inspect.isclass(object): name = object.__name__ - if hasattr(object, '__init__'): - arguments = apply(inspect.formatargspec, inspect.getargspec(object.__init__.im_func)) - arglist = arguments.split(', ') - if len(arglist) > 1: - arglist[1] = "("+arglist[1] - arguments = ", ".join(arglist[1:]) - else: - arguments = "()" - else: - arguments = "()" + arguments = "()" + try: + if hasattr(object, '__init__'): + arguments = apply(inspect.formatargspec, inspect.getargspec(object.__init__.im_func)) + arglist = arguments.split(', ') + if len(arglist) > 1: + arglist[1] = "("+arglist[1] + arguments = ", ".join(arglist[1:]) + except: + pass if len(name+arguments) > maxwidth: argstr = _split_line(name, arguments, maxwidth) From numpy-svn at scipy.org Fri Sep 15 17:06:50 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 16:06:50 -0500 (CDT) Subject: [Numpy-svn] r3164 - trunk/numpy/distutils Message-ID: <20060915210650.40DE939C121@new.scipy.org> Author: oliphant Date: 2006-09-15 16:06:47 -0500 (Fri, 15 Sep 2006) New Revision: 3164 Modified: trunk/numpy/distutils/misc_util.py Log: Fix subversion number getting for 1.4 clients. Also works for pre 1.4 clients. Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2006-09-15 19:48:27 UTC (rev 3163) +++ trunk/numpy/distutils/misc_util.py 2006-09-15 21:06:47 UTC (rev 3164) @@ -1201,14 +1201,31 @@ def _get_svn_revision(self,path): """ Return path's SVN revision number. """ - entries = njoin(path,'.svn','entries') revision = None + try: + sin, sout = os.popen4('svnversion') + m = re.search(r'(?P\d+)', sout.read()) + if m: + revision = int(m.group('revision')) + return revision + except: + pass + if sys.platform=='win32' and os.environ.get('SVN_ASP_DOT_NET_HACK',None): + entries = njoin(path,'_svn','entries') + else: + entries = njoin(path,'.svn','entries') if os.path.isfile(entries): f = open(entries) - m = re.search(r'revision="(?P\d+)"',f.read()) + fstr = f.read() f.close() - if m: - revision = int(m.group('revision')) + if fstr[:5] == '\d+)"',fstr) + if m: + revision = int(m.group('revision')) + else: # non-xml entries file --- check to be sure that + m = re.search(r'dir[\n\r]+(?P\d+)', fstr) + if m: + revision = int(m.group('revision')) return revision def get_version(self, version_file=None, version_variable=None): From numpy-svn at scipy.org Fri Sep 15 17:13:13 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 16:13:13 -0500 (CDT) Subject: [Numpy-svn] r3165 - trunk/numpy/distutils Message-ID: <20060915211313.9153539C136@new.scipy.org> Author: oliphant Date: 2006-09-15 16:13:09 -0500 (Fri, 15 Sep 2006) New Revision: 3165 Modified: trunk/numpy/distutils/misc_util.py Log: Fix when svnversion is not present. Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2006-09-15 21:06:47 UTC (rev 3164) +++ trunk/numpy/distutils/misc_util.py 2006-09-15 21:13:09 UTC (rev 3165) @@ -1204,7 +1204,7 @@ revision = None try: sin, sout = os.popen4('svnversion') - m = re.search(r'(?P\d+)', sout.read()) + m = re.match(r'(?P\d+)', sout.read()) if m: revision = int(m.group('revision')) return revision From numpy-svn at scipy.org Fri Sep 15 17:18:53 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 16:18:53 -0500 (CDT) Subject: [Numpy-svn] r3166 - trunk/numpy/distutils Message-ID: <20060915211853.5EE7139C06F@new.scipy.org> Author: oliphant Date: 2006-09-15 16:18:33 -0500 (Fri, 15 Sep 2006) New Revision: 3166 Modified: trunk/numpy/distutils/misc_util.py Log: Small code re-org in _get_svn_revision Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2006-09-15 21:13:09 UTC (rev 3165) +++ trunk/numpy/distutils/misc_util.py 2006-09-15 21:18:33 UTC (rev 3166) @@ -1202,14 +1202,15 @@ """ Return path's SVN revision number. """ revision = None + m = None try: sin, sout = os.popen4('svnversion') m = re.match(r'(?P\d+)', sout.read()) - if m: - revision = int(m.group('revision')) - return revision except: pass + if m: + revision = int(m.group('revision')) + return revision if sys.platform=='win32' and os.environ.get('SVN_ASP_DOT_NET_HACK',None): entries = njoin(path,'_svn','entries') else: From numpy-svn at scipy.org Fri Sep 15 18:41:06 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 17:41:06 -0500 (CDT) Subject: [Numpy-svn] r3167 - trunk/numpy/core Message-ID: <20060915224106.05FE939C030@new.scipy.org> Author: oliphant Date: 2006-09-15 17:40:54 -0500 (Fri, 15 Sep 2006) New Revision: 3167 Modified: trunk/numpy/core/numeric.py Log: Add rollaxis command and fix cross function Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2006-09-15 21:18:33 UTC (rev 3166) +++ trunk/numpy/core/numeric.py 2006-09-15 22:40:54 UTC (rev 3167) @@ -7,7 +7,7 @@ 'asarray', 'asanyarray', 'ascontiguousarray', 'asfortranarray', 'isfortran', 'empty_like', 'zeros_like', 'correlate', 'convolve', 'inner', 'dot', 'outer', 'vdot', - 'alterdot', 'restoredot', 'cross', 'tensordot', + 'alterdot', 'restoredot', 'rollaxis', 'cross', 'tensordot', 'array2string', 'get_printoptions', 'set_printoptions', 'array_repr', 'array_str', 'set_string_function', 'little_endian', 'require', @@ -322,16 +322,38 @@ res = dot(at, bt) return res.reshape(olda + oldb) +def rollaxis(a, axis, start=0): + """Return transposed array so that axis is rolled before start. -def _move_axis_to_0(a, axis): - if axis == 0: - return a + if a.shape is (3,4,5,6) + rollaxis(a, 3, 1).shape is (3,6,4,5) + rollaxis(a, 2, 0).shape is (5,3,4,6) + rollaxis(a, 1, 3).shape is (3,5,4,6) + rollaxis(a, 1, 4).shape is (3,5,6,4) + """ n = a.ndim if axis < 0: axis += n - axes = range(1, axis+1) + [0,] + range(axis+1, n) + if start < 0: + start += n + msg = 'rollaxis: %s (%d) must be >=0 and < %d' + if not (0 <= axis < n): + raise ValueError, msg % ('axis', axis, n) + if not (0 <= start < n+1): + raise ValueError, msg % ('start', start, n+1) + if (axis < start): # it's been removed + start -= 1 + if axis==start: + return a + axes = range(0,n) + axes.remove(axis) + axes.insert(start, axis) return a.transpose(axes) +# fix hack in scipy which imports this function +def _move_axis_to_0(a, axis): + return rollaxis(a, axis, 0) + def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None): """Return the cross product of two (arrays of) vectors. @@ -342,8 +364,8 @@ """ if axis is not None: axisa,axisb,axisc=(axis,)*3 - a = _move_axis_to_0(asarray(a), axisa) - b = _move_axis_to_0(asarray(b), axisb) + a = asarray(a).swapaxes(axisa, 0) + b = asarray(b).swapaxes(axisb, 0) msg = "incompatible dimensions for cross product\n"\ "(dimension must be 2 or 3)" if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]): @@ -354,7 +376,7 @@ if cp.ndim == 0: return cp else: - return cp.swapaxes(0,axisc) + return cp.swapaxes(0, axisc) else: x = a[1]*b[2] y = -a[0]*b[2] From numpy-svn at scipy.org Fri Sep 15 18:58:49 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 17:58:49 -0500 (CDT) Subject: [Numpy-svn] r3168 - in trunk/numpy/lib: . tests Message-ID: <20060915225849.984D939C030@new.scipy.org> Author: oliphant Date: 2006-09-15 17:58:26 -0500 (Fri, 15 Sep 2006) New Revision: 3168 Modified: trunk/numpy/lib/function_base.py trunk/numpy/lib/tests/test_function_base.py Log: Rename to histogramdd as original author said. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2006-09-15 22:40:54 UTC (rev 3167) +++ trunk/numpy/lib/function_base.py 2006-09-15 22:58:26 UTC (rev 3168) @@ -4,7 +4,7 @@ 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp', 'unique', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax', 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average', - 'histogram', 'histogramnd', 'bincount', 'digitize', 'cov', + 'histogram', 'histogramdd', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort', 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman', 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring', 'meshgrid', 'delete', 'insert', 'append' @@ -103,14 +103,14 @@ else: return n, bins -def histogramnd(sample, bins=10, range=None, normed=False): - """histogramnd(sample, bins = 10, range = None, normed = False) -> H, edges +def histogramdd(sample, bins=10, range=None, normed=False): + """histogramdd(sample, bins = 10, range = None, normed = False) -> H, edges - Return the N-dimensional histogram computed from sample. + Return the D-dimensional histogram computed from sample. Parameters ---------- - sample: A sequence of N arrays, or an KxN array. + sample: A sequence of D arrays, or an NxD array. bins: A sequence of edge arrays, or a sequence of the number of bins. If a scalar is given, it is assumed to be the number of bins for all dimensions. @@ -126,7 +126,7 @@ Example: x = random.randn(100,3) - H, edges = histogramnd(x, bins = (5, 6, 7)) + H, edges = histogramdd(x, bins = (5, 6, 7)) See also: histogram """ Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2006-09-15 22:40:54 UTC (rev 3167) +++ trunk/numpy/lib/tests/test_function_base.py 2006-09-15 22:58:26 UTC (rev 3168) @@ -353,24 +353,24 @@ (a,b)=histogram(linspace(0,10,100)) assert(all(a==10)) -class test_histogramnd(NumpyTestCase): +class test_histogramdd(NumpyTestCase): def check_simple(self): x = array([[-.5, .5, 1.5], [-.5, 1.5, 2.5], [-.5, 2.5, .5], \ [.5, .5, 1.5], [.5, 1.5, 2.5], [.5, 2.5, 2.5]]) - H, edges = histogramnd(x, (2,3,3), range = [[-1,1], [0,3], [0,3]]) + H, edges = histogramdd(x, (2,3,3), range = [[-1,1], [0,3], [0,3]]) answer = asarray([[[0,1,0], [0,0,1], [1,0,0]], [[0,1,0], [0,0,1], [0,0,1]]]) assert(all(H == answer)) # Check normalization ed = [[-2,0,2], [0,1,2,3], [0,1,2,3]] - H, edges = histogramnd(x, bins = ed, normed = True) + H, edges = histogramdd(x, bins = ed, normed = True) assert(all(H == answer/12.)) # Check that H has the correct shape. - H, edges = histogramnd(x, (2,3,4), range = [[-1,1], [0,3], [0,4]], normed=True) + H, edges = histogramdd(x, (2,3,4), range = [[-1,1], [0,3], [0,4]], normed=True) answer = asarray([[[0,1,0,0], [0,0,1,0], [1,0,0,0]], [[0,1,0,0], [0,0,1,0], [0,0,1,0]]]) assert_array_almost_equal(H, answer/6., 4) # Check that a sequence of arrays is accepted and H has the correct shape. z = [squeeze(y) for y in split(x,3,axis=1)] - H, edges = histogramnd(z, bins=(4,3,2),range=[[-2,2], [0,3], [0,2]]) + H, edges = histogramdd(z, bins=(4,3,2),range=[[-2,2], [0,3], [0,2]]) answer = asarray([[[0,0],[0,0],[0,0]], [[0,1], [0,0], [1,0]], [[0,1], [0,0],[0,0]], From numpy-svn at scipy.org Fri Sep 15 22:09:03 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Sep 2006 21:09:03 -0500 (CDT) Subject: [Numpy-svn] r3169 - in trunk/numpy: core/src lib numarray Message-ID: <20060916020903.7587539C015@new.scipy.org> Author: oliphant Date: 2006-09-15 21:08:59 -0500 (Fri, 15 Sep 2006) New Revision: 3169 Modified: trunk/numpy/core/src/arrayobject.c trunk/numpy/lib/twodim_base.py trunk/numpy/lib/utils.py trunk/numpy/numarray/functions.py Log: Fix ticket #188 by returning the name of the dtype objects for data-type objects without fields or sub-arrays that are in correct byte-order Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-15 22:58:26 UTC (rev 3168) +++ trunk/numpy/core/src/arrayobject.c 2006-09-16 02:08:59 UTC (rev 3169) @@ -11086,6 +11086,12 @@ PyObject *p; PyObject *t = PyString_FromString("("); p = arraydescr_str(self->subarray->base); + if (!self->subarray->base->names && !self->subarray->base->subarray) { + PyObject *t=PyString_FromString("'"); + PyString_Concat(&p, t); + PyString_ConcatAndDel(&t, p); + p = t; + } PyString_ConcatAndDel(&t, p); PyString_ConcatAndDel(&t, PyString_FromString(",")); PyString_ConcatAndDel(&t, PyObject_Str(self->subarray->shape)); @@ -11093,11 +11099,12 @@ sub = t; } else { - PyObject *t=PyString_FromString("'"); - sub = arraydescr_protocol_typestr_get(self); - PyString_Concat(&sub, t); - PyString_ConcatAndDel(&t, sub); - sub = t; + if (!PyArray_ISNBO(self->byteorder)) { + sub = arraydescr_protocol_typestr_get(self); + } + else { + sub = arraydescr_typename_get(self); + } } return sub; } @@ -11108,6 +11115,12 @@ PyObject *sub, *s; s = PyString_FromString("dtype("); sub = arraydescr_str(self); + if (!self->names && !self->subarray) { + PyObject *t=PyString_FromString("'"); + PyString_Concat(&sub, t); + PyString_ConcatAndDel(&t, sub); + sub = t; + } PyString_ConcatAndDel(&s, sub); sub = PyString_FromString(")"); PyString_ConcatAndDel(&s, sub); Modified: trunk/numpy/lib/twodim_base.py =================================================================== --- trunk/numpy/lib/twodim_base.py 2006-09-15 22:58:26 UTC (rev 3168) +++ trunk/numpy/lib/twodim_base.py 2006-09-16 02:08:59 UTC (rev 3169) @@ -143,7 +143,7 @@ X[:,i] = x**(N-i-1) return X -def histogram2d(x,y, bins=10, range=None, normed=False): +def histogram2d(x,y, bins=10, range=None, normed=False): """histogram2d(x,y, bins=10, range=None, normed=False) -> H, xedges, yedges Compute the 2D histogram from samples x,y. @@ -159,7 +159,6 @@ The histogram array is a count of the number of samples in each two dimensional bin. Setting normed to True returns a density rather than a bin count. - Data falling outside of the edges are not counted. """ import numpy as np try: Modified: trunk/numpy/lib/utils.py =================================================================== --- trunk/numpy/lib/utils.py 2006-09-15 22:58:26 UTC (rev 3168) +++ trunk/numpy/lib/utils.py 2006-09-16 02:08:59 UTC (rev 3169) @@ -238,7 +238,10 @@ if object is None: info(info) - elif isinstance(object, types.StringType): + elif isinstance(object, ndarray): + import numpy.numarray as nn + nn.info(object, output=output, numpy=1) + elif isinstance(object, str): if _namedict is None: _namedict, _dictlist = _makenamedict(toplevel) numfound = 0 Modified: trunk/numpy/numarray/functions.py =================================================================== --- trunk/numpy/numarray/functions.py 2006-09-15 22:58:26 UTC (rev 3168) +++ trunk/numpy/numarray/functions.py 2006-09-16 02:08:59 UTC (rev 3169) @@ -340,27 +340,57 @@ dtype = type2dtype(typecode, type, dtype, True) return N.identity(n, dtype) -def info(obj): - print "class: ", type(obj) - print "shape: ", obj.shape - print "strides: ", obj.strides - print "byteoffset: 0" - print "bytestride: ", obj.strides[0] - print "itemsize: ", obj.itemsize - print "aligned: ", obj.flags.aligned - print "contiguous: ", obj.flags.contiguous - print "buffer: ", repr(obj.data) - print "data pointer:", obj.ctypes._as_parameter_, "(DEBUG ONLY)" - print "byteorder: ", +def info(obj, output=sys.stdout, numpy=0): + if numpy: + bp = lambda x: x + else: + bp = lambda x: int(x) + cls = getattr(obj, '__class__', type(obj)) + if numpy: + nm = getattr(cls, '__name__', cls) + else: + nm = cls + print >> output, "class: ", nm + print >> output, "shape: ", obj.shape + strides = obj.strides + print >> output, "strides: ", strides + if not numpy: + print >> output, "byteoffset: 0" + if len(strides) > 0: + bs = obj.strides[0] + else: + bs = obj.itemsize + print >> output, "bytestride: ", bs + print >> output, "itemsize: ", obj.itemsize + print >> output, "aligned: ", bp(obj.flags.aligned) + print >> output, "contiguous: ", bp(obj.flags.contiguous) + if numpy: + print >> output, "fortran: ", obj.flags.fortran + if not numpy: + print >> output, "buffer: ", repr(obj.data) + if not numpy: + extra = " (DEBUG ONLY)" + tic = "'" + else: + extra = "" + tic = "" + print >> output, "data pointer: %s%s" % (hex(obj.ctypes._as_parameter_), extra) + print >> output, "byteorder: ", endian = obj.dtype.byteorder if endian in ['|','=']: - print sys.byteorder + print >> output, "%s%s%s" % (tic, sys.byteorder, tic) + byteswap = False elif endian == '>': - print "big" + print >> output, "%sbig%s" % (tic, tic) + byteswap = sys.byteorder != "big" else: - print "little" - print "byteswap: ", not obj.dtype.isnative - print "type: ", typefrom(obj).name + print >> output, "%slittle%s" % (tic, tic) + byteswap = sys.byteorder != "little" + print >> output, "byteswap: ", bp(byteswap) + if not numpy: + print >> output, "type: ", typefrom(obj).name + else: + print >> output, "type: %s" % obj.dtype #clipmode is ignored if axis is not 0 and array is not 1d def put(array, indices, values, axis=0, clipmode=RAISE): From numpy-svn at scipy.org Sat Sep 16 01:56:48 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 16 Sep 2006 00:56:48 -0500 (CDT) Subject: [Numpy-svn] r3170 - in trunk/numpy/f2py/lib: . research research/pointers src Message-ID: <20060916055648.19E6839C00B@new.scipy.org> Author: pearu Date: 2006-09-16 00:56:18 -0500 (Sat, 16 Sep 2006) New Revision: 3170 Added: trunk/numpy/f2py/lib/doc.txt trunk/numpy/f2py/lib/python_wrapper.py trunk/numpy/f2py/lib/research/pointers/ trunk/numpy/f2py/lib/research/pointers/pointer_size.c trunk/numpy/f2py/lib/research/pointers/settypeinfo.f90 trunk/numpy/f2py/lib/src/ trunk/numpy/f2py/lib/src/F_FUNC.cpp trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c trunk/numpy/f2py/lib/src/pyobj_to_double.c trunk/numpy/f2py/lib/src/pyobj_to_long.c trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c trunk/numpy/f2py/lib/src/pyobj_to_string_len.c Modified: trunk/numpy/f2py/lib/analyzefortran.py trunk/numpy/f2py/lib/base_classes.py trunk/numpy/f2py/lib/block_statements.py trunk/numpy/f2py/lib/parsefortran.py trunk/numpy/f2py/lib/statements.py trunk/numpy/f2py/lib/typedecl_statements.py trunk/numpy/f2py/lib/utils.py Log: 4G f2py: first working example. Modified: trunk/numpy/f2py/lib/analyzefortran.py =================================================================== --- trunk/numpy/f2py/lib/analyzefortran.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/analyzefortran.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -19,11 +19,14 @@ block is a BeginSource instance with relevant attributes: name - reader name content - a list of statements + Statements are either block statements or simple statements. + Block statements have the following relevant attributes: name - block name blocktype - statement name (equal to lowered statement class name) content - a list of statements + Block statements may have additional attributes: BeginSource: top Module: @@ -42,6 +45,7 @@ Associate: associations Type: specs, params Enum: + Simple statements have various attributes: Assignment: variable, expr PointerAssignment: variable, expr Modified: trunk/numpy/f2py/lib/base_classes.py =================================================================== --- trunk/numpy/f2py/lib/base_classes.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/base_classes.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -50,13 +50,29 @@ % (self.__class__.__name__,name,','.join(self._attributes.keys())) self._attributes[name] = value - def __repr__(self): - l = [] + def isempty(self): for k in self._attributes.keys(): v = getattr(self,k) - l.append('%s=%r' % (k,v)) - return '%s(%s)' % (self.__class__.__name__,', '.join(l)) + if v: return False + return True + def __repr__(self): return self.torepr() + + def torepr(self, depth=-1, tab = ''): + if depth==0: return tab + self.__class__.__name__ + l = [self.__class__.__name__+':'] + ttab = tab + ' ' + for k in self._attributes.keys(): + v = getattr(self,k) + if v: + if isinstance(v,list): + l.append(ttab + '%s=<%s-list>' % (k,len(v))) + elif isinstance(v,dict): + l.append(ttab + '%s=' % (k,v.keys())) + else: + l.append(ttab + '%s=<%s>' % (k,type(v))) + return '\n'.join(l) + def todict(self): d = {} for k in self._attributes.keys(): @@ -95,6 +111,33 @@ self.init = None return + def get_bit_size(self): + typesize = self.typedecl.get_bit_size(self) + if self.is_pointer(): + # The size of pointer descriptor is compiler version dependent. Read: + # http://www.nersc.gov/vendor_docs/intel/f_ug1/pgwarray.htm + # https://www.cca-forum.org/pipermail/cca-fortran/2003-February/000123.html + # https://www.cca-forum.org/pipermail/cca-fortran/2003-February/000122.html + # On sgi descriptor size may be 128+ bits! + if self.is_array(): + wordsize = 4 # XXX: on a 64-bit system it is 8. + rank = len(self.bounds or self.dimension) + return 6 * wordsize + 12 * rank + return typesize + if self.is_array(): + size = reduce(lambda x,y:x*y,self.bounds or self.dimension,1) + if self.length: + size *= self.length + return size * typesize + if self.length: + return self.length * typesize + return typesize + + def get_typedecl(self): + if self.typedecl is None: + self.set_type(self.parent.get_type(self.name)) + return self.typedecl + def add_parent(self, parent): if id(parent) not in map(id, self.parents): self.parents.append(parent) @@ -182,7 +225,10 @@ def is_parameter(self): return 'PARAMETER' in self.attributes def is_optional(self): return 'OPTIONAL' in self.attributes def is_required(self): return 'REQUIRED' in self.attributes + def is_pointer(self): return 'POINTER' in self.attributes + def is_array(self): return not not (self.bounds or self.dimensions) + def update(self, *attrs): attributes = self.attributes if len(attrs)==1 and isinstance(attrs[0],(tuple,list)): @@ -221,8 +267,9 @@ def __str__(self): s = '' - if self.typedecl is not None: - s += self.typedecl.tostr() + ' ' + typedecl = self.get_typedecl() + if typedecl is not None: + s += typedecl.tostr() + ' ' a = self.attributes[:] if self.dimension is not None: a.append('DIMENSION(%s)' % (', '.join(self.dimension))) @@ -246,6 +293,10 @@ s += ' = ' + self.init return s + def analyze(self): + typedecl = self.get_typedecl() + return + class ProgramBlock: pass @@ -257,6 +308,7 @@ isvalid - boolean, when False, the Statement instance will be ignored """ modes = ['free90','fix90','fix77','pyf'] + _repr_attr_names = [] def __init__(self, parent, item): self.parent = parent @@ -264,16 +316,19 @@ self.reader = item.reader else: self.reader = parent.reader - self.top = getattr(parent,'top',None) + self.top = getattr(parent,'top',None) # the top of statement tree + self.item = item + if isinstance(parent, ProgramBlock): self.programblock = parent elif isinstance(self, ProgramBlock): self.programblock = self elif hasattr(parent,'programblock'): self.programblock = parent.programblock + else: + #self.warning('%s.programblock attribute not set.' % (self.__class__.__name__)) + pass - self.item = item - # when a statement instance is constructed by error, set isvalid to False self.isvalid = True # when a statement should be ignored, set ignore to True @@ -292,6 +347,31 @@ return + def __repr__(self): + return self.torepr() + + def torepr(self, depth=-1,incrtab=''): + tab = incrtab + self.get_indent_tab() + clsname = self.__class__.__name__ + l = [tab + yellow_text(clsname)] + if depth==0: + return '\n'.join(l) + ttab = tab + ' ' + for n in self._repr_attr_names: + attr = getattr(self, n, None) + if not attr: continue + if hasattr(attr, 'torepr'): + r = attr.torepr(depht-1,incrtab) + else: + r = repr(attr) + l.append(ttab + '%s=%s' % (n, r)) + if self.item is not None: l.append(ttab + 'item=%r' % (self.item)) + if not self.isvalid: l.append(ttab + 'isvalid=%r' % (self.isvalid)) + if self.ignore: l.append(ttab + 'ignore=%r' % (self.ignore)) + if not self.a.isempty(): + l.append(ttab + 'a=' + self.a.torepr(depth-1,incrtab+' ').lstrip()) + return '\n'.join(l) + def get_indent_tab(self,colon=None,deindent=False): if self.reader.isfix: tab = ' '*6 @@ -321,8 +401,11 @@ return tab def format_message(self, kind, message): - message = self.reader.format_message(kind, message, - self.item.span[0], self.item.span[1]) + if self.item is not None: + message = self.reader.format_message(kind, message, + self.item.span[0], self.item.span[1]) + else: + return message return message def show_message(self, message, stream=sys.stderr): @@ -350,14 +433,27 @@ return def get_variable(self, name): - variables = self.parent.a.variables - if not variables.has_key(name): - variables[name] = var = Variable(self, name) - else: - var = variables[name] - var.add_parent(self) - return var + """ Return Variable instance of variable name. + """ + mth = getattr(self,'get_variable_by_name', self.parent.get_variable) + return mth(name) + def get_type(self, name): + """ Return type declaration using implicit rules + for name. + """ + mth = getattr(self,'get_type_by_name', self.parent.get_type) + return mth(name) + + def get_type_decl(self, kind): + mth = getattr(self,'get_type_decl_by_kind', self.parent.get_type_decl) + return mth(kind) + + def get_provides(self): + """ Returns dictonary containing statements that block provides or None when N/A. + """ + return + class BeginStatement(Statement): """ @@ -371,13 +467,14 @@ with the line label parent - Block or FortranParser instance item - Line instance containing the block start statement - get_item, put_item - methods to retrive/submit Line instaces + get_item, put_item - methods to retrive/submit Line instances from/to Fortran reader. isvalid - boolean, when False, the Block instance will be ignored. stmt_cls, end_stmt_cls """ + _repr_attr_names = ['blocktype','name'] + Statement._repr_attr_names def __init__(self, parent, item=None): self.content = [] @@ -388,7 +485,6 @@ if not hasattr(self, 'name'): # process_item may change this self.name = '__'+self.blocktype.upper()+'__' - Statement.__init__(self, parent, item) return @@ -401,6 +497,20 @@ l.append(str(c)) return '\n'.join(l) + def torepr(self, depth=-1, incrtab=''): + tab = incrtab + self.get_indent_tab() + ttab = tab + ' ' + l=[Statement.torepr(self, depth=depth,incrtab=incrtab)] + if depth==0 or not self.content: + return '\n'.join(l) + l.append(ttab+'content:') + for c in self.content: + if isinstance(c,EndStatement): + l.append(c.torepr(depth-1,incrtab)) + else: + l.append(c.torepr(depth-1,incrtab + ' ')) + return '\n'.join(l) + def process_item(self): """ Process the line """ @@ -543,6 +653,7 @@ name blocktype """ + _repr_attr_names = ['blocktype','name'] + Statement._repr_attr_names def __init__(self, parent, item): if not hasattr(self, 'blocktype'): @@ -571,7 +682,10 @@ def analyze(self): return + def get_indent_tab(self,colon=None,deindent=False): + return Statement.get_indent_tab(self, colon=colon, deindent=True) + def __str__(self): - return self.get_indent_tab()[:-2] + 'END %s %s'\ + return self.get_indent_tab() + 'END %s %s'\ % (self.blocktype.upper(),self.name or '') Modified: trunk/numpy/f2py/lib/block_statements.py =================================================================== --- trunk/numpy/f2py/lib/block_statements.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/block_statements.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -14,7 +14,7 @@ a = AttributeHolder(implicit_rules = {}) - def get_type(self, name): + def get_type_by_name(self, name): implicit_rules = self.a.implicit_rules if implicit_rules is None: raise AnalyzeError,'Implicit rules mapping is null' @@ -74,8 +74,19 @@ class HasVariables: - a = AttributeHolder(variables = {}) + a = AttributeHolder(variables = {}, + variable_names = [] # defines the order of declarations + ) + def get_variable_by_name(self, name): + variables = self.a.variables + if variables.has_key(name): + var = variables[name] + else: + var = variables[name] = Variable(self, name) + self.a.variable_names.append(name) + return var + def topyf(self,tab=''): s = '' for name, var in self.a.variables.items(): @@ -92,8 +103,17 @@ s += stmt.topyf(tab=' '+tab) return s + def get_type_decl_by_kind(self, kind): + type_decls = self.a.type_decls + type_decl = type_decls.get(kind, None) + if type_decl is None: + return self.get_entity(kind) + raise NotImplementedError,'get type_decl from use modules' + return type_decl + class HasAttributes: + known_attributes = [] a = AttributeHolder(attributes = []) def topyf(self, tab=''): @@ -102,6 +122,29 @@ s += tab + attr + '\n' return s + def is_private(self): + attributes = self.a.attributes + if 'PUBLIC' in attributes: return False + if 'PRIVATE' in attributes: return True + return + def is_public(self): return not self.is_private() + + def update_attributes(self,*attrs): + attributes = self.a.attributes + known_attributes = self.known_attributes + if len(attrs)==1 and isinstance(attrs[0],(tuple,list)): + attrs = attrs[0] + for attr in attrs: + uattr = attr.upper() + if uattr not in attributes: + if isinstance(known_attributes,(list, tuple)): + if uattr not in known_attributes: + self.warning('unknown attribute %r' % (attr)) + elif known_attributes(uattr): + self.warning('unknown attribute %r' % (attr)) + attributes.append(uattr) + return + class HasModuleProcedures: a = AttributeHolder(module_procedures = []) @@ -196,10 +239,15 @@ """ match = re.compile(r'module\s*\w+\Z', re.I).match end_stmt_cls = EndModule + a = AttributeHolder(module_subprogram = {}, - module_data = {}, + module_provides = {}, # all symbols that are public and so + # can be imported via USE statement + # by other blocks ) + known_attributes = ['PUBLIC', 'PRIVATE'] + def get_classes(self): return access_spec + specification_part + module_subprogram_part @@ -208,6 +256,9 @@ self.name = name return BeginStatement.process_item(self) + def get_provides(self): + return self.a.module_provides + def analyze(self): content = self.content[:] @@ -225,11 +276,19 @@ if content: self.show_message('Not analyzed content: %s' % content) + module_provides = self.a.module_provides + for name, var in self.a.variables.items(): + if var.is_public(): + if module_provides.has_key(name): + self.warning('module data object name conflict with %s, overriding.' % (name)) + module_provides[name] = var + return def topyf(self, tab=''): s = tab + 'MODULE '+self.name + '\n' s += HasImplicitStmt.topyf(self, tab=tab+' ') + s += HasAttributesStmt.topyf(self, tab=tab+' ') s += HasTypeDecls.topyf(self, tab=tab+' ') s += HasVariables.topyf(self, tab=tab+' ') s += tab + ' CONTAINS\n' @@ -270,7 +329,7 @@ match = re.compile(r'end(\s*program\s*\w*|)\Z', re.I).match class Program(BeginStatement, ProgramBlock, - HasAttributes, + HasAttributes, # XXX: why Program needs .attributes? HasImplicitStmt, HasUseStmt): """ PROGRAM [name] """ @@ -340,6 +399,8 @@ end_stmt_cls = EndInterface blocktype = 'interface' + a = AttributeHolder(interface_provides = {}) + def get_classes(self): return intrinsic_type_spec + interface_specification @@ -358,7 +419,30 @@ return 'ABSTRACT INTERFACE' return 'INTERFACE '+ str(self.generic_spec) + def get_provides(self): + return self.a.interface_provides + def analyze(self): + content = self.content[:] + + while content: + stmt = content.pop(0) + if isinstance(stmt, self.end_stmt_cls): + break + stmt.analyze() + assert isinstance(stmt, SubProgramStatement),`stmt.__class__.__name__` + if content: + self.show_message('Not analyzed content: %s' % content) + + parent_provides = self.parent.get_provides() + if parent_provides is not None: + if self.is_public(): + if parent_provides.has_key(self.name): + self.warning('interface name conflict with %s, overriding.' % (self.name)) + parent_provides[self.name] = self + + return + # Subroutine class SubProgramStatement(BeginStatement, ProgramBlock, @@ -369,6 +453,8 @@ """ [ ] [ ( ) ] [ ] """ + known_attributes = ['PUBLIC', 'PRIVATE'] + a = AttributeHolder(internal_subprogram = {}) def process_item(self): @@ -430,7 +516,7 @@ content = self.content[:] if self.prefix: - self.a.attributes.extend(prefix.upper().split()) + self.update_attributes(prefix.upper().split()) variables = self.a.variables for a in self.args: @@ -459,6 +545,13 @@ if content: self.show_message('Not analyzed content: %s' % content) + parent_provides = self.parent.get_provides() + if parent_provides is not None: + if self.is_public(): + if parent_provides.has_key(self.name): + self.warning('module subprogram name conflict with %s, overriding.' % (self.name)) + parent_provides[self.name] = self + return def topyf(self, tab=''): @@ -486,6 +579,7 @@ """ end_stmt_cls = EndSubroutine match = re.compile(r'(recursive|pure|elemental|\s)*subroutine\s*\w+', re.I).match + _repr_attr_names = ['prefix','bind','suffix','args'] + Statement._repr_attr_names # Function @@ -506,6 +600,7 @@ """ end_stmt_cls = EndFunction match = re.compile(r'(recursive|pure|elemental|\s)*function\s*\w+', re.I).match + _repr_attr_names = ['prefix','bind','suffix','args','typedecl'] + Statement._repr_attr_names # Handle subprogram prefixes @@ -800,7 +895,11 @@ end_stmt_cls = EndType a = AttributeHolder(extends = None, - parameters = []) + parameters = {}, + component_names = [], # specifies component order for sequence types + components = {} + ) + known_attributes = re.compile(r'\A(PUBLIC|PRIVATE|SEQUENCE|ABSTRACT|BIND\s*\(.*\))\Z').match def process_item(self): line = self.item.get_line()[4:].lstrip() @@ -858,15 +957,41 @@ spec = 'BIND(%s)' % (', '.join(args)) else: spec = '%s(%s)' % (s,n) - self.warning('Unknown type-attr-spec %r' % (spec)) else: spec = spec.upper() - if spec not in ['PUBLIC', 'PRIVATE', 'ABSTRACT']: - self.warning('Unknown type-attr-spec %r' % (spec)) - self.a.attributes.append(spec) - self.a.parameters.extend(self.params) - assert isinstance(self.parent,HasTypeDecls),`self.parent.__class__` + self.update_attributes(spec) + + component_names = self.a.component_names + content = self.content[:] + while content: + stmt = content.pop(0) + if isinstance(stmt, self.end_stmt_cls): + break + stmt.analyze() + + if content: + self.show_message('Not analyzed content: %s' % content) + + parameters = self.a.parameters + components = self.a.components + component_names = self.a.component_names + for name in self.a.variable_names: + var = self.a.variables[name] + if name in self.params: + parameters[name] = var + else: + component_names.append(name) + components[name] = var + self.parent.a.type_decls[self.name] = self + + parent_provides = self.parent.get_provides() + if parent_provides is not None: + if self.is_public(): + if parent_provides.has_key(self.name): + self.warning('type declaration name conflict with %s, overriding.' % (self.name)) + parent_provides[self.name] = self + return def topyf(self, tab=''): Added: trunk/numpy/f2py/lib/doc.txt =================================================================== --- trunk/numpy/f2py/lib/doc.txt 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/doc.txt 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,311 @@ + +Created: September 2006 +Author: Pearu Peterson + +Structure +========= + +numpy.f2py.lib package contains the following files: + +readfortran.py +-------------- + +Tools for reading Fortran codes from file and string objects. + +To read Fortran code from a file, use FortranFileReader class. + +FortranFileReader class is iterator over Fortran code lines +as is derived from FortranReaderBase class. +It automatically handles line continuations and comments as +well as detects if Fortran file is in free or fixed format. + +For example, + +:: + >>> from readfortran import * + >>> import os + >>> reader = FortranFileReader(os.path.expanduser('~/src/blas/daxpy.f')) + >>> reader.next() + Line('subroutine daxpy(n,da,dx,incx,dy,incy)',(1, 1),'') + >>> reader.next() + Comment('c constant times a vector plus a vector.\nc uses unrolled loops for increments equal to one.\nc jack dongarra, linpack, 3/11/78.\nc modified 12/3/93, array(1) declarations changed to array(*)',(3, 6)) + >>> reader.next() + Line('double precision dx(*),dy(*),da',(8, 8),'') + >>> reader.next() + Line('integer i,incx,incy,ix,iy,m,mp1,n',(9, 9),'') + +FortranReaderBase.next() method may return Line, SyntaxErrorLine, Comment, MultiLine, +SyntaxErrorMultiLine instances. + +Line instance has the following attributes: + + * .line - contains Fortran code line + * .span - a 2-tuple containing the span of line numbers containing + Fortran code in the original Fortran file + * .label - the label of Fortran code line + * .reader - the FortranReaderBase class instance + * .strline - if not None then contains Fortran code line with parenthesis + content and string literal constants saved in .strlinemap dictionary. + * .is_f2py_directive - True if line started with f2py directive comment. + +and the following methods: + + * .get_line() - returns .strline (also evalutes it if None). Also + handles Hollerith contstants in fixed F77 mode. + * .isempty() - returns True if Fortran line contains no code. + * .copy(line=None, apply_map=False) - returns a Line instance + with given .span, .label, .reader information but line content + replaced with line (when not None) and applying .strlinemap + mapping (when apply_map is True). + * .apply_map(line) - apply .strlinemap mapping to line. + * .has_map() - returns True if .strlinemap mapping exists. + +For example, + +:: + + >>> item = reader.next() + >>> item + Line('if(n.le.0)return',(11, 11),'') + >>> item.line + 'if(n.le.0)return' + >>> item.strline + 'if(F2PY_EXPR_TUPLE_4)return' + >>> item.strlinemap + {'F2PY_EXPR_TUPLE_4': 'n.le.0'} + >>> item.label + '' + >>> item.span + (11, 11) + >>> item.get_line() + 'if(F2PY_EXPR_TUPLE_4)return' + >>> item.copy('if(F2PY_EXPR_TUPLE_4)pause',True) + Line('if(n.le.0)pause',(11, 11),'') + +Comment instance has the following attributes: + + * .comment - comment string + * .span - a 2-tuple containing the span of line numbers containing + Fortran comment in the original Fortran file + * .reader - the FortranReaderBase class instance + +and .isempty() method. + +MultiLine class represents multiline syntax in .pyf files:: + + '''''' + +MultiLine instance has the following attributes: + + * .prefix - the content of + * .block - a list of lines + * .suffix - the content of + * .span - a 2-tuple containing the span of line numbers containing + multiline syntax in the original Fortran file + * .reader - the FortranReaderBase class instance + +and .isempty() method. + +SyntaxErrorLine and SyntaxErrorMultiLine are like Line and MultiLine +classes, respectively, with a functionality of issuing an error +message to sys.stdout when constructing an instance of the corresponding +class. + +To read a Fortran code from a string, use FortranStringReader class:: + + reader = FortranStringReader(, , ) + +where the second and third arguments are used to specify the format +of the given content. When and are both +True, the content of a .pyf file is assumed. For example, + +:: + + >>> code = """ + ... c comment + ... subroutine foo(a) + ... print*, "a=",a + ... end + ... """ + >>> reader = FortranStringReader(code, False, True) + >>> reader.next() + Comment('c comment',(2, 2)) + >>> reader.next() + Line('subroutine foo(a)',(3, 3),'') + >>> reader.next() + Line('print*, "a=",a',(4, 4),'') + >>> reader.next() + Line('end',(5, 5),'') + +FortranReaderBase has the following attributes: + + * .source - a file-like object with .next() method to retrive + a source code line + * .source_lines - a list of read source lines + * .reader - a FortranReaderBase instance for reading files + from INCLUDE statements. + * .include_dirs - a list of directories where INCLUDE files + are searched. Default is ['.']. + +and the following methods: + + * .set_mode(isfree, isstrict) - set Fortran code format information + * .close_source() - called when .next() raises StopIteration exception. + +parsefortran.py +--------------- + +Parse Fortran code from FortranReaderBase iterator. + +FortranParser class holds the parser information while +iterating over items returned by FortranReaderBase iterator. +The parsing information, collected when calling .parse() method, +is saved in .block attribute as an instance +of BeginSource class defined in block_statements.py file. + +For example, + +:: + + >>> reader = FortranStringReader(code, False, True) + >>> parser = FortranParser(reader) + >>> parser.parse() + >>> print parser.block + !BEGINSOURCE mode=fix77 + SUBROUTINE foo(a) + PRINT *, "a=", a + END SUBROUTINE foo + +block_statements.py, base_classes.py, typedecl_statements.py, statements.py +--------------------------------------------------------------------------- + +The model for representing Fortran code statements consists of a tree of Statement +classes defined in base_classes.py. There are two types of statements: one line +statements and block statements. Block statements consists of start and end +statements, and content statements in between that can be of both types again. + +Statement instance has the following attributes: + + * .parent - it is either parent block-type statement or FortranParser instance. + * .item - Line instance containing Fortran statement line information, see above. + * .isvalid - when False then processing this Statement instance will be skipped, + for example, when the content of .item does not match with + the Statement class. + * .ignore - when True then the Statement instance will be ignored. + * .modes - a list of Fortran format modes where the Statement instance is valid. + +and the following methods: + + * .info(message), .warning(message), .error(message) - to spit messages to + sys.stderr stream. + * .get_variable(name) - get Variable instance by name that is defined in + current namespace. If name is not defined, then the corresponding + Variable instance is created. + * .analyze() - calculate various information about the Statement, this information + is saved in .a attribute that is AttributeHolder instance. + +All statement classes are derived from Statement class. Block statements are +derived from BeginStatement class and is assumed to end with EndStatement +instance in .content attribute list. BeginStatement and EndStatement instances +have the following attributes: + + * .name - name of the block, blocks without names use line label + as the name. + * .blocktype - type of the block (derived from class name) + * .content - a list of Statement (or Line) instances. + +and the following methods: + + * .__str__() - returns string representation of Fortran code. + +A number of statements may declare a variable that is used in other +statement expressions. Variables are represented via Variable class +and its instances have the following attributes: + + * .name - name of the variable + * .typedecl - type declaration + * .dimension - list of dimensions + * .bounds - list of bounds + * .length - length specs + * .attributes - list of attributes + * .bind - list of bind information + * .intent - list of intent information + * .check - list of check expressions + * .init - initial value of the variable + * .parent - statement instance declaring the variable + * .parents - list of statements that specify variable information + +and the following methods: + + * .is_private() + * .is_public() + * .is_allocatable() + * .is_external() + * .is_intrinsic() + * .is_parameter() + * .is_optional() + * .is_required() + +The following type declaration statements are defined in typedecl_statements.py: + + Integer, Real, DoublePrecision, Complex, DoubleComplex, Logical, + Character, Byte, Type, Class + +and they have the following attributes: + + * .selector - contains lenght and kind specs + * .entity_decls, .attrspec + +and methods: + + * .tostr() - return string representation of Fortran type declaration + * .astypedecl() - pure type declaration instance, it has no .entity_decls + and .attrspec. + * .analyze() - processes .entity_decls and .attsspec attributes and adds + Variable instance to .parent.a.variables dictionary. + +The following block statements are defined in block_statements.py: + + BeginSource, Module, PythonModule, Program, BlockData, Interface, + Subroutine, Function, Select, Where, Forall, IfThen, If, Do, + Associate, TypeDecl (Type), Enum + +Block statement classes may have different properties which are declared via +deriving them from the following classes: + + HasImplicitStmt, HasUseStmt, HasVariables, HasTypeDecls, + HasAttributes, HasModuleProcedures, ProgramBlock + +In summary, .a attribute may hold different information sets as follows: + + BeginSource - .module, .external_subprogram, .blockdata + Module - .attributes, .implicit_rules, .use, .use_provides, .variables, + .type_decls, .module_subprogram, .module_data + PythonModule - .implicit_rules, .use, .use_provides + Program - .attributes, .implicit_rules, .use, .use_provides + BlockData - .implicit_rules, .use, .use_provides, .variables + Interface - .implicit_rules, .use, .use_provides, .module_procedures + Function, Subroutine - .implicit_rules, .attributes, .use, .use_statements, + .variables, .type_decls, .internal_subprogram + TypeDecl - .variables, .attributes + +Block statements have the following methods: + + * .get_classes() - returns a list of Statement classes that are valid + as a content of given block statement. + +The following one line statements are defined: + + Implicit, TypeDeclarationStatement derivatives (see above), + Assignment, PointerAssignment, Assign, Call, Goto, ComputedGoto, + AssignedGoto, Continue, Return, Stop, Print, Read, Write, Flush, + Wait, Contains, Allocate, Deallocate, ModuleProcedure, Access, + Public, Private, Close, Cycle, Backspace, Endfile, Reeinf, Open, + Format, Save, Data, Nullify, Use, Exit, Parameter, Equivalence, + Dimension, Target, Pointer, Protected, Volatile, Value, + ArithmeticIf, Intrinsic, Inquire, Sequence, External, Namelist, + Common, Optional, Intent, Entry, Import, Forall, + SpecificBinding, GenericBinding, FinalBinding, Allocatable, + Asynchronous, Bind, Else, ElseIf, Case, Where, ElseWhere, + Enumerator, FortranName, Threadsafe, Depend, Check, + CallStatement, CallProtoArgument, Pause Modified: trunk/numpy/f2py/lib/parsefortran.py =================================================================== --- trunk/numpy/f2py/lib/parsefortran.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/parsefortran.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -10,6 +10,8 @@ Created: May 2006 """ +__all__ = ['FortranParser'] + import re import sys import traceback @@ -24,6 +26,10 @@ cache = {} def __init__(self, reader): + """ + Parser of FortranReader structure. + Use .parse() method for parsing, parsing result is saved in .block attribute. + """ self.reader = reader if self.cache.has_key(reader.id): parser = self.cache[reader.id] @@ -156,7 +162,7 @@ parser = FortranParser(reader) parser.parse() parser.analyze() - print parser.block.topyf() + print parser.block.torepr(4) #print parser.block def profile_main(): Added: trunk/numpy/f2py/lib/python_wrapper.py =================================================================== --- trunk/numpy/f2py/lib/python_wrapper.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/python_wrapper.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,549 @@ + +__all__ = ['TypeWrapper'] + +import re +import os +import sys + +from block_statements import * +#from typedecl_statements import intrinsic_type_spec, Character +from utils import CHAR_BIT + +class WrapperBase: + + + def __init__(self): + self.srcdir = os.path.join(os.path.dirname(__file__),'src') + return + def warning(self, message): + print >> sys.stderr, message + def info(self, message): + print >> sys.stderr, message + + def get_resource_content(self, name, ext): + if name.startswith('pyobj_to_'): + body = self.generate_pyobj_to_ctype_c(name[9:]) + if body is not None: return body + generator_mth_name = 'generate_' + name + ext.replace('.','_') + generator_mth = getattr(self, generator_mth_name, lambda : None) + body = generator_mth() + if body is not None: + return body + fn = os.path.join(self.srcdir,name+ext) + if os.path.isfile(fn): + f = open(fn,'r') + body = f.read() + f.close() + return body + self.warning('No such file: %r' % (fn)) + return + + def get_dependencies(self, code): + l = [] + for uses in re.findall(r'(?<=depends:)([,\w\s.]+)', code, re.I): + for use in uses.split(','): + use = use.strip() + if not use: continue + l.append(use) + return l + + def apply_attributes(self, template): + """ + Apply instance attributes to template string. + + Replace rules for attributes: + _list - will be joined with newline + _clist - _list will be joined with comma + _elist - _list will be joined + ..+.. - attributes will be added + [..] - will be evaluated + """ + replace_names = set(re.findall(r'[ ]*%\(.*?\)s', template)) + d = {} + for name in replace_names: + tab = ' ' * (len(name)-len(name.lstrip())) + name = name.lstrip()[2:-2] + names = name.split('+') + joinsymbol = '\n' + attrs = None + for n in names: + realname = n.strip() + if n.endswith('_clist'): + joinsymbol = ', ' + realname = realname[:-6] + '_list' + elif n.endswith('_elist'): + joinsymbol = '' + realname = realname[:-6] + '_list' + if hasattr(self, realname): + attr = getattr(self, realname) + elif realname.startswith('['): + attr = eval(realname) + else: + self.warning('Undefined %r attribute: %r' % (self.__class__.__name__, realname)) + continue + if attrs is None: + attrs = attr + else: + attrs += attr + if isinstance(attrs, list): + attrs = joinsymbol.join(attrs) + d[name] = str(attrs).replace('\n','\n'+tab) + return template % d + +class PythonWrapperModule(WrapperBase): + + main_template = '''\ +#ifdef __cplusplus +extern \"C\" { +#endif +#include "Python.h" + +#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API +#include "numpy/arrayobject.h" + +%(include_list)s +%(cppmacro_list)s +%(typedef_list)s +%(objdecl_list)s +%(extern_list)s +%(c_function_list)s +%(capi_function_list)s +static PyObject *f2py_module; +static PyMethodDef f2py_module_methods[] = { + %(module_method_list)s + {NULL,NULL,0,NULL} +}; +PyMODINIT_FUNC init%(modulename)s(void) { + f2py_module = Py_InitModule("%(modulename)s", f2py_module_methods); + %(initialize_interface_list)s + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "can\'t initialize module %(modulename)s"); + return; + } +} +#ifdef __cplusplus +} +#endif +''' + + main_fortran_template = '''\ +%(fortran_code_list)s +''' + def __init__(self, modulename): + WrapperBase.__init__(self) + self.modulename = modulename + self.include_list = [] + self.typedef_list = [] + self.cppmacro_list = [] + self.objdecl_list = [] + self.c_function_list = [] + self.extern_list = [] + self.capi_function_list = [] + self.module_method_list = [] + self.initialize_interface_list = [] + self.fortran_code_list = [] + + self.defined_types = [] + self.defined_macros = [] + self.defined_c_functions = [] + self.defined_typedefs = [] + return + + def add(self, block): + if isinstance(block, BeginSource): + for name, subblock in block.a.external_subprogram.items(): + self.add(subblock) + elif isinstance(block, (Subroutine, Function)): + self.info('Generating interface for %s' % (block.name)) + f = PythonCAPIFunction(self, block) + f.fill() + else: + raise NotImplementedError,`block.__class__.__name__` + return + + def c_code(self): + return self.apply_attributes(self.main_template) + def fortran_code(self): + return self.apply_attributes(self.main_fortran_template) + + def add_c_function(self, name): + if name not in self.defined_c_functions: + body = self.get_resource_content(name,'.c') + if body is None: + self.warning('Failed to get C function %r content.' % (name)) + return + for d in self.get_dependencies(body): + if d.endswith('.cpp'): + self.add_cppmacro(d[:-4]) + elif d.endswith('.c'): + self.add_c_function(d[:-2]) + else: + self.warning('Unknown dependence: %r.' % (d)) + self.defined_c_functions.append(name) + self.c_function_list.append(body) + return + + def add_cppmacro(self, name): + if name not in self.defined_macros: + body = self.get_resource_content(name,'.cpp') + if body is None: + self.warning('Failed to get CPP macro %r content.' % (name)) + return + for d in self.get_dependencies(body): + if d.endswith('.cpp'): + self.add_cppmacro(d[:-4]) + elif d.endswith('.c'): + self.add_c_function(d[:-2]) + else: + self.warning('Unknown dependence: %r.' % (d)) + self.defined_macros.append(name) + self.cppmacro_list.append(body) + return + + def add_type(self, typedecl): + typewrap = TypeDecl(self, typedecl) + typename = typewrap.typename + if typename not in self.defined_types: + self.defined_types.append(typename) + typewrap.fill() + return typename + + def add_typedef(self, name, code): + if name not in self.defined_typedefs: + self.typedef_list.append(code) + self.defined_types.append(name) + return + + def add_include(self, include): + if include not in self.include_list: + self.include_list.append(include) + return + + def add_subroutine(self, block): + f = PythonCAPIFunction(self, block) + f.fill() + return + + def generate_pyobj_to_ctype_c(self, ctype): + if ctype.startswith('npy_int'): + ctype_bits = int(ctype[7:]) + return ''' +/* depends: pyobj_to_long.c, pyobj_to_npy_longlong.c */ +#if NPY_BITSOF_LONG == %(ctype_bits)s +#define pyobj_to_%(ctype)s pyobj_to_long +#else +#if NPY_BITSOF_LONG > %(ctype_bits)s +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + long tmp; + if (pyobj_to_long(obj,&tmp)) { + *value = (%(ctype)s)tmp; + return 1; + } + return 0; +} +#else +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + npy_longlong tmp; + if (pyobj_to_npy_longlong(obj,&tmp)) { + *value = (%(ctype)s)tmp; + return 1; + } + return 0; +} +#endif +#endif +''' % (locals()) + elif ctype.startswith('npy_float'): + ctype_bits = int(ctype[9:]) + return ''' +/* depends: pyobj_to_double.c */ +#if NPY_BITSOF_DOUBLE == %(ctype_bits)s +#define pyobj_to_%(ctype)s pyobj_to_double +#else +#if NPY_BITSOF_DOUBLE > %(ctype_bits)s +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + double tmp; + if (pyobj_to_double(obj,&tmp)) { + *value = (%(ctype)s)tmp; + return 1; + } + return 0; +} +#else +#error, "NOTIMPLEMENTED pyobj_to_%(ctype)s" +#endif +#endif +''' % (locals()) + elif ctype.startswith('npy_complex'): + ctype_bits = int(ctype[11:]) + cfloat_bits = ctype_bits/2 + return ''' +/* depends: pyobj_to_Py_complex.c */ +#if NPY_BITSOF_DOUBLE >= %(cfloat_bits)s +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + Py_complex c; + if (pyobj_to_Py_complex(obj,&c)) { + (*value).real = (npy_float%(cfloat_bits)s)c.real; + (*value).imag = (npy_float%(cfloat_bits)s)c.imag; + return 1; + } + return 0; +} +#else +#error, "NOTIMPLEMENTED pyobj_to_%(ctype)s" +#endif +''' % (locals()) + elif ctype.startswith('f2py_string'): + ctype_bits = int(ctype[11:]) + ctype_bytes = ctype_bits / CHAR_BIT + self.add_typedef('f2py_string','typedef char * f2py_string;') + self.add_typedef(ctype,'typedef struct { char data[%s]; } %s;' % (ctype_bytes,ctype)) + self.add_include('#include ') + return ''' +/* depends: pyobj_to_string_len.c */ +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + return pyobj_to_string_len(obj, (f2py_string*)value, %(ctype_bytes)s); +} +''' % (locals()) + +class PythonCAPIFunction(WrapperBase): + capi_function_template = ''' +static char f2py_doc_%(function_name)s[] = "%(function_doc)s"; +static PyObject* f2py_%(function_name)s(PyObject *capi_self, PyObject *capi_args, PyObject *capi_keywds) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; + %(decl_list)s + static char *capi_kwlist[] = {%(keyword_clist+optkw_clist+extrakw_clist+["NULL"])s}; + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds, + "%(pyarg_format_elist)s", + %(["capi_kwlist"]+pyarg_obj_clist)s)) + return NULL; + %(frompyobj_list)s + %(call_list)s + f2py_success = !PyErr_Occurred(); + if (f2py_success) { + %(pyobjfrom_list)s + capi_buildvalue = Py_BuildValue(%(buildvalue_clist)s); + %(clean_pyobjfrom_list)s + } + %(clean_frompyobj_list)s + return capi_buildvalue; +} +''' + + pymethoddef_template = '''\ +{"%(function_name)s", (PyCFunction)f2py_%(function_name)s, METH_VARARGS | METH_KEYWORDS, f2py_doc_%(function_name)s},\ +''' + + cppmacro_template = '''\ +#define %(function_name)s_f F_FUNC(%(function_name)s,%(FUNCTION_NAME)s) +''' + + extdef_template = '''\ +extern void %(function_name)s_f();\ +''' + + def __init__(self, parent, block): + WrapperBase.__init__(self) + self.parent = parent + self.block = block + self.function_name = block.name + self.FUNCTION_NAME = self.function_name.upper() + self.function_doc = '' + self.args_list = block.args + self.decl_list = [] + self.keyword_list = [] + self.optkw_list = [] + self.extrakw_list = [] + self.frompyobj_list = [] + self.call_list = [] + self.pyobjfrom_list = [] + self.buildvalue_list = [] + self.clean_pyobjfrom_list = [] + self.clean_frompyobj_list = [] + self.pyarg_format_list = [] + self.pyarg_obj_list = [] + return + + def fill(self): + for argname in self.args_list: + var = self.block.a.variables[argname] + argwrap = ArgumentWrapper(self, var) + argwrap.fill() + self.call_list.append('%s_f(%s);' % (self.function_name, ', '.join(['&'+a for a in self.args_list]))) + if not self.buildvalue_list: + self.buildvalue_list.append('""') + self.parent.capi_function_list.append(self.apply_attributes(self.capi_function_template)) + self.parent.module_method_list.append(self.apply_attributes(self.pymethoddef_template)) + self.parent.extern_list.append(self.apply_attributes(self.extdef_template)) + self.parent.add_cppmacro('F_FUNC') + self.parent.cppmacro_list.append(self.apply_attributes(self.cppmacro_template)) + return + +class ArgumentWrapper(WrapperBase): + + objdecl_template = '%(ctype)s %(name)s;' + pyarg_obj_template = '\npyobj_to_%(ctype)s, &%(name)s' + + def __init__(self, parent, variable): + WrapperBase.__init__(self) + self.parent = parent + self.grand_parent = parent.parent + self.variable = variable + self.typedecl = variable.typedecl + self.name = variable.name + self.ctype = self.typedecl.get_c_type() + + def fill(self): + typename = self.grand_parent.add_type(self.typedecl) + self.parent.decl_list.append(self.apply_attributes(self.objdecl_template)) + + self.parent.pyarg_obj_list.append(self.apply_attributes(self.pyarg_obj_template)) + self.parent.pyarg_format_list.append('O&') + self.parent.keyword_list.append('"%s"' % (self.name)) + + self.grand_parent.add_c_function('pyobj_to_%s' % (self.ctype)) + return + +class TypeDecl(WrapperBase): + cppmacro_template = '''\ +#define initialize_%(typename)s_interface F_FUNC(initialize_%(typename)s_interface_f,INITIALIZE_%(TYPENAME)s_INTERFACE_F)\ +''' + typedef_template = '''\ +typedef struct { char data[%(byte_size)s] } %(ctype)s; +typedef %(ctype)s (*create_%(typename)s_functype)(void); +typedef void (*initialize_%(typename)s_interface_functype)(create_%(typename)s_functype);\ +''' + objdecl_template = '''\ +static create_%(typename)s_functype create_%(typename)s_object; +''' + funcdef_template = '''\ +static void initialize_%(typename)s_interface_c(create_%(typename)s_functype create_object_f) { + create_%(typename)s_object = create_object_f; +} +''' + extdef_template = '''\ +extern void initialize_%(typename)s_interface(initialize_%(typename)s_interface_functype);\ +''' + initcall_template = '''\ +initialize_%(typename)s_interface(initialize_%(typename)s_interface_c);\ +''' + fortran_code_template = '''\ + function create_%(typename)s_object_f() result (obj) + %(typedecl)s obj +! %(initexpr)s + end + subroutine initialize_%(typename)s_interface_f(init_c) + external create_%(typename)s_object_f + call init_c(create_%(typename)s_object_f) + end +''' + + def __init__(self, parent, typedecl): + WrapperBase.__init__(self) + self.parent = parent + self.typedecl = typedecl.astypedecl() + self.ctype = self.typedecl.get_c_type() + self.byte_size = self.typedecl.get_byte_size() + self.typename = self.typedecl.name.lower() + self.TYPENAME = self.typedecl.name.upper() + self.initexpr = self.typedecl.assign_expression('obj',self.typedecl.get_zero_value()) + return + + def fill(self): + ctype =self.typedecl.get_c_type() + if ctype.startswith('npy_'): + pass + elif ctype.startswith('f2py_string'): + pass + else: + self.parent.typedef_list.append(self.apply_attributes(self.typedef_template)) + self.parent.objdecl_list.append(self.apply_attributes(self.objdecl_template)) + self.parent.c_function_list.append(self.apply_attributes(self.funcdef_template)) + self.parent.extern_list.append(self.apply_attributes(self.extdef_template)) + self.parent.initialize_interface_list.append(self.apply_attributes(self.initcall_template)) + self.parent.fortran_code_list.append(self.apply_attributes(self.fortran_code_template)) + self.parent.add_cppmacro('F_FUNC') + self.parent.cppmacro_list.append(self.apply_attributes(self.cppmacro_template)) + return + + + + +if __name__ == '__main__': + from utils import str2stmt, get_char_bit + + stmt = str2stmt(""" + module rat + integer :: i + type rational + integer n + integer*8 d + end type rational + end module rat + subroutine foo(a) + use rat + type(rational) a + end + """) + #stmt = stmt.content[-1].content[1] + #print stmt + #wrapgen = TypeWrapper(stmt) + #print wrapgen.fortran_code() + #print wrapgen.c_code() + + foo_code = """! -*- f90 -*- + module rat + type rational + integer d,n + end type rational + end module rat + subroutine foo(a,b) + use rat + integer a + character*5 b + type(rational) c + print*,'a=',a,b,c + end +""" + + wm = PythonWrapperModule('foo') + wm.add(str2stmt(foo_code)) + #wm.add_fortran_code(foo_code) + #wm.add_subroutine(str2stmt(foo_code)) + #print wm.c_code() + + c_code = wm.c_code() + f_code = wm.fortran_code() + + f = open('foomodule.c','w') + f.write(c_code) + f.close() + f = open('foo.f','w') + f.write(foo_code) + f.close() + f = open('foo_wrap.f','w') + f.write(f_code) + f.close() + f = open('foo_setup.py','w') + f.write('''\ +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('foopack',parent_package,top_path) + config.add_library('foolib', + sources = ['foo.f','foo_wrap.f']) + config.add_extension('foo', + sources=['foomodule.c'], + libraries = ['foolib'], + ) + return config +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(configuration=configuration) +''') + f.close() + print get_char_bit() + os.system('python foo_setup.py config_fc --fcompiler=gnu95 build build_ext --inplace') + import foo + print dir(foo) + foo.foo(2,"abcdefg") Added: trunk/numpy/f2py/lib/research/pointers/pointer_size.c =================================================================== --- trunk/numpy/f2py/lib/research/pointers/pointer_size.c 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/research/pointers/pointer_size.c 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,30 @@ +#include + +#define settypeinfo settypeinfo_ + +void settypeinfo(int*); + +int main(int argc, char* argv[]) +{ + int i; + int a[512]; + for(i=0;i<512;i++) a[i] = 0; + + settypeinfo(a); + + if (a[0] != 333331) { + printf("FAILED, start flag is incorrect = %d\n", a[0]); + return 1; + } + + for (i = 0; i < 512; i++) { + if (a[i] == 333332) { + printf("SUCCESSFULLY found Fortran pointer length of %d bytes\n", + (i-1)*sizeof(int)); + return 0; + } + } + + printf("FAILED to find end flag\n"); + return 1; +} Added: trunk/numpy/f2py/lib/research/pointers/settypeinfo.f90 =================================================================== --- trunk/numpy/f2py/lib/research/pointers/settypeinfo.f90 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/research/pointers/settypeinfo.f90 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,13 @@ +! Author: Pearu Peterson +! Got idea from https://www.cca-forum.org/pipermail/cca-fortran/2003-February/000123.html + +subroutine settypeinfo(wrapper) + type data_wrapper + integer :: ibegin + character*20 :: p_data*10 + integer :: iend + end type data_wrapper + type(data_wrapper), intent(out) :: wrapper + wrapper%ibegin = 333331 + wrapper%iend = 333332 +end subroutine settypeinfo Added: trunk/numpy/f2py/lib/src/F_FUNC.cpp =================================================================== --- trunk/numpy/f2py/lib/src/F_FUNC.cpp 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/src/F_FUNC.cpp 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,34 @@ +#if defined(PREPEND_FORTRAN) +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F +#else +#define F_FUNC(f,F) _##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F##_ +#else +#define F_FUNC(f,F) _##f##_ +#endif +#endif +#else +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F +#else +#define F_FUNC(f,F) f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F##_ +#else +#define F_FUNC(f,F) f##_ +#endif +#endif +#endif +#if defined(UNDERSCORE_G77) +#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) +#else +#define F_FUNC_US(f,F) F_FUNC(f,F) +#endif Added: trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,39 @@ +int pyobj_to_Py_complex(PyObject* obj, Py_complex* value) { + if (PyComplex_Check(obj)) { + *value =PyComplex_AsCComplex(obj); + return 1; + } + /* Python does not provide PyNumber_Complex function :-( */ + (*value).imag=0.0; + if (PyFloat_Check(obj)) { +#ifdef __sgi + (*value).real = PyFloat_AsDouble(obj); + return (!PyErr_Occurred()); +#else + (*value).real = PyFloat_AS_DOUBLE(obj); + return 1; +#endif + } + if (PyInt_Check(obj)) { + (*value).real = (double)PyInt_AS_LONG(obj); + return 1; + } + if (PyLong_Check(obj)) { + (*value).real = PyLong_AsDouble(obj); + return (!PyErr_Occurred()); + } + if (PySequence_Check(obj) && (!PyString_Check(obj))) { + PyObject *tmp = PySequence_GetItem(obj,0); + if (tmp) { + if (pyobj_to_Py_complex(tmp,value)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + } + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C Py_complex."); + } + return 0; +} Added: trunk/numpy/f2py/lib/src/pyobj_to_double.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_double.c 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/src/pyobj_to_double.c 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,39 @@ +int pyobj_to_double(PyObject* obj, double* value) { + PyObject* tmp = NULL; + if (PyFloat_Check(obj)) { +#ifdef __sgi + *value = PyFloat_AsDouble(obj); + return (!PyErr_Occurred()); +#else + *value = PyFloat_AS_DOUBLE(obj); + return 1; +#endif + } + tmp = PyNumber_Float(obj); + if (tmp) { +#ifdef __sgi + *value = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return (!PyErr_Occurred()); +#else + *value = PyFloat_AS_DOUBLE(tmp); + Py_DECREF(tmp); + return 1; +#endif + } + if (PyComplex_Check(obj)) + tmp = PyObject_GetAttrString(obj,"real"); + else if (PyString_Check(obj)) + /*pass*/; + else if (PySequence_Check(obj)) + tmp = PySequence_GetItem(obj,0); + if (tmp) { + PyErr_Clear(); + if (pyobj_to_double(tmp, value)) {Py_DECREF(tmp); return 1;} + Py_DECREF(tmp); + } + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C double."); + } + return 0; +} Added: trunk/numpy/f2py/lib/src/pyobj_to_long.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_long.c 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/src/pyobj_to_long.c 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,31 @@ +int pyobj_to_long(PyObject *obj, long* value) { + PyObject* tmp = NULL; + if (PyInt_Check(obj)) { + *value = PyInt_AS_LONG(obj); + return 1; + } + tmp = PyNumber_Int(obj); + if (tmp) { + *value = PyInt_AS_LONG(tmp); + Py_DECREF(tmp); + return 1; + } + if (PyComplex_Check(obj)) + tmp = PyObject_GetAttrString(obj,"real"); + else if (PyString_Check(obj)) + /*pass*/; + else if (PySequence_Check(obj)) + tmp = PySequence_GetItem(obj,0); + if (tmp) { + PyErr_Clear(); + if (pyobj_to_long(tmp, value)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C long."); + } + return 0; +} Added: trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,36 @@ +int pyobj_to_npy_longlong(PyObject *obj, npy_longlong* value) { + PyObject* tmp = NULL; + if (PyLong_Check(obj)) { + *value = PyLong_AsLongLong(obj); + return (!PyErr_Occurred()); + } + if (PyInt_Check(obj)) { + *value = (npy_longlong)PyInt_AS_LONG(obj); + return 1; + } + tmp = PyNumber_Long(obj); + if (tmp) { + *value = PyLong_AsLongLong(tmp); + Py_DECREF(tmp); + return (!PyErr_Occurred()); + } + if (PyComplex_Check(obj)) + tmp = PyObject_GetAttrString(obj,"real"); + else if (PyString_Check(obj)) + /*pass*/; + else if (PySequence_Check(obj)) + tmp = PySequence_GetItem(obj,0); + if (tmp) { + PyErr_Clear(); + if (pyobj_to_npy_longlong(tmp, value)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C npy_longlong."); + } + return 0; +} + Added: trunk/numpy/f2py/lib/src/pyobj_to_string_len.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_string_len.c 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/src/pyobj_to_string_len.c 2006-09-16 05:56:18 UTC (rev 3170) @@ -0,0 +1,10 @@ +int pyobj_to_string_len(PyObject* obj, f2py_string* value, size_t length) { + if (PyString_Check(obj)) { + if (strncpy((char*)value,PyString_AS_STRING(obj), length)) + return 1; + } + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C f2py_string."); + } + return 0; +} Modified: trunk/numpy/f2py/lib/statements.py =================================================================== --- trunk/numpy/f2py/lib/statements.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/statements.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -52,6 +52,7 @@ match = re.compile(r'\w[^=]*\s*=\>?').match item_re = re.compile(r'(?P\w[^=]*)\s*(?P=\>?)\s*(?P.*)\Z',re.I).match + _repr_attr_names = ['variable','sign','expr'] + Statement._repr_attr_names def process_item(self): m = self.item_re(self.item.get_line()) @@ -525,6 +526,7 @@ def analyze(self): module_procedures = self.parent.a.module_procedures module_procedures.extend(self.items) + # XXX: add names to parent_provides return class Access(Statement): @@ -560,7 +562,7 @@ var = self.get_variable(name) var.update(clsname) else: - self.parent.a.attributes.append(clsname) + self.parent.update_attributes(clsname) return class Public(Access): @@ -847,8 +849,11 @@ return tab + s def analyze(self): + use = self.parent.a.use + if use.has_key(self.name): + return + modules = self.top.a.module - if not modules.has_key(self.name): fn = None for d in self.reader.include_dirs: @@ -867,9 +872,10 @@ modules.update(parser.block.a.module) if not modules.has_key(self.name): - self.warning('no information about the use module %r' % (self.name)) + self.warning('no information about the module %r in use statement' % (self.name)) return + module = modules[self.name] use_provides = self.parent.a.use_provides @@ -1111,7 +1117,7 @@ return def __str__(self): return self.get_indent_tab() + 'SEQUENCE' def analyze(self): - self.parent.a.attributes.append('SEQUENCE') + self.parent.update_attributes('SEQUENCE') return class External(StatementWithNamelist): @@ -1218,6 +1224,7 @@ var = self.get_variable(name) if shape is not None: var.set_bounds(shape) + # XXX: add name,var to parent_provides return class Optional(StatementWithNamelist): Modified: trunk/numpy/f2py/lib/typedecl_statements.py =================================================================== --- trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -1,9 +1,14 @@ +__all__ = ['Integer', 'Real', 'DoublePrecision', 'Complex', 'DoubleComplex', + 'Character', 'Logical', 'Byte', 'TypeStmt','Class', + 'intrinsic_type_spec', 'declaration_type_spec', + 'Implicit'] + import re import string from base_classes import Statement, BeginStatement, EndStatement,\ AttributeHolder, Variable -from utils import split_comma, AnalyzeError, name_re, is_entity_decl +from utils import split_comma, AnalyzeError, name_re, is_entity_decl, is_name, CHAR_BIT # Intrinsic type specification statements @@ -27,6 +32,10 @@ | LOGICAL [] = ( [ KIND = ] ) + EXTENSION: + = ( [ KIND = ] ) + | * + = | ( LEN = , KIND = ) | ( , [ KIND = ] ) @@ -61,6 +70,7 @@ = [ ].. = | """ + _repr_attr_names = ['selector','attrspec','entity_decls'] + Statement._repr_attr_names def process_item(self): item = self.item @@ -146,13 +156,19 @@ assert self.parent.typedecl is None,`self.parent.typedecl` self.parent.typedecl = self self.ignore = True + if isinstance(self, Type): + self.name = self.selector[1].lower() + assert is_name(self.name),`self.name` + else: + self.name = clsname return def _parse_kind_selector(self, selector): if not selector: - return '' + return '','' + length,kind = '','' if selector.startswith('*'): - kind = selector[1:].lstrip() + length = selector[1:].lstrip() else: assert selector[0]+selector[-1]=='()',`selector` l = selector[1:-1].strip() @@ -162,7 +178,7 @@ kind = l[1:].lstrip() else: kind = l - return kind + return length,kind def _parse_char_selector(self, selector): if not selector: @@ -213,8 +229,8 @@ def tostr(self): clsname = self.__class__.__name__.upper() s = '' + length, kind = self.selector if isinstance(self, Character): - length, kind = self.selector if length and kind: s += '(LEN=%s, KIND=%s)' % (length,kind) elif length: @@ -222,9 +238,14 @@ elif kind: s += '(KIND=%s)' % (kind) else: - kind = self.selector - if kind: - s += '(KIND=%s)' % (kind) + if isinstance(self, Type): + s += '(%s)' % (kind) + else: + if length: + s += '*%s' % (length) + if kind: + s += '(KIND=%s)' % (kind) + return clsname + s def __str__(self): @@ -244,7 +265,9 @@ return self.selector==other.selector def astypedecl(self): - return self.__class__(self.parent, self.item.copy(self.tostr())) + if self.entity_decls or self.attrspec: + return self.__class__(self.parent, self.item.copy(self.tostr())) + return self def analyze(self): if not self.entity_decls: @@ -253,11 +276,8 @@ typedecl = self.astypedecl() for item in self.entity_decls: name, array_spec, char_length, value = self._parse_entity(item) - if not variables.has_key(name): - variables[name] = var = Variable(self, name) - else: - var = variables[name] - var.add_parent(self) + var = self.parent.get_variable(name) + var.add_parent(self) if char_length: var.set_length(char_length) else: @@ -267,6 +287,7 @@ var.set_bounds(array_spec) if value: var.set_init(value) + var.analyze() return def _parse_entity(self, line): @@ -296,34 +317,170 @@ value = item.apply_map(line[1:].lstrip()) return name, array_spec, char_length, value + def get_zero_value(self): + raise NotImplementedError,`self.__class__.__name__` + + def assign_expression(self, name, value): + return '%s = %s' % (name, value) + + def get_kind(self): + return self.selector[1] or self.default_kind + + def get_length(self): + return self.selector[0] or 1 + + def get_bit_size(self): + return CHAR_BIT * int(self.get_kind()) + + def get_byte_size(self): + return self.get_bit_size() / CHAR_BIT + + def is_intrinsic(self): return not isinstance(self,(Type,Class)) + def is_derived(self): return isinstance(self,Type) + + def is_numeric(self): return isinstance(self,(Integer,Real, DoublePrecision,Complex,DoubleComplex,Byte)) + def is_nonnumeric(self): return isinstance(self,(Character,Logical)) + + class Integer(TypeDeclarationStatement): match = re.compile(r'integer\b',re.I).match + default_kind = 4 + def get_c_type(self): + return 'npy_int%s' % (self.get_bit_size()) + + def get_zero_value(self): + kind = self.get_kind() + if kind==self.default_kind: return '0' + return '0_%s' % (kind) + class Real(TypeDeclarationStatement): match = re.compile(r'real\b',re.I).match + default_kind = 4 + def get_c_type(self): + return 'npy_float%s' % (self.get_bit_size()) + + def get_zero_value(self): + kind = self.get_kind() + if kind==self.default_kind: return '0.0' + return '0_%s' % (kind) + class DoublePrecision(TypeDeclarationStatement): match = re.compile(r'double\s*precision\b',re.I).match + default_kind = 8 + + def get_zero_value(self): + return '0.0D0' + def get_c_type(self): + return 'npy_float%s' % (self.get_bit_size()) + class Complex(TypeDeclarationStatement): match = re.compile(r'complex\b',re.I).match + default_kind = 4 + def get_kind(self): + length, kind = self.selector + if kind: + return kind + if length: + return int(length)/2 + return self.default_kind + + def get_length(self): + return 2 * int(self.get_kind()) + + def get_bit_size(self): + return CHAR_BIT * self.get_length() + + def get_zero_value(self): + kind = self.get_kind() + if kind==self.default_kind: return '(0.0, 0.0)' + return '(0.0_%s, 0.0_%s)' % (kind, kind) + + def get_c_type(self): + return 'npy_complex%s' % (self.get_bit_size()) + class DoubleComplex(TypeDeclarationStatement): # not in standard match = re.compile(r'double\s*complex\b',re.I).match + default_kind = 8 + def get_kind(self): return self.default_kind + def get_length(self): return 2 * self.get_kind() + def get_bit_size(self): + return CHAR_BIT * self.get_length() + + def get_zero_value(self): + return '(0.0D0,0.0D0)' + + def get_c_type(self): + return 'npy_complex%s' % (self.get_bit_size()) + class Logical(TypeDeclarationStatement): match = re.compile(r'logical\b',re.I).match + default_kind = 4 + def get_zero_value(self): + return ".FALSE." + + def get_c_type(self): + return 'npy_int%s' % (self.get_bit_size()) + class Character(TypeDeclarationStatement): match = re.compile(r'character\b',re.I).match + default_kind = 1 + def get_bit_size(self): + return CHAR_BIT * int(self.get_length()) * int(self.get_kind()) + + def get_c_type(self): + return 'f2py_string%s' % (self.get_bit_size()) + + def get_zero_value(self): + return "''" + class Byte(TypeDeclarationStatement): # not in standard match = re.compile(r'byte\b',re.I).match + default_kind = 1 + def get_zero_value(self): + return '0' + + def get_c_type(self): + return 'npy_int%s' % (self.get_bit_size()) + class Type(TypeDeclarationStatement): match = re.compile(r'type\s*\(', re.I).match + + def get_zero_value(self): + kind = self.selector + assert is_name(kind),`kind` + type_decl = self.get_type_decl(kind) + component_names = type_decl.a.component_names + components = type_decl.a.components + l = [] + for name in component_names: + var = components[name] + l.append(var.typedecl.get_zero_value()) + return '%s(%s)' % (type_decl.name, ', '.join(l)) + + def get_kind(self): + # See 4.5.2, page 48 + raise NotImplementedError,`self.__class__.__name__` + + def get_bit_size(self): + type_decl = self.get_type_decl(self.name) + s = 0 + for name,var in type_decl.a.components.items(): + s += var.get_bit_size() + return s + + def get_c_type(self): + return 'f2py_type_%s_%s' % (self.name, self.get_bit_size()) + TypeStmt = Type class Class(TypeDeclarationStatement): Modified: trunk/numpy/f2py/lib/utils.py =================================================================== --- trunk/numpy/f2py/lib/utils.py 2006-09-16 02:08:59 UTC (rev 3169) +++ trunk/numpy/f2py/lib/utils.py 2006-09-16 05:56:18 UTC (rev 3170) @@ -74,6 +74,8 @@ return name, line[i+1:].lstrip() def filter_stmts(content, classes): + """ Pop and return classes instances from content. + """ stmts = [] indices = [] for i in range(len(content)): @@ -123,3 +125,30 @@ return fn f.close() return + +def str2stmt(string, isfree=True, isstrict=False): + """ Convert Fortran code to Statement tree. + """ + from readfortran import Line, FortranStringReader + from parsefortran import FortranParser + reader = FortranStringReader(string, isfree, isstrict) + parser = FortranParser(reader) + parser.parse() + parser.analyze() + block = parser.block + while len(block.content)==1: + block = block.content[0] + return block + +def get_char_bit(): + import numpy + one = numpy.ubyte(1) + two = numpy.ubyte(2) + n = numpy.ubyte(2) + i = 1 + while n>=two: + n <<= one + i += 1 + return i + +CHAR_BIT = get_char_bit() From numpy-svn at scipy.org Sat Sep 16 18:27:43 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 16 Sep 2006 17:27:43 -0500 (CDT) Subject: [Numpy-svn] r3172 - trunk/numpy/core/src Message-ID: <20060916222743.A42A139C0D2@new.scipy.org> Author: oliphant Date: 2006-09-16 17:27:38 -0500 (Sat, 16 Sep 2006) New Revision: 3172 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix type-coercion for void-type arrays. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-16 06:03:58 UTC (rev 3171) +++ trunk/numpy/core/src/arrayobject.c 2006-09-16 22:27:38 UTC (rev 3172) @@ -6785,6 +6785,11 @@ PyArray_Descr *outtype; int outtype_num, save_num; + if (PyArray_EquivTypes(chktype, mintype)) { + Py_INCREF(mintype); + return mintype; + } + if (chktype->type_num > mintype->type_num) outtype_num = chktype->type_num; else @@ -6872,23 +6877,33 @@ PyArray_Descr *chktype=NULL; PyArray_Descr *outtype; - if (minitype == NULL) - minitype = PyArray_DescrFromType(PyArray_BOOL); - else Py_INCREF(minitype); + /* These need to come first because if op already carries + a descr structure, then we want it to be the result if minitype + is NULL. + */ - if (max < 0) goto deflt; - if (PyArray_Check(op)) { chktype = PyArray_DESCR(op); Py_INCREF(chktype); + if (minitype == NULL) return chktype; + Py_INCREF(minitype); goto finish; } if (PyArray_IsScalar(op, Generic)) { chktype = PyArray_DescrFromScalar(op); + if (minitype == NULL) return chktype; + Py_INCREF(minitype); goto finish; } + if (minitype == NULL) { + minitype = PyArray_DescrFromType(PyArray_BOOL); + } + else Py_INCREF(minitype); + + if (max < 0) goto deflt; + chktype = _array_find_python_scalar_type(op); if (chktype) { goto finish; @@ -6999,8 +7014,10 @@ outtype = _array_small_type(chktype, minitype); Py_DECREF(chktype); Py_DECREF(minitype); - /* VOID Arrays should not occur by "default" */ - if (outtype->type_num == PyArray_VOID) { + /* VOID Arrays should not occur by "default" + unless intput was already a VOID */ + if (outtype->type_num == PyArray_VOID && \ + minitype->type_num != PyArray_VOID) { Py_DECREF(outtype); return PyArray_DescrFromType(PyArray_OBJECT); } From numpy-svn at scipy.org Sat Sep 16 18:34:40 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 16 Sep 2006 17:34:40 -0500 (CDT) Subject: [Numpy-svn] r3173 - trunk/numpy/core/tests Message-ID: <20060916223440.C181639C151@new.scipy.org> Author: oliphant Date: 2006-09-16 17:34:36 -0500 (Sat, 16 Sep 2006) New Revision: 3173 Modified: trunk/numpy/core/tests/test_regression.py Log: Add test for recent fix. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-16 22:27:38 UTC (rev 3172) +++ trunk/numpy/core/tests/test_regression.py 2006-09-16 22:34:36 UTC (rev 3173) @@ -400,6 +400,11 @@ def check_empty_array_type(self, level=rlevel): assert_equal(N.array([]).dtype, N.zeros(0).dtype) + + def check_void_coercion(self, level=rlevel): + dt = N.dtype([('a','f4'),('b','i4')]) + x = N.zeros((1,),dt) + assert(N.r_[x,x].dtype == dt) if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Sun Sep 17 02:34:27 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 17 Sep 2006 01:34:27 -0500 (CDT) Subject: [Numpy-svn] r3174 - trunk/numpy/core/src Message-ID: <20060917063427.53BAC39C061@new.scipy.org> Author: oliphant Date: 2006-09-17 01:34:16 -0500 (Sun, 17 Sep 2006) New Revision: 3174 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix typo. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-16 22:34:36 UTC (rev 3173) +++ trunk/numpy/core/src/arrayobject.c 2006-09-17 06:34:16 UTC (rev 3174) @@ -7015,7 +7015,7 @@ Py_DECREF(chktype); Py_DECREF(minitype); /* VOID Arrays should not occur by "default" - unless intput was already a VOID */ + unless input was already a VOID */ if (outtype->type_num == PyArray_VOID && \ minitype->type_num != PyArray_VOID) { Py_DECREF(outtype); From numpy-svn at scipy.org Sun Sep 17 14:00:38 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 17 Sep 2006 13:00:38 -0500 (CDT) Subject: [Numpy-svn] r3175 - trunk/numpy/f2py/lib Message-ID: <20060917180038.9E6FA39C0E6@new.scipy.org> Author: pearu Date: 2006-09-17 13:00:33 -0500 (Sun, 17 Sep 2006) New Revision: 3175 Modified: trunk/numpy/f2py/lib/base_classes.py trunk/numpy/f2py/lib/python_wrapper.py trunk/numpy/f2py/lib/typedecl_statements.py Log: Fixed typos, started impl. derived type support. Modified: trunk/numpy/f2py/lib/base_classes.py =================================================================== --- trunk/numpy/f2py/lib/base_classes.py 2006-09-17 06:34:16 UTC (rev 3174) +++ trunk/numpy/f2py/lib/base_classes.py 2006-09-17 18:00:33 UTC (rev 3175) @@ -112,7 +112,7 @@ return def get_bit_size(self): - typesize = self.typedecl.get_bit_size(self) + typesize = self.typedecl.get_bit_size() if self.is_pointer(): # The size of pointer descriptor is compiler version dependent. Read: # http://www.nersc.gov/vendor_docs/intel/f_ug1/pgwarray.htm @@ -227,7 +227,7 @@ def is_required(self): return 'REQUIRED' in self.attributes def is_pointer(self): return 'POINTER' in self.attributes - def is_array(self): return not not (self.bounds or self.dimensions) + def is_array(self): return not not (self.bounds or self.dimension) def update(self, *attrs): attributes = self.attributes Modified: trunk/numpy/f2py/lib/python_wrapper.py =================================================================== --- trunk/numpy/f2py/lib/python_wrapper.py 2006-09-17 06:34:16 UTC (rev 3174) +++ trunk/numpy/f2py/lib/python_wrapper.py 2006-09-17 18:00:33 UTC (rev 3175) @@ -127,6 +127,7 @@ ''' main_fortran_template = '''\ +! -*- f90 -*- %(fortran_code_list)s ''' def __init__(self, modulename): @@ -305,7 +306,16 @@ return pyobj_to_string_len(obj, (f2py_string*)value, %(ctype_bytes)s); } ''' % (locals()) - + elif ctype.startswith('f2py_type_'): + ctype_bits = int(ctype.split('_')[-1]) + ctype_bytes = ctype_bits / CHAR_BIT + self.add_typedef(ctype,'typedef struct { char data[%s]; } %s;' % (ctype_bytes,ctype)) + return ''' +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + return pyobj_to_string_len(obj, (f2py_string*)value, %(ctype_bytes)s); +} +''' % (locals()) + class PythonCAPIFunction(WrapperBase): capi_function_template = ''' static char f2py_doc_%(function_name)s[] = "%(function_doc)s"; @@ -430,8 +440,9 @@ ''' fortran_code_template = '''\ function create_%(typename)s_object_f() result (obj) + %(typedecl_list)s %(typedecl)s obj -! %(initexpr)s +! %(initexpr)s end subroutine initialize_%(typename)s_interface_f(init_c) external create_%(typename)s_object_f @@ -443,6 +454,7 @@ WrapperBase.__init__(self) self.parent = parent self.typedecl = typedecl.astypedecl() + self.typedecl_list = [] self.ctype = self.typedecl.get_c_type() self.byte_size = self.typedecl.get_byte_size() self.typename = self.typedecl.name.lower() @@ -456,6 +468,8 @@ pass elif ctype.startswith('f2py_string'): pass + elif ctype.startswith('f2py_type'): + pass else: self.parent.typedef_list.append(self.apply_attributes(self.typedef_template)) self.parent.objdecl_list.append(self.apply_attributes(self.objdecl_template)) @@ -498,7 +512,7 @@ integer d,n end type rational end module rat - subroutine foo(a,b) + subroutine foo(a,b,c) use rat integer a character*5 b Modified: trunk/numpy/f2py/lib/typedecl_statements.py =================================================================== --- trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-17 06:34:16 UTC (rev 3174) +++ trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-17 18:00:33 UTC (rev 3175) @@ -456,9 +456,7 @@ match = re.compile(r'type\s*\(', re.I).match def get_zero_value(self): - kind = self.selector - assert is_name(kind),`kind` - type_decl = self.get_type_decl(kind) + type_decl = self.get_type_decl(self.name) component_names = type_decl.a.component_names components = type_decl.a.components l = [] From numpy-svn at scipy.org Mon Sep 18 15:14:48 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 14:14:48 -0500 (CDT) Subject: [Numpy-svn] r3176 - trunk/numpy/core/src Message-ID: <20060918191448.AB4E439C05B@new.scipy.org> Author: oliphant Date: 2006-09-18 14:14:35 -0500 (Mon, 18 Sep 2006) New Revision: 3176 Modified: trunk/numpy/core/src/arraymethods.c Log: Fix so that astype and transpose return 0-d arrays if given 0-d arrays. Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-17 18:00:33 UTC (rev 3175) +++ trunk/numpy/core/src/arraymethods.c 2006-09-18 19:14:35 UTC (rev 3176) @@ -650,7 +650,6 @@ } - static PyObject * array_cast(PyArrayObject *self, PyObject *args) { @@ -668,7 +667,7 @@ if (descr->names != NULL) { return PyArray_FromArray(self, descr, NPY_FORCECAST); } - return _ARET(PyArray_CastToType(self, descr, 0)); + return PyArray_CastToType(self, descr, 0); } /* default sub-type implementation */ @@ -1351,7 +1350,7 @@ PyDimMem_FREE(permute.ptr); } - return _ARET(ret); + return ret; } #define _CHKTYPENUM(typ) ((typ) ? (typ)->type_num : PyArray_NOTYPE) From numpy-svn at scipy.org Mon Sep 18 16:12:49 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 15:12:49 -0500 (CDT) Subject: [Numpy-svn] r3177 - trunk/numpy/core/src Message-ID: <20060918201249.4F77839C093@new.scipy.org> Author: oliphant Date: 2006-09-18 15:12:21 -0500 (Mon, 18 Sep 2006) New Revision: 3177 Modified: trunk/numpy/core/src/ufuncobject.c Log: Fix #280 Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-18 19:14:35 UTC (rev 3176) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-18 20:12:21 UTC (rev 3177) @@ -3212,7 +3212,7 @@ } else { PyUFunc_Loop1d *current, *prev=NULL; - int cmp; + int cmp=1; /* There is already at least 1 loop. Place this one in lexicographic order. If the next one signature is exactly like this one, then just replace. @@ -3235,7 +3235,7 @@ else { /* insert it before the current one by hacking the internals of cobject to replace the function pointer --- - can't use API because destructor is set. + can't use CObject API because destructor is set. */ funcdata->next = current; if (prev == NULL) { /* place this at front */ From numpy-svn at scipy.org Mon Sep 18 16:26:11 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 15:26:11 -0500 (CDT) Subject: [Numpy-svn] r3178 - trunk/numpy/core/src Message-ID: <20060918202611.5B52D39C093@new.scipy.org> Author: oliphant Date: 2006-09-18 15:25:17 -0500 (Mon, 18 Sep 2006) New Revision: 3178 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Fixed #282 Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-18 20:12:21 UTC (rev 3177) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-18 20:25:17 UTC (rev 3178) @@ -4569,11 +4569,13 @@ if (align) { int _align = newdescr->alignment; if (_align > 1) totalsize = \ - ((totalsize + _align - 1)/_align)*_align; - maxalign = MAX(maxalign,_align); + ((totalsize + _align - 1)/_align)* \ + _align; } PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(totalsize)); } + if (align) + maxalign = MAX(maxalign,newdescr->alignment); if (len == 3) PyTuple_SET_ITEM(tup, 2, item); name = PyObject_GetItem(names, index); Py_DECREF(index); @@ -4586,13 +4588,14 @@ /* Insert into dictionary */ if (PyDict_GetItem(fields, name) != NULL) { PyErr_SetString(PyExc_ValueError, - "name already used as a name or title"); + "name already used as a name or "\ + "title"); ret = PY_FAIL; } PyDict_SetItem(fields, name, tup); Py_DECREF(name); if (len == 3) { - if ((PyString_Check(item) || PyUnicode_Check(item)) && \ + if ((PyString_Check(item) || PyUnicode_Check(item)) && PyDict_GetItem(fields, item) != NULL) { PyErr_SetString(PyExc_ValueError, "title already used as a "\ From numpy-svn at scipy.org Mon Sep 18 16:38:23 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 15:38:23 -0500 (CDT) Subject: [Numpy-svn] r3179 - trunk/numpy/core/src Message-ID: <20060918203823.5D1BA39C093@new.scipy.org> Author: oliphant Date: 2006-09-18 15:36:43 -0500 (Mon, 18 Sep 2006) New Revision: 3179 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Rework fix to #282 Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-18 20:25:17 UTC (rev 3178) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-18 20:36:43 UTC (rev 3179) @@ -4529,7 +4529,7 @@ totalsize = 0; for(i=0; ialignment; + maxalign = MAX(maxalign,_align); + } if (offsets) { long offset; off = PyObject_GetItem(offsets, index); @@ -4566,16 +4570,12 @@ if (offset > totalsize) totalsize = offset; } else { - if (align) { - int _align = newdescr->alignment; - if (_align > 1) totalsize = \ - ((totalsize + _align - 1)/_align)* \ - _align; + if (align && _align > 1) { + totalsize = ((totalsize + _align - 1) \ + /_align)*_align; } PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(totalsize)); } - if (align) - maxalign = MAX(maxalign,newdescr->alignment); if (len == 3) PyTuple_SET_ITEM(tup, 2, item); name = PyObject_GetItem(names, index); Py_DECREF(index); From numpy-svn at scipy.org Mon Sep 18 16:51:05 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 15:51:05 -0500 (CDT) Subject: [Numpy-svn] r3180 - trunk/numpy/core/src Message-ID: <20060918205105.9794C39C093@new.scipy.org> Author: oliphant Date: 2006-09-18 15:50:10 -0500 (Mon, 18 Sep 2006) New Revision: 3180 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Fix copyswap for VOID arrays when src is NULL Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2006-09-18 20:36:43 UTC (rev 3179) +++ trunk/numpy/core/src/arraytypes.inc.src 2006-09-18 20:50:10 UTC (rev 3180) @@ -1234,9 +1234,13 @@ descr = arr->descr; while (PyDict_Next(descr->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) {arr->descr=descr;return;} + &title)) { + arr->descr=descr;return; + } arr->descr = new; - new->f->copyswapn(dst+offset, dstride, src+offset, sstride, n, swap, arr); + new->f->copyswapn(dst+offset, dstride, + (src != NULL ? src+offset : NULL), + sstride, n, swap, arr); } arr->descr = descr; return; @@ -1258,9 +1262,13 @@ descr = arr->descr; /* Save it */ while (PyDict_Next(descr->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) {arr->descr=descr;return;} + &title)) { + arr->descr=descr;return; + } arr->descr = new; - new->f->copyswap(dst+offset, src+offset, swap, arr); + new->f->copyswap(dst+offset, + (src != NULL ? src+offset : NULL), + swap, arr); } arr->descr = descr; return; From numpy-svn at scipy.org Mon Sep 18 17:04:35 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 16:04:35 -0500 (CDT) Subject: [Numpy-svn] r3181 - trunk/numpy/core/tests Message-ID: <20060918210435.B2EB039C06B@new.scipy.org> Author: oliphant Date: 2006-09-18 16:04:31 -0500 (Mon, 18 Sep 2006) New Revision: 3181 Modified: trunk/numpy/core/tests/test_regression.py Log: Add tests for recent void byteswap problem. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-18 20:50:10 UTC (rev 3180) +++ trunk/numpy/core/tests/test_regression.py 2006-09-18 21:04:31 UTC (rev 3181) @@ -405,6 +405,12 @@ dt = N.dtype([('a','f4'),('b','i4')]) x = N.zeros((1,),dt) assert(N.r_[x,x].dtype == dt) + + def check_void_copyswap(self, level=rlevel): + dt = N.dtype([('one', ' 1 and x['two'] > 2) if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Mon Sep 18 19:27:36 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 18:27:36 -0500 (CDT) Subject: [Numpy-svn] r3182 - in trunk/numpy/lib: . tests Message-ID: <20060918232736.7DB2C39C09B@new.scipy.org> Author: stefan Date: 2006-09-18 18:27:24 -0500 (Mon, 18 Sep 2006) New Revision: 3182 Modified: trunk/numpy/lib/arraysetops.py trunk/numpy/lib/function_base.py trunk/numpy/lib/tests/test_arraysetops.py Log: Add ediff1d support for empty arrays. Fix ediff1d for to_begin or to_end = 0. Allow insert to operate on empty arrays. Modified: trunk/numpy/lib/arraysetops.py =================================================================== --- trunk/numpy/lib/arraysetops.py 2006-09-18 21:04:31 UTC (rev 3181) +++ trunk/numpy/lib/arraysetops.py 2006-09-18 23:27:24 UTC (rev 3182) @@ -34,28 +34,17 @@ ## # 03.11.2005, c -def ediff1d( ar1, to_end = None, to_begin = None ): +def ediff1d(ary, to_end = None, to_begin = None): """Array difference with prefixed and/or appended value.""" - dar1 = ar1[1:] - ar1[:-1] - if to_end and to_begin: - shape = (ar1.shape[0] + 1,) + ar1.shape[1:] - ed = numpy.empty( shape, dtype = ar1.dtype ) - ed[0], ed[-1] = to_begin, to_end - ed[1:-1] = dar1 - elif to_end: - ed = numpy.empty( ar1.shape, dtype = ar1.dtype ) - ed[-1] = to_end - ed[:-1] = dar1 - elif to_begin: - ed = numpy.empty( ar1.shape, dtype = ar1.dtype ) - ed[0] = to_begin - ed[1:] = dar1 - else: - ed = dar1 - + ary = numpy.asarray(ary) + ed = ary[1:] - ary[:-1] + if to_begin is not None: + ed = numpy.insert(ed, 0, to_begin) + if to_end is not None: + ed = numpy.append(ed, to_end) + return ed - ## # 01.11.2005, c # 02.11.2005 @@ -95,11 +84,11 @@ # 01.11.2005, c def setxor1d( ar1, ar2 ): """Set exclusive-or of 1D arrays with unique elements.""" - aux = numpy.concatenate( (ar1, ar2 ) ) + aux = numpy.concatenate((ar1, ar2)) aux.sort() - flag = ediff1d( aux, to_end = 1, to_begin = 1 ) == 0 - flag2 = ediff1d( flag, 0 ) == 0 - return aux.compress( flag2 ) + flag = ediff1d(aux, to_end = 1, to_begin = 1) == 0 + flag2 = ediff1d(flag) == 0 + return aux.compress(flag2) ## # 03.11.2005, c Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2006-09-18 21:04:31 UTC (rev 3181) +++ trunk/numpy/lib/function_base.py 2006-09-18 23:27:24 UTC (rev 3182) @@ -1286,7 +1286,7 @@ newshape = list(arr.shape) if isinstance(obj, (int, long, integer)): if (obj < 0): obj += N - if (obj < 0 or obj >=N): + if (obj < 0 or obj > N or (obj == N and N != 0)): raise ValueError, "index (%d) out of range (0<=index<=%d) "\ "in dimension %d" % (obj, N, axis) newshape[axis] += 1; Modified: trunk/numpy/lib/tests/test_arraysetops.py =================================================================== --- trunk/numpy/lib/tests/test_arraysetops.py 2006-09-18 21:04:31 UTC (rev 3181) +++ trunk/numpy/lib/tests/test_arraysetops.py 2006-09-18 23:27:24 UTC (rev 3182) @@ -6,6 +6,7 @@ set_package_path() import numpy from numpy.lib.arraysetops import * +from numpy.lib.arraysetops import ediff1d restore_path() ################################################## @@ -68,6 +69,17 @@ c = setxor1d( a, b ) assert_array_equal( c, ec ) + def check_ediff1d(self): + zero_elem = numpy.array([]) + one_elem = numpy.array([1]) + two_elem = numpy.array([1,2]) + + assert_array_equal([],ediff1d(zero_elem)) + assert_array_equal([0],ediff1d(zero_elem,to_begin=0)) + assert_array_equal([0],ediff1d(zero_elem,to_end=0)) + assert_array_equal([-1,0],ediff1d(zero_elem,to_begin=-1,to_end=0)) + assert_array_equal([],ediff1d(one_elem)) + assert_array_equal([1],ediff1d(two_elem)) ## # 03.11.2005, c From numpy-svn at scipy.org Mon Sep 18 20:00:10 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 19:00:10 -0500 (CDT) Subject: [Numpy-svn] r3183 - trunk/numpy/lib Message-ID: <20060919000010.BC13D39C012@new.scipy.org> Author: stefan Date: 2006-09-18 19:00:03 -0500 (Mon, 18 Sep 2006) New Revision: 3183 Modified: trunk/numpy/lib/arraysetops.py Log: Fix unique1d for empty sets. Closes r208. Modified: trunk/numpy/lib/arraysetops.py =================================================================== --- trunk/numpy/lib/arraysetops.py 2006-09-18 23:27:24 UTC (rev 3182) +++ trunk/numpy/lib/arraysetops.py 2006-09-19 00:00:03 UTC (rev 3183) @@ -48,20 +48,24 @@ ## # 01.11.2005, c # 02.11.2005 -def unique1d( ar1, retindx = False ): +def unique1d(ar1, retindx=False): """Unique elements of 1D array. When ret_indx is True, return also the indices indx such that ar1.flat[indx] is the resulting array of unique elements.""" + ar = numpy.asarray(ar1).ravel() + if ar.size == 0: + if retindx: return numpy.empty(0, numpy.bool), ar + else: return ar + if retindx: - ar = numpy.array(ar1).ravel() perm = ar.argsort() aux = ar.take(perm) - flag = ediff1d( aux, 1 ) != 0 + flag = ediff1d(aux, 1) != 0 return perm.compress(flag), aux.compress(flag) + else: - ar = numpy.array( ar1 ).flatten() - ar.sort() - return ar.compress( ediff1d( ar, 1 ) != 0) + ar = numpy.array(sorted(ar)) + return ar.compress(ediff1d(ar, 1) != 0) ## # 01.11.2005, c From numpy-svn at scipy.org Mon Sep 18 20:17:16 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 19:17:16 -0500 (CDT) Subject: [Numpy-svn] r3184 - trunk/numpy/lib Message-ID: <20060919001716.9967C39C012@new.scipy.org> Author: stefan Date: 2006-09-18 19:17:10 -0500 (Mon, 18 Sep 2006) New Revision: 3184 Modified: trunk/numpy/lib/arraysetops.py Log: Support empty arrays in setxor1d and setdiff1d. Modified: trunk/numpy/lib/arraysetops.py =================================================================== --- trunk/numpy/lib/arraysetops.py 2006-09-19 00:00:03 UTC (rev 3183) +++ trunk/numpy/lib/arraysetops.py 2006-09-19 00:17:10 UTC (rev 3184) @@ -89,6 +89,9 @@ def setxor1d( ar1, ar2 ): """Set exclusive-or of 1D arrays with unique elements.""" aux = numpy.concatenate((ar1, ar2)) + if aux.size == 0: + return aux + aux.sort() flag = ediff1d(aux, to_end = 1, to_begin = 1) == 0 flag2 = ediff1d(flag) == 0 @@ -129,8 +132,11 @@ # 03.11.2005, c def setdiff1d( ar1, ar2 ): """Set difference of 1D arrays with unique elements.""" - aux = setmember1d( ar1, ar2 ) - return ar1.compress(aux == 0) + aux = setmember1d(ar1,ar2) + if aux.size == 0: + return aux + else: + return numpy.asarray(ar1).compress(aux == 0) ## # 02.11.2005, c From numpy-svn at scipy.org Mon Sep 18 20:21:02 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Sep 2006 19:21:02 -0500 (CDT) Subject: [Numpy-svn] r3185 - trunk/numpy/lib/tests Message-ID: <20060919002102.3D5CE39C196@new.scipy.org> Author: stefan Date: 2006-09-18 19:20:56 -0500 (Mon, 18 Sep 2006) New Revision: 3185 Modified: trunk/numpy/lib/tests/test_arraysetops.py Log: Add tests to arraysetops for empty arrays. Modified: trunk/numpy/lib/tests/test_arraysetops.py =================================================================== --- trunk/numpy/lib/tests/test_arraysetops.py 2006-09-19 00:17:10 UTC (rev 3184) +++ trunk/numpy/lib/tests/test_arraysetops.py 2006-09-19 00:20:56 UTC (rev 3185) @@ -21,6 +21,8 @@ ec = numpy.array( [1, 2, 5, 7] ) c = unique1d( a ) assert_array_equal( c, ec ) + + assert_array_equal([], unique1d([])) ## # 03.11.2005, c @@ -32,6 +34,8 @@ ec = numpy.array( [1, 2, 5] ) c = intersect1d( a, b ) assert_array_equal( c, ec ) + + assert_array_equal([], intersect1d([],[])) ## # 03.11.2005, c @@ -43,6 +47,8 @@ ec = numpy.array( [1, 2, 5] ) c = intersect1d_nu( a, b ) assert_array_equal( c, ec ) + + assert_array_equal([], intersect1d_nu([],[])) ## # 03.11.2005, c @@ -68,6 +74,8 @@ ec = numpy.array( [1, 2, 3, 4, 5, 6] ) c = setxor1d( a, b ) assert_array_equal( c, ec ) + + assert_array_equal([], setxor1d([],[])) def check_ediff1d(self): zero_elem = numpy.array([]) @@ -101,6 +109,8 @@ ec = numpy.array( [True, False, True, False] ) c = setmember1d( a, b ) assert_array_equal( c, ec ) + + assert_array_equal([], setmember1d([],[])) ## # 03.11.2005, c @@ -112,6 +122,8 @@ ec = numpy.array( [1, 2, 3, 4, 5, 7] ) c = union1d( a, b ) assert_array_equal( c, ec ) + + assert_array_equal([], union1d([],[])) ## # 03.11.2005, c @@ -130,6 +142,8 @@ ec = numpy.array( [19, 20] ) c = setdiff1d( a, b ) assert_array_equal( c, ec ) + + assert_array_equal([], setdiff1d([],[])) ## From numpy-svn at scipy.org Tue Sep 19 03:58:46 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 02:58:46 -0500 (CDT) Subject: [Numpy-svn] r3186 - in trunk/numpy: numarray oldnumeric Message-ID: <20060919075846.3156139C045@new.scipy.org> Author: oliphant Date: 2006-09-19 02:58:41 -0500 (Tue, 19 Sep 2006) New Revision: 3186 Modified: trunk/numpy/numarray/alter_code1.py trunk/numpy/oldnumeric/alter_code1.py Log: Add convertsrc to alter_code1 and clean it up so it doesn't always write the .orig file Modified: trunk/numpy/numarray/alter_code1.py =================================================================== --- trunk/numpy/numarray/alter_code1.py 2006-09-19 00:20:56 UTC (rev 3185) +++ trunk/numpy/numarray/alter_code1.py 2006-09-19 07:58:41 UTC (rev 3186) @@ -52,7 +52,7 @@ - .setimaginary() --> .imag """ -__all__ = ['convertfile', 'convertall', 'converttree'] +__all__ = ['convertfile', 'convertall', 'converttree', 'convertsrc'] import sys import os @@ -164,6 +164,7 @@ import datetime def fromstr(filestr): + savestr = filestr[:] filestr, fromall = changeimports(filestr, 'numarray', 'numpy.numarray') base = 'numarray' newbase = 'numpy.numarray' @@ -175,40 +176,42 @@ filestr = replaceattr(filestr) filestr = replaceother(filestr) - today = datetime.date.today().strftime('%b %d, %Y') - name = os.path.split(sys.argv[0])[-1] - filestr = '## Automatically adapted for '\ - 'numpy.numarray %s by %s\n\n%s' % (today, name, filestr) - return filestr + if savestr != filestr: + name = os.path.split(sys.argv[0])[-1] + today = datetime.date.today().strftime('%b %d, %Y') + filestr = '## Automatically adapted for '\ + 'numpy.numarray %s by %s\n\n%s' % (today, name, filestr) + return filestr, 1 + return filestr, 0 def makenewfile(name, filestr): fid = file(name, 'w') fid.write(filestr) fid.close() -def getandcopy(name): - fid = file(name) - filestr = fid.read() - fid.close() - base, ext = os.path.splitext(name) - makenewfile(base+'.orig', filestr) - return filestr +def convertfile(filename, orig=1): + """Convert the filename given from using Numarray to using NumPy -def convertfile(filename): - """Convert the filename given from using Numeric to using NumPy - Copies the file to filename.orig and then over-writes the file with the updated code """ - filestr = getandcopy(filename) - filestr = fromstr(filestr) - makenewfile(filename, filestr) + fid = open(filename) + filestr = fid.read() + fid.close() + filestr, changed = fromstr(filestr) + if changed: + if orig: + base, ext = os.path.splitext(filename) + os.rename(filename, base+".orig") + else: + os.remove(filename) + makenewfile(filename, filestr) def fromargs(args): filename = args[1] convertfile(filename) -def convertall(direc=os.path.curdir): +def convertall(direc=os.path.curdir, orig=1): """Convert all .py files to use numpy.oldnumeric (from Numeric) in the directory given For each file, a backup of .py is made as @@ -217,7 +220,44 @@ """ files = glob.glob(os.path.join(direc,'*.py')) for afile in files: - convertfile(afile) + if afile[-8:] == 'setup.py': continue + convertfile(afile, orig) +header_re = re.compile(r'(numarray/libnumarray.h)') + +def convertsrc(direc=os.path.curdir, ext=None, orig=1): + """Replace Numeric/arrayobject.h with numpy/oldnumeric.h in all files in the + directory with extension give by list ext (if ext is None, then all files are + replaced).""" + if ext is None: + files = glob.glob(os.path.join(direc,'*')) + else: + files = [] + for aext in ext: + files.extend(glob.glob(os.path.join(direc,"*.%s" % aext))) + for afile in files: + fid = open(afile) + fstr = fid.read() + fid.close() + fstr, n = header_re.subn(r'numpy/libnumarray.h',fstr) + if n > 0: + if orig: + base, ext = os.path.splitext(afile) + os.rename(afile, base+".orig") + else: + os.remove(afile) + makenewfile(afile, fstr) + +def _func(arg, dirname, fnames): + convertall(dirname, orig=0) + convertsrc(dirname, ['h','c'], orig=0) + +def converttree(direc=os.path.curdir): + """Convert all .py files in the tree given + + """ + os.path.walk(direc, _func, None) + + if __name__ == '__main__': - fromargs(sys.argv) + converttree(sys.argv) Modified: trunk/numpy/oldnumeric/alter_code1.py =================================================================== --- trunk/numpy/oldnumeric/alter_code1.py 2006-09-19 00:20:56 UTC (rev 3185) +++ trunk/numpy/oldnumeric/alter_code1.py 2006-09-19 07:58:41 UTC (rev 3186) @@ -28,7 +28,7 @@ * Converts uses of type(...) is isinstance(..., ) """ -__all__ = ['convertfile', 'convertall', 'converttree'] +__all__ = ['convertfile', 'convertall', 'converttree', 'convertsrc'] import sys import os @@ -130,6 +130,7 @@ import datetime def fromstr(filestr): + savestr = filestr[:] filestr = fixtypechars(filestr) filestr = fixistesting(filestr) filestr, fromall1 = changeimports(filestr, 'Numeric', 'numpy.oldnumeric') @@ -151,56 +152,84 @@ fromall = fromall1 or fromall2 or fromall3 filestr = replaceattr(filestr) filestr = replaceother(filestr) - today = datetime.date.today().strftime('%b %d, %Y') - name = os.path.split(sys.argv[0])[-1] - filestr = '## Automatically adapted for '\ - 'numpy.oldnumeric %s by %s\n\n%s' % (today, name, filestr) - return filestr + if savestr != filestr: + today = datetime.date.today().strftime('%b %d, %Y') + name = os.path.split(sys.argv[0])[-1] + filestr = '## Automatically adapted for '\ + 'numpy.oldnumeric %s by %s\n\n%s' % (today, name, filestr) + return filestr, 1 + return filestr, 0 def makenewfile(name, filestr): fid = file(name, 'w') fid.write(filestr) fid.close() -def getandcopy(name): - fid = file(name) - filestr = fid.read() - fid.close() - base, ext = os.path.splitext(name) - makenewfile(base+'.orig', filestr) - return filestr - -def convertfile(filename): +def convertfile(filename, orig=1): """Convert the filename given from using Numeric to using NumPy Copies the file to filename.orig and then over-writes the file with the updated code """ - filestr = getandcopy(filename) - filestr = fromstr(filestr) - makenewfile(filename, filestr) + fid = open(filename) + filestr = fid.read() + fid.close() + filestr, changed = fromstr(filestr) + if changed: + if orig: + base, ext = os.path.splitext(filename) + os.rename(filename, base+".orig") + else: + os.remove(filename) + makenewfile(filename, filestr) def fromargs(args): filename = args[1] - convertfile(filename) + converttree(filename) -def convertall(direc=os.path.curdir): +def convertall(direc=os.path.curdir, orig=1): """Convert all .py files to use numpy.oldnumeric (from Numeric) in the directory given - For each file, a backup of .py is made as + For each changed file, a backup of .py is made as .py.orig. A new file named .py is then written with the updated code. """ files = glob.glob(os.path.join(direc,'*.py')) for afile in files: - convertfile(afile) + if afile[-8:] == 'setup.py': continue # skip these + convertfile(afile, orig) +header_re = re.compile(r'(Numeric/arrayobject.h)') + +def convertsrc(direc=os.path.curdir, ext=None, orig=1): + """Replace Numeric/arrayobject.h with numpy/oldnumeric.h in all files in the + directory with extension give by list ext (if ext is None, then all files are + replaced).""" + if ext is None: + files = glob.glob(os.path.join(direc,'*')) + else: + files = [] + for aext in ext: + files.extend(glob.glob(os.path.join(direc,"*.%s" % aext))) + for afile in files: + fid = open(afile) + fstr = fid.read() + fid.close() + fstr, n = header_re.subn(r'numpy/oldnumeric.h',fstr) + if n > 0: + if orig: + base, ext = os.path.splitext(afile) + os.rename(afile, base+".orig") + else: + os.remove(afile) + makenewfile(afile, fstr) + def _func(arg, dirname, fnames): - convertall(dirname) + convertall(dirname, orig=0) + convertsrc(dirname, ext=['h','c'], orig=0) def converttree(direc=os.path.curdir): - """Convert all .py files in the tree given - + """Convert all .py files and source code files in the tree given """ os.path.walk(direc, _func, None) From numpy-svn at scipy.org Tue Sep 19 04:44:47 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 03:44:47 -0500 (CDT) Subject: [Numpy-svn] r3187 - in trunk/numpy: numarray oldnumeric Message-ID: <20060919084447.4ED1239C032@new.scipy.org> Author: oliphant Date: 2006-09-19 03:44:44 -0500 (Tue, 19 Sep 2006) New Revision: 3187 Modified: trunk/numpy/numarray/alter_code1.py trunk/numpy/oldnumeric/alter_code1.py Log: Add one more import possibility. Modified: trunk/numpy/numarray/alter_code1.py =================================================================== --- trunk/numpy/numarray/alter_code1.py 2006-09-19 07:58:41 UTC (rev 3186) +++ trunk/numpy/numarray/alter_code1.py 2006-09-19 08:44:44 UTC (rev 3187) @@ -69,6 +69,8 @@ if ('.' in name): name_ = name.replace('.','_') + fstr = re.sub(r'(import [^,]+,\s*)(%s)' % name, + "\\1%s as %s" % (newname, name), fstr) fstr = fstr.replace(importasstr, 'import %s as ' % newname) fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name_)) if (name_ != name): Modified: trunk/numpy/oldnumeric/alter_code1.py =================================================================== --- trunk/numpy/oldnumeric/alter_code1.py 2006-09-19 07:58:41 UTC (rev 3186) +++ trunk/numpy/oldnumeric/alter_code1.py 2006-09-19 08:44:44 UTC (rev 3187) @@ -77,6 +77,8 @@ fromstr = 'from %s import ' % name fromall=0 + fstr = re.sub(r'(import [^,]+,\s*)(%s)' % name, + "\\1%s as %s" % (newname, name), fstr) fstr = fstr.replace(importasstr, 'import %s as ' % newname) fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name)) From numpy-svn at scipy.org Tue Sep 19 09:19:20 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 08:19:20 -0500 (CDT) Subject: [Numpy-svn] r3188 - trunk/numpy/core/src Message-ID: <20060919131920.AC9F739C09D@new.scipy.org> Author: pearu Date: 2006-09-19 08:19:07 -0500 (Tue, 19 Sep 2006) New Revision: 3188 Modified: trunk/numpy/core/src/arrayobject.c Log: Fixed compiler errors when using Python 2.5rc. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-19 08:44:44 UTC (rev 3187) +++ trunk/numpy/core/src/arrayobject.c 2006-09-19 13:19:07 UTC (rev 3188) @@ -563,7 +563,11 @@ } #if (PY_VERSION_HEX >= 0x02050000) if (PyIndex_Check(o)) { - long_value = (longlong) PyNumber_Index(o); + PyObject* value = PyNumber_Index(o); + if (value==NULL) { + return -1; + } + long_value = (longlong) PyInt_AsSsize_t(value); goto finish; } #endif @@ -652,7 +656,8 @@ } #if (PY_VERSION_HEX >= 0x02050000) if (PyIndex_Check(o)) { - long_value = (longlong) PyNumber_Index(o); + PyObject* value = PyNumber_Index(o); + long_value = (longlong) PyInt_AsSsize_t(value); goto finish; } #endif @@ -3393,8 +3398,14 @@ } #if (PY_VERSION_HEX >= 0x02050000) if (PyIndex_Check(o2)) { + PyObject* value = PyNumber_Index(o2); Py_ssize_t val; - val = PyNumber_Index(obj); + if (value==NULL) { + if (PyErr_Occurred()) + PyErr_Clear(); + return 0; + } + val = PyInt_AsSsize_t(value); if (val == -1 && PyErr_Occurred()) { PyErr_Clear(); return 0; From numpy-svn at scipy.org Tue Sep 19 12:56:28 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 11:56:28 -0500 (CDT) Subject: [Numpy-svn] r3189 - in trunk/numpy: . core Message-ID: <20060919165628.ED1EA39C0F8@new.scipy.org> Author: charris Date: 2006-09-19 11:56:07 -0500 (Tue, 19 Sep 2006) New Revision: 3189 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/fromnumeric.py Log: Fix ticket #284 Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-19 13:19:07 UTC (rev 3188) +++ trunk/numpy/add_newdocs.py 2006-09-19 16:56:07 UTC (rev 3189) @@ -356,7 +356,7 @@ add_newdoc('numpy.core.multiarray','lexsort', - """lexsort(keys=, axis=-1) + """lexsort(keys=, axis=-1) -> array of indices. argsort with list of keys. Return an array of indices similar to argsort, except the sorting is done using the provided sorting keys. First the sort is done using @@ -658,7 +658,7 @@ This method executes an indirect sort along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of - the same shape as a that index data along the given axis in sorted order. + the same shape as 'a' that index data along the given axis in sorted order. The various sorts are characterized by average speed, worst case performance, need for work space, and whether they are stable. A stable @@ -668,9 +668,9 @@ |------------------------------------------------------| | kind | speed | worst case | work space | stable| |------------------------------------------------------| - |'quicksort'| 1 | o(n^2) | 0 | no | - |'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | - |'heapsort' | 3 | o(n*log(n)) | 0 | no | + |'quicksort'| 1 | O(n^2) | 0 | no | + |'mergesort'| 2 | O(n*log(n)) | ~n/2 | yes | + |'heapsort' | 3 | O(n*log(n)) | 0 | no | |------------------------------------------------------| All the sort algorithms make temporary copies of the data when the sort is @@ -1024,7 +1024,7 @@ Returns: None. - This method sorts a in place along the given axis using the algorithm + This method sorts 'a' in place along the given axis using the algorithm specified by the kind keyword. The various sorts may characterized by average speed, worst case @@ -1036,9 +1036,9 @@ |------------------------------------------------------| | kind | speed | worst case | work space | stable| |------------------------------------------------------| - |'quicksort'| 1 | o(n) | 0 | no | - |'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | - |'heapsort' | 3 | o(n*log(n)) | 0 | no | + |'quicksort'| 1 | O(n^2) | 0 | no | + |'mergesort'| 2 | O(n*log(n)) | ~n/2 | yes | + |'heapsort' | 3 | O(n*log(n)) | 0 | no | |------------------------------------------------------| All the sort algorithms make temporary copies of the data when the sort is Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2006-09-19 13:19:07 UTC (rev 3188) +++ trunk/numpy/core/fromnumeric.py 2006-09-19 16:56:07 UTC (rev 3189) @@ -125,7 +125,7 @@ return transpose(axes) def sort(a, axis=-1, kind='quicksort'): - """Return copy of array sorted along the given axis. + """Returns copy of 'a' sorted along the given axis. Keyword arguments: @@ -135,7 +135,7 @@ Returns: None. - This method sorts a in place along the given axis using the algorithm + This method sorts 'a' in place along the given axis using the algorithm specified by the kind keyword. The various sorts may characterized by average speed, worst case @@ -147,9 +147,9 @@ |------------------------------------------------------| | kind | speed | worst case | work space | stable| |------------------------------------------------------| - |'quicksort'| 1 | o(n) | 0 | no | - |'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | - |'heapsort' | 3 | o(n*log(n)) | 0 | no | + |'quicksort'| 1 | O(n^2) | 0 | no | + |'mergesort'| 2 | O(n*log(n)) | ~n/2 | yes | + |'heapsort' | 3 | O(n*log(n)) | 0 | no | |------------------------------------------------------| All the sort algorithms make temporary copies of the data when the sort is @@ -162,7 +162,7 @@ return a def argsort(a, axis=-1, kind='quicksort'): - """Return array of indices that index a in sorted order. + """Returns array of indices that index 'a' in sorted order. Keyword arguments: @@ -170,11 +170,11 @@ kind -- sorting algorithm (default 'quicksort') Possible values: 'quicksort', 'mergesort', or 'heapsort' - Returns: array of indices that sort a along the specified axis. + Returns: array of indices that sort 'a' along the specified axis. This method executes an indirect sort along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of - the same shape as a that index data along the given axis in sorted order. + the same shape as 'a' that index data along the given axis in sorted order. The various sorts are characterized by average speed, worst case performance, need for work space, and whether they are stable. A stable @@ -184,9 +184,9 @@ |------------------------------------------------------| | kind | speed | worst case | work space | stable| |------------------------------------------------------| - |'quicksort'| 1 | o(n^2) | 0 | no | - |'mergesort'| 2 | o(n*log(n)) | ~n/2 | yes | - |'heapsort' | 3 | o(n*log(n)) | 0 | no | + |'quicksort'| 1 | O(n^2) | 0 | no | + |'mergesort'| 2 | O(n*log(n)) | ~n/2 | yes | + |'heapsort' | 3 | O(n*log(n)) | 0 | no | |------------------------------------------------------| All the sort algorithms make temporary copies of the data when the sort is not From numpy-svn at scipy.org Tue Sep 19 13:29:36 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 12:29:36 -0500 (CDT) Subject: [Numpy-svn] r3190 - trunk/numpy/oldnumeric Message-ID: <20060919172936.CBDA939C1AC@new.scipy.org> Author: rkern Date: 2006-09-19 12:29:34 -0500 (Tue, 19 Sep 2006) New Revision: 3190 Modified: trunk/numpy/oldnumeric/functions.py Log: oldnumeric.argmin should use numpy.argmin Modified: trunk/numpy/oldnumeric/functions.py =================================================================== --- trunk/numpy/oldnumeric/functions.py 2006-09-19 16:56:07 UTC (rev 3189) +++ trunk/numpy/oldnumeric/functions.py 2006-09-19 17:29:34 UTC (rev 3190) @@ -40,7 +40,7 @@ return N.argmax(x, axis) def argmin(x, axis=-1): - return N.argmax(x, axis) + return N.argmin(x, axis) def compress(condition, m, axis=-1): return N.compress(condition, m, axis) From numpy-svn at scipy.org Tue Sep 19 19:03:25 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 18:03:25 -0500 (CDT) Subject: [Numpy-svn] r3191 - trunk/numpy/core/src Message-ID: <20060919230325.A082639C1E4@new.scipy.org> Author: oliphant Date: 2006-09-19 18:03:14 -0500 (Tue, 19 Sep 2006) New Revision: 3191 Modified: trunk/numpy/core/src/arraymethods.c Log: Fix mean, std, and var methods so that they reduce over double data-type with integer inputs. Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-19 17:29:34 UTC (rev 3190) +++ trunk/numpy/core/src/arraymethods.c 2006-09-19 23:03:14 UTC (rev 3191) @@ -1353,6 +1353,27 @@ return ret; } +/* Return typenumber from dtype2 unless it is NULL, then return + NPY_DOUBLE if dtype1->type_num is integer or bool + and dtype1->type_num otherwise. +*/ +static int +_get_type_num_double(PyArray_Descr *dtype1, PyArray_Descr *dtype2) +{ + if (dtype2 == NULL) { /* Use floating point reduction + on integer data-types */ + if (dtype1->type_num < NPY_FLOAT) { + return NPY_DOUBLE; + } + else { + return dtype1->type_num; + } + } + else { + return dtype2->type_num; + } +} + #define _CHKTYPENUM(typ) ((typ) ? (typ)->type_num : PyArray_NOTYPE) static PyObject * @@ -1361,6 +1382,7 @@ int axis=MAX_DIMS; PyArray_Descr *dtype=NULL; PyArrayObject *out=NULL; + int num; static char *kwlist[] = {"axis", "dtype", "out", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O&O&O&", kwlist, @@ -1368,9 +1390,10 @@ &axis, PyArray_DescrConverter2, &dtype, PyArray_OutputConverter, - &out)) return NULL; + &out)) return NULL; - return PyArray_Mean(self, axis, _CHKTYPENUM(dtype), out); + num = _get_type_num_double(self->descr, dtype); + return PyArray_Mean(self, axis, num, out); } static PyObject * @@ -1489,6 +1512,7 @@ int axis=MAX_DIMS; PyArray_Descr *dtype=NULL; PyArrayObject *out=NULL; + int num; static char *kwlist[] = {"axis", "dtype", "out", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O&O&O&", kwlist, @@ -1498,7 +1522,8 @@ PyArray_OutputConverter, &out)) return NULL; - return PyArray_Std(self, axis, _CHKTYPENUM(dtype), out, 0); + num = _get_type_num_double(self->descr, dtype); + return PyArray_Std(self, axis, num, out, 0); } @@ -1508,6 +1533,7 @@ int axis=MAX_DIMS; PyArray_Descr *dtype=NULL; PyArrayObject *out=NULL; + int num; static char *kwlist[] = {"axis", "dtype", "out", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O&O&O&", kwlist, @@ -1517,7 +1543,8 @@ PyArray_OutputConverter, &out)) return NULL; - return PyArray_Std(self, axis, _CHKTYPENUM(dtype), out, 1); + num = _get_type_num_double(self->descr, dtype); + return PyArray_Std(self, axis, num, out, 1); } From numpy-svn at scipy.org Tue Sep 19 19:05:38 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 18:05:38 -0500 (CDT) Subject: [Numpy-svn] r3192 - trunk/numpy/core/src Message-ID: <20060919230538.4812739C050@new.scipy.org> Author: oliphant Date: 2006-09-19 18:05:28 -0500 (Tue, 19 Sep 2006) New Revision: 3192 Modified: trunk/numpy/core/src/arraymethods.c Log: Rework logic a bit for clean-up Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-19 23:03:14 UTC (rev 3191) +++ trunk/numpy/core/src/arraymethods.c 2006-09-19 23:05:28 UTC (rev 3192) @@ -1360,17 +1360,15 @@ static int _get_type_num_double(PyArray_Descr *dtype1, PyArray_Descr *dtype2) { - if (dtype2 == NULL) { /* Use floating point reduction - on integer data-types */ - if (dtype1->type_num < NPY_FLOAT) { - return NPY_DOUBLE; - } - else { - return dtype1->type_num; - } + if (dtype2 != NULL) + return dtype2->type_num; + + /* For integer or bool data-types */ + if (dtype1->type_num < NPY_FLOAT) { + return NPY_DOUBLE; } else { - return dtype2->type_num; + return dtype1->type_num; } } From numpy-svn at scipy.org Tue Sep 19 20:10:46 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 19:10:46 -0500 (CDT) Subject: [Numpy-svn] r3193 - in trunk/numpy: . lib Message-ID: <20060920001046.5CFBA39C0AC@new.scipy.org> Author: oliphant Date: 2006-09-19 19:10:42 -0500 (Tue, 19 Sep 2006) New Revision: 3193 Removed: trunk/numpy/dft/ trunk/numpy/lib/UserArray.py Log: Remove UserArray.py and dft sub-package. Deleted: trunk/numpy/lib/UserArray.py =================================================================== --- trunk/numpy/lib/UserArray.py 2006-09-19 23:05:28 UTC (rev 3192) +++ trunk/numpy/lib/UserArray.py 2006-09-20 00:10:42 UTC (rev 3193) @@ -1,3 +0,0 @@ -from user_array import container as UserArray -import warnings -warnings.warn('UserArray.UserArray will be removed by 1.0final use user_array.container') From numpy-svn at scipy.org Tue Sep 19 20:12:27 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Sep 2006 19:12:27 -0500 (CDT) Subject: [Numpy-svn] r3194 - trunk/numpy Message-ID: <20060920001227.E66EB39C0AC@new.scipy.org> Author: oliphant Date: 2006-09-19 19:12:21 -0500 (Tue, 19 Sep 2006) New Revision: 3194 Modified: trunk/numpy/setup.py Log: Remove dft from build. Modified: trunk/numpy/setup.py =================================================================== --- trunk/numpy/setup.py 2006-09-20 00:10:42 UTC (rev 3193) +++ trunk/numpy/setup.py 2006-09-20 00:12:21 UTC (rev 3194) @@ -10,7 +10,6 @@ config.add_subpackage('lib') config.add_subpackage('oldnumeric') config.add_subpackage('numarray') - config.add_subpackage('dft') config.add_subpackage('fft') config.add_subpackage('linalg') config.add_subpackage('random') From numpy-svn at scipy.org Wed Sep 20 06:53:32 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Sep 2006 05:53:32 -0500 (CDT) Subject: [Numpy-svn] r3195 - trunk/numpy/core/src Message-ID: <20060920105332.D252239C033@new.scipy.org> Author: oliphant Date: 2006-09-20 05:53:30 -0500 (Wed, 20 Sep 2006) New Revision: 3195 Modified: trunk/numpy/core/src/ufuncobject.c Log: Only alter data-type of integer and bool types on reduce-like functions for 'add' and 'multiply' Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-20 00:12:21 UTC (rev 3194) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-20 10:53:30 UTC (rev 3195) @@ -2578,24 +2578,26 @@ } if (otype == NULL) { - /* For integer types --- makes sure at - least a long is used */ + /* For integer types --- make sure at + least a long is used for add and multiply + reduction --- to avoid overflow */ int typenum = PyArray_TYPE(mp); - if (PyTypeNum_ISINTEGER(typenum) && \ - (mp->descr->elsize < sizeof(long))) { - if (PyTypeNum_ISUNSIGNED(typenum)) - typenum = PyArray_ULONG; - else - typenum = PyArray_LONG; - } - else if (PyTypeNum_ISBOOL(typenum) && \ - ((strcmp(self->name,"add")==0) || \ - (strcmp(self->name,"multiply")==0))) { - typenum = PyArray_LONG; - } - otype = PyArray_DescrFromType(typenum); - } + if ((typenum < NPY_FLOAT) && \ + ((strcmp(self->name,"add")==0) || \ + (strcmp(self->name,"multiply")==0))) { + if (PyTypeNum_ISBOOL(typenum)) + typenum = PyArray_LONG; + else if (mp->descr->elsize < sizeof(long)) { + if (PyTypeNum_ISUNSIGNED(typenum)) + typenum = PyArray_ULONG; + else + typenum = PyArray_LONG; + } + } + otype = PyArray_DescrFromType(typenum); + } + switch(operation) { case UFUNC_REDUCE: ret = (PyArrayObject *)PyUFunc_Reduce(self, mp, out, axis, From numpy-svn at scipy.org Wed Sep 20 15:01:14 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Sep 2006 14:01:14 -0500 (CDT) Subject: [Numpy-svn] r3196 - in trunk/numpy: . core/src lib Message-ID: <20060920190114.3558F39C010@new.scipy.org> Author: oliphant Date: 2006-09-20 14:01:00 -0500 (Wed, 20 Sep 2006) New Revision: 3196 Modified: trunk/numpy/__init__.py trunk/numpy/core/src/multiarraymodule.c trunk/numpy/lib/arraysetops.py Log: Remove sorted from unique1d. Add testall to test if level > 10. Remove compiler warning. Modified: trunk/numpy/__init__.py =================================================================== --- trunk/numpy/__init__.py 2006-09-20 10:53:30 UTC (rev 3195) +++ trunk/numpy/__init__.py 2006-09-20 19:01:00 UTC (rev 3196) @@ -82,7 +82,10 @@ """ def test(level=1, verbosity=1): - return NumpyTest().test(level, verbosity) + if level <= 10: + return NumpyTest().test(level, verbosity) + else: + return NumpyTest().testall(level, verbosity) test.__doc__ = NumpyTest.test.__doc__ import add_newdocs Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-20 10:53:30 UTC (rev 3195) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-20 19:01:00 UTC (rev 3196) @@ -4529,7 +4529,7 @@ totalsize = 0; for(i=0; i Author: oliphant Date: 2006-09-20 14:09:38 -0500 (Wed, 20 Sep 2006) New Revision: 3197 Added: tags/1.0rc1/ Log: Tag the tree with 1.0rc1 Copied: tags/1.0rc1 (from rev 3196, trunk) From numpy-svn at scipy.org Wed Sep 20 15:12:02 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Sep 2006 14:12:02 -0500 (CDT) Subject: [Numpy-svn] r3198 - trunk/numpy Message-ID: <20060920191202.5407839C010@new.scipy.org> Author: oliphant Date: 2006-09-20 14:11:56 -0500 (Wed, 20 Sep 2006) New Revision: 3198 Modified: trunk/numpy/version.py Log: Up version number on trunk. Modified: trunk/numpy/version.py =================================================================== --- trunk/numpy/version.py 2006-09-20 19:09:38 UTC (rev 3197) +++ trunk/numpy/version.py 2006-09-20 19:11:56 UTC (rev 3198) @@ -1,4 +1,4 @@ -version='1.0rc1' +version='1.0rc2' release=False if not release: From numpy-svn at scipy.org Wed Sep 20 15:14:42 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Sep 2006 14:14:42 -0500 (CDT) Subject: [Numpy-svn] r3199 - tags/1.0rc1/numpy Message-ID: <20060920191442.B8D1639C010@new.scipy.org> Author: oliphant Date: 2006-09-20 14:14:33 -0500 (Wed, 20 Sep 2006) New Revision: 3199 Modified: tags/1.0rc1/numpy/version.py Log: Make 1.0rc1 a release. Modified: tags/1.0rc1/numpy/version.py =================================================================== --- tags/1.0rc1/numpy/version.py 2006-09-20 19:11:56 UTC (rev 3198) +++ tags/1.0rc1/numpy/version.py 2006-09-20 19:14:33 UTC (rev 3199) @@ -1,5 +1,5 @@ version='1.0rc1' -release=False +release=True if not release: import os From numpy-svn at scipy.org Wed Sep 20 15:18:02 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Sep 2006 14:18:02 -0500 (CDT) Subject: [Numpy-svn] r3200 - trunk/numpy Message-ID: <20060920191802.820A139C010@new.scipy.org> Author: oliphant Date: 2006-09-20 14:17:56 -0500 (Wed, 20 Sep 2006) New Revision: 3200 Modified: trunk/numpy/version.py Log: Next numpy release should be 1.0 Modified: trunk/numpy/version.py =================================================================== --- trunk/numpy/version.py 2006-09-20 19:14:33 UTC (rev 3199) +++ trunk/numpy/version.py 2006-09-20 19:17:56 UTC (rev 3200) @@ -1,4 +1,4 @@ -version='1.0rc2' +version='1.0' release=False if not release: From numpy-svn at scipy.org Wed Sep 20 20:03:56 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Sep 2006 19:03:56 -0500 (CDT) Subject: [Numpy-svn] r3201 - in trunk/numpy: numarray oldnumeric Message-ID: <20060921000356.2D93839C104@new.scipy.org> Author: oliphant Date: 2006-09-20 19:02:22 -0500 (Wed, 20 Sep 2006) New Revision: 3201 Modified: trunk/numpy/numarray/alter_code1.py trunk/numpy/oldnumeric/alter_code1.py Log: Fix problem with alter_code1.py Modified: trunk/numpy/numarray/alter_code1.py =================================================================== --- trunk/numpy/numarray/alter_code1.py 2006-09-20 19:17:56 UTC (rev 3200) +++ trunk/numpy/numarray/alter_code1.py 2006-09-21 00:02:22 UTC (rev 3201) @@ -69,7 +69,7 @@ if ('.' in name): name_ = name.replace('.','_') - fstr = re.sub(r'(import [^,]+,\s*)(%s)' % name, + fstr = re.sub(r'(import\s+[^,\n\r]+,\s*)(%s)' % name, "\\1%s as %s" % (newname, name), fstr) fstr = fstr.replace(importasstr, 'import %s as ' % newname) fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name_)) Modified: trunk/numpy/oldnumeric/alter_code1.py =================================================================== --- trunk/numpy/oldnumeric/alter_code1.py 2006-09-20 19:17:56 UTC (rev 3200) +++ trunk/numpy/oldnumeric/alter_code1.py 2006-09-21 00:02:22 UTC (rev 3201) @@ -77,7 +77,7 @@ fromstr = 'from %s import ' % name fromall=0 - fstr = re.sub(r'(import [^,]+,\s*)(%s)' % name, + fstr = re.sub(r'(import\s+[^,\n\r]+,\s*)(%s)' % name, "\\1%s as %s" % (newname, name), fstr) fstr = fstr.replace(importasstr, 'import %s as ' % newname) fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name)) From numpy-svn at scipy.org Thu Sep 21 03:58:45 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 21 Sep 2006 02:58:45 -0500 (CDT) Subject: [Numpy-svn] r3202 - in trunk/numpy/core: code_generators include/numpy src Message-ID: <20060921075845.7497439C030@new.scipy.org> Author: charris Date: 2006-09-21 02:58:41 -0500 (Thu, 21 Sep 2006) New Revision: 3202 Modified: trunk/numpy/core/code_generators/multiarray_api_order.txt trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/multiarraymodule.c Log: Make a PyArray_SearchsideConverter for the side keyword in searchsorted. Rename some searchsorted variables with more descriptive names. Do some documentation markup in case we ever run doxygen over the source. Modified: trunk/numpy/core/code_generators/multiarray_api_order.txt =================================================================== --- trunk/numpy/core/code_generators/multiarray_api_order.txt 2006-09-21 00:02:22 UTC (rev 3201) +++ trunk/numpy/core/code_generators/multiarray_api_order.txt 2006-09-21 07:58:41 UTC (rev 3202) @@ -79,4 +79,5 @@ _PyArray_SigintHandler _PyArray_GetSigintBuf PyArray_DescrAlignConverter -PyArray_DescrAlignConverter2 \ No newline at end of file +PyArray_DescrAlignConverter2 +PyArray_SearchsideConverter Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-21 00:02:22 UTC (rev 3201) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-21 07:58:41 UTC (rev 3202) @@ -185,8 +185,8 @@ typedef enum { NPY_SEARCHLEFT=0, NPY_SEARCHRIGHT=1, -} NPY_SEARCHKIND; -#define NPY_NSEARCHKINDS NPY_SEARCHRIGHT + 1 +} NPY_SEARCHSIDE; +#define NPY_NSEARCHSIDES NPY_SEARCHRIGHT + 1 typedef enum { Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-21 00:02:22 UTC (rev 3201) +++ trunk/numpy/core/src/arraymethods.c 2006-09-21 07:58:41 UTC (rev 3202) @@ -887,29 +887,14 @@ array_searchsorted(PyArrayObject *self, PyObject *args, PyObject *kwds) { PyObject *keys; - char *side = "left"; static char *kwlist[] = {"keys", "side", NULL}; - NPY_SEARCHKIND which; + NPY_SEARCHSIDE side = NPY_SEARCHLEFT; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s", kwlist, &keys, &side)) - return NULL; - if (strlen(side) < 1) { - PyErr_SetString(PyExc_ValueError, - "Searchsorted: side must be nonempty string"); - return PY_FAIL; - } + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&", kwlist, &keys, + PyArray_SearchsideConverter, &side)) + return NULL; - if (side[0] == 'l' || side[0] == 'L') - which = NPY_SEARCHLEFT; - else if (side[0] == 'r' || side[0] == 'R') - which = NPY_SEARCHRIGHT; - else { - PyErr_Format(PyExc_ValueError, - "%s is not a valid value of side", side); - return PY_FAIL; - } - - return _ARET(PyArray_SearchSorted(self, keys, which)); + return _ARET(PyArray_SearchSorted(self, keys, side)); } static void Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-21 00:02:22 UTC (rev 3201) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-21 07:58:41 UTC (rev 3202) @@ -2523,33 +2523,28 @@ } -/* local_search_left +/** @brief Use bisection of sorted array to find first entries >= keys. * - * Use bisection to find the indices i into ap1 s.t. + * For each key use bisection to find the first index i s.t. key <= arr[i]. + * When there is no such index i, set i = len(arr). Return the results in ret. + * All arrays are assumed contiguous on entry and both arr and key must be of + * the same comparable type. * - * ap1[j] < key <= ap1[i] for all 0 <= j < i and all keys in ap2, - * - * When there is no such index i, set i = len(ap1). Return the results in ret. All - * arrays are assumed contiguous on entry and both ap1 and ap2 are assumed to - * be of the same comparable type. - * - * Arguments: - * - * ap1 -- array to be searched, contiguous on entry and assumed sorted. - * ap2 -- array of keys, contiguous on entry. - * ret -- return array of intp, contiguous on entry. - * + * @param arr contiguous sorted array to be searched. + * @param key contiguous array of keys. + * @param ret contiguous array of intp for returned indices. + * @return void */ static void -local_search_left(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret) +local_search_left(PyArrayObject *arr, PyArrayObject *key, PyArrayObject *ret) { - PyArray_CompareFunc *compare = ap2->descr->f->compare; - intp nelts = ap1->dimensions[ap1->nd - 1]; - intp nkeys = PyArray_SIZE(ap2); - char *p1 = ap1->data; - char *p2 = ap2->data; - intp *pr = (intp *)ret->data; - int elsize = ap1->descr->elsize; + PyArray_CompareFunc *compare = key->descr->f->compare; + intp nelts = arr->dimensions[arr->nd - 1]; + intp nkeys = PyArray_SIZE(key); + char *parr = arr->data; + char *pkey = key->data; + intp *pret = (intp *)ret->data; + int elsize = arr->descr->elsize; intp i; for(i = 0; i < nkeys; ++i) { @@ -2557,45 +2552,40 @@ intp imax = nelts; while (imin < imax) { intp imid = imin + ((imax - imin) >> 2); - if (compare(p1 + elsize*imid, p2, ap2) < 0) + if (compare(parr + elsize*imid, pkey, key) < 0) imin = imid + 1; else imax = imid; } - *pr = imin; - pr += 1; - p2 += elsize; + *pret = imin; + pret += 1; + pkey += elsize; } } -/* local_search_right +/** @brief Use bisection of sorted array to find first entries > keys. * - * Use bisection to find the indices i into ap1 s.t. + * For each key use bisection to find the first index i s.t. key < arr[i]. + * When there is no such index i, set i = len(arr). Return the results in ret. + * All arrays are assumed contiguous on entry and both arr and key must be of + * the same comparable type. * - * ap1[j] <= key < ap1[i] for all 0 <= j < i and all keys in ap2. - * - * When there is no such index i, set i = len(ap1). Return the results in ret. All - * arrays are assumed contiguous on entry and both ap1 and ap2 are assumed to - * be of the same comparable type. - * - * Arguments: - * - * ap1 -- array to be searched, contiguous on entry and assumed sorted. - * ap2 -- array of keys, contiguous on entry. - * ret -- return array of intp, contiguous on entry. - * + * @param arr contiguous sorted array to be searched. + * @param key contiguous array of keys. + * @param ret contiguous array of intp for returned indices. + * @return void */ static void -local_search_right(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret) +local_search_right(PyArrayObject *arr, PyArrayObject *key, PyArrayObject *ret) { - PyArray_CompareFunc *compare = ap2->descr->f->compare; - intp nelts = ap1->dimensions[ap1->nd - 1]; - intp nkeys = PyArray_SIZE(ap2); - char *p1 = ap1->data; - char *p2 = ap2->data; - intp *pr = (intp *)ret->data; - int elsize = ap1->descr->elsize; + PyArray_CompareFunc *compare = key->descr->f->compare; + intp nelts = arr->dimensions[arr->nd - 1]; + intp nkeys = PyArray_SIZE(key); + char *parr = arr->data; + char *pkey = key->data; + intp *pret = (intp *)ret->data; + int elsize = arr->descr->elsize; intp i; for(i = 0; i < nkeys; ++i) { @@ -2603,22 +2593,52 @@ intp imax = nelts; while (imin < imax) { intp imid = imin + ((imax - imin) >> 2); - if (compare(p1 + elsize*imid, p2, ap2) <= 0) + if (compare(parr + elsize*imid, pkey, key) <= 0) imin = imid + 1; else imax = imid; } - *pr = imin; - pr += 1; - p2 += elsize; + *pret = imin; + pret += 1; + pkey += elsize; } } + /*MULTIARRAY_API + Convert object to searchsorted side +*/ +static int +PyArray_SearchsideConverter(PyObject *obj, NPY_SEARCHSIDE *side) +{ + char *str = PyString_AsString(obj); + + if (!str) + return PY_FAIL; + if (strlen(str) < 1) { + PyErr_SetString(PyExc_ValueError, + "side must be nonempty string"); + return PY_FAIL; + } + + if (str[0] == 'l' || str[0] == 'L') + *side = NPY_SEARCHLEFT; + else if (str[0] == 'r' || str[0] == 'R') + *side = NPY_SEARCHRIGHT; + else { + PyErr_Format(PyExc_ValueError, + "side has invalid value '%s'", str); + return PY_FAIL; + } + return PY_SUCCEED; +} + + +/*MULTIARRAY_API Numeric.searchsorted(a,v) */ static PyObject * -PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2, NPY_SEARCHKIND which) +PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2, NPY_SEARCHSIDE side) { PyArrayObject *ap1=NULL; PyArrayObject *ap2=NULL; @@ -2657,12 +2677,12 @@ goto fail; } - if (which == NPY_SEARCHLEFT) { + if (side == NPY_SEARCHLEFT) { NPY_BEGIN_THREADS_DESCR(ap2->descr) local_search_left(ap1, ap2, ret); NPY_END_THREADS_DESCR(ap2->descr) } - else if (which == NPY_SEARCHRIGHT) { + else if (side == NPY_SEARCHRIGHT) { NPY_BEGIN_THREADS_DESCR(ap2->descr) local_search_right(ap1, ap2, ret); NPY_END_THREADS_DESCR(ap2->descr) From numpy-svn at scipy.org Thu Sep 21 11:51:13 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 21 Sep 2006 10:51:13 -0500 (CDT) Subject: [Numpy-svn] r3203 - trunk/numpy/core/src Message-ID: <20060921155113.DF46A39C03D@new.scipy.org> Author: charris Date: 2006-09-21 10:51:00 -0500 (Thu, 21 Sep 2006) New Revision: 3203 Modified: trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/multiarraymodule.c Log: Small changes of searchsorted error messages. Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-21 07:58:41 UTC (rev 3202) +++ trunk/numpy/core/src/arraymethods.c 2006-09-21 15:51:00 UTC (rev 3203) @@ -886,11 +886,12 @@ static PyObject * array_searchsorted(PyArrayObject *self, PyObject *args, PyObject *kwds) { + static char *kwlist[] = {"keys", "side", NULL}; PyObject *keys; - static char *kwlist[] = {"keys", "side", NULL}; NPY_SEARCHSIDE side = NPY_SEARCHLEFT; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&", kwlist, &keys, + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&:searchsorted", + kwlist, &keys, PyArray_SearchsideConverter, &side)) return NULL; Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-21 07:58:41 UTC (rev 3202) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-21 15:51:00 UTC (rev 3203) @@ -2609,15 +2609,14 @@ Convert object to searchsorted side */ static int -PyArray_SearchsideConverter(PyObject *obj, NPY_SEARCHSIDE *side) +PyArray_SearchsideConverter(PyObject *obj, void *addr) { + NPY_SEARCHSIDE *side = (NPY_SEARCHSIDE *)addr; char *str = PyString_AsString(obj); - if (!str) - return PY_FAIL; - if (strlen(str) < 1) { + if (!str || strlen(str) < 1) { PyErr_SetString(PyExc_ValueError, - "side must be nonempty string"); + "expected nonempty string for keyword 'side'"); return PY_FAIL; } @@ -2627,7 +2626,7 @@ *side = NPY_SEARCHRIGHT; else { PyErr_Format(PyExc_ValueError, - "side has invalid value '%s'", str); + "'%s' is an invalid value for keyword 'side'", str); return PY_FAIL; } return PY_SUCCEED; From numpy-svn at scipy.org Thu Sep 21 12:58:27 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 21 Sep 2006 11:58:27 -0500 (CDT) Subject: [Numpy-svn] r3204 - in trunk/numpy/core: code_generators src Message-ID: <20060921165827.0B65439C036@new.scipy.org> Author: oliphant Date: 2006-09-21 11:58:07 -0500 (Thu, 21 Sep 2006) New Revision: 3204 Modified: trunk/numpy/core/code_generators/generate_umath.py trunk/numpy/core/src/umathmodule.c.src Log: Add Object-type to maximum and minimum ufuncs. Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2006-09-21 15:51:00 UTC (rev 3203) +++ trunk/numpy/core/code_generators/generate_umath.py 2006-09-21 16:58:07 UTC (rev 3204) @@ -261,11 +261,13 @@ Ufunc(2, 1, None, 'returns maximum (if x1 > x2: x1; else: x2) elementwise.', TD(noobj), + TD(O, f='_npy_ObjectMax') ), 'minimum' : Ufunc(2, 1, None, 'returns minimum (if x1 < x2: x1; else: x2) elementwise', TD(noobj), + TD(O, f='_npy_ObjectMin') ), 'bitwise_and' : Ufunc(2, 1, One, Modified: trunk/numpy/core/src/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umathmodule.c.src 2006-09-21 15:51:00 UTC (rev 3203) +++ trunk/numpy/core/src/umathmodule.c.src 2006-09-21 16:58:07 UTC (rev 3204) @@ -1207,7 +1207,6 @@ /**end repeat**/ - static PyObject * Py_reciprocal(PyObject *o) { @@ -1219,6 +1218,40 @@ return result; } +static PyObject * +_npy_ObjectMax(PyObject *i1, PyObject *i2) +{ + int cmp; + PyObject *res; + if (PyObject_Cmp(i1, i2, &cmp) < 0) return NULL; + + if (cmp >= 0) { + res = i1; + } + else { + res = i2; + } + Py_INCREF(res); + return res; +} + +static PyObject * +_npy_ObjectMin(PyObject *i1, PyObject *i2) +{ + int cmp; + PyObject *res; + if (PyObject_Cmp(i1, i2, &cmp) < 0) return NULL; + + if (cmp <= 0) { + res = i1; + } + else { + res = i2; + } + Py_INCREF(res); + return res; +} + /* ones_like is defined here because it's used for x**0 */ /**begin repeat From numpy-svn at scipy.org Fri Sep 22 03:26:18 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Sep 2006 02:26:18 -0500 (CDT) Subject: [Numpy-svn] r3205 - trunk/numpy/lib Message-ID: <20060922072618.3486339C1E6@new.scipy.org> Author: stefan Date: 2006-09-22 02:25:18 -0500 (Fri, 22 Sep 2006) New Revision: 3205 Modified: trunk/numpy/lib/function_base.py Log: Fix docstring for delete. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2006-09-21 16:58:07 UTC (rev 3204) +++ trunk/numpy/lib/function_base.py 2006-09-22 07:25:18 UTC (rev 3205) @@ -1150,11 +1150,11 @@ [1,2,3], [6,7,8]] - >>> deletefrom(arr, 1, 1) + >>> delete(arr, 1, 1) array([[3,5], [1,3], [6,8]) - >>> deletefrom(arr, 1, 0) + >>> delete(arr, 1, 0) array([[3,4,5], [6,7,8]]) """ From numpy-svn at scipy.org Fri Sep 22 04:03:53 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Sep 2006 03:03:53 -0500 (CDT) Subject: [Numpy-svn] r3206 - trunk/numpy/fft Message-ID: <20060922080353.58AB939C1F0@new.scipy.org> Author: stefan Date: 2006-09-22 03:02:11 -0500 (Fri, 22 Sep 2006) New Revision: 3206 Modified: trunk/numpy/fft/fftpack.py Log: Refer to "length of a" instead of "a" in fftpack docstrings. Modified: trunk/numpy/fft/fftpack.py =================================================================== --- trunk/numpy/fft/fftpack.py 2006-09-22 07:25:18 UTC (rev 3205) +++ trunk/numpy/fft/fftpack.py 2006-09-22 08:02:11 UTC (rev 3206) @@ -68,10 +68,10 @@ def fft(a, n=None, axis=-1): """fft(a, n=None, axis=-1) - Will return the n point discrete Fourier transform of a. n defaults to the - length of a. If n is larger than a, then a will be zero-padded to make up - the difference. If n is smaller than a, the first n items in a will be - used. + Return the n point discrete Fourier transform of a. n defaults to + the length of a. If n is larger than the length of a, then a will + be zero-padded to make up the difference. If n is smaller than + the length of a, only the first n items in a will be used. The packing of the result is "standard": If A = fft(a, n), then A[0] contains the zero-frequency term, A[1:n/2+1] contains the @@ -90,10 +90,11 @@ def ifft(a, n=None, axis=-1): """ifft(a, n=None, axis=-1) - Will return the n point inverse discrete Fourier transform of a. n - defaults to the length of a. If n is larger than a, then a will be - zero-padded to make up the difference. If n is smaller than a, then a will - be truncated to reduce its size. + Return the n point inverse discrete Fourier transform of a. n + defaults to the length of a. If n is larger than the length of a, + then a will be zero-padded to make up the difference. If n is + smaller than the length of a, then a will be truncated to reduce + its size. The input array is expected to be packed the same way as the output of fft, as discussed in it's documentation. @@ -115,9 +116,9 @@ def rfft(a, n=None, axis=-1): """rfft(a, n=None, axis=-1) - Will return the n point discrete Fourier transform of the real valued - array a. n defaults to the length of a. n is the length of the input, not - the output. + Return the n point discrete Fourier transform of the real valued + array a. n defaults to the length of a. n is the length of the + input, not the output. The returned array will be the nonnegative frequency terms of the Hermite-symmetric, complex transform of the real array. So for an 8-point @@ -136,11 +137,11 @@ def irfft(a, n=None, axis=-1): """irfft(a, n=None, axis=-1) - Will return the real valued n point inverse discrete Fourier transform of - a, where a contains the nonnegative frequency terms of a Hermite-symmetric - sequence. n is the length of the result, not the input. If n is not - supplied, the default is 2*(len(a)-1). If you want the length of the - result to be odd, you have to say so. + Return the real valued n point inverse discrete Fourier transform + of a, where a contains the nonnegative frequency terms of a + Hermite-symmetric sequence. n is the length of the result, not the + input. If n is not supplied, the default is 2*(len(a)-1). If you + want the length of the result to be odd, you have to say so. If you specify an n such that a must be zero-padded or truncated, the extra/removed values will be added/removed at high frequencies. One can From numpy-svn at scipy.org Fri Sep 22 15:42:53 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Sep 2006 14:42:53 -0500 (CDT) Subject: [Numpy-svn] r3207 - in trunk/numpy: . core core/src lib oldnumeric Message-ID: <20060922194253.428B939C04C@new.scipy.org> Author: oliphant Date: 2006-09-22 14:42:43 -0500 (Fri, 22 Sep 2006) New Revision: 3207 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/fromnumeric.py trunk/numpy/core/numeric.py trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/multiarraymodule.c trunk/numpy/core/src/scalartypes.inc.src trunk/numpy/lib/shape_base.py trunk/numpy/oldnumeric/misc.py Log: Switch order of .put arguments to match the function call. Eliminate .putmask as a method and make it only a function. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/add_newdocs.py 2006-09-22 19:42:43 UTC (rev 3207) @@ -878,20 +878,19 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('put', - """a.put(values, indices, mode) sets a.flat[n] = values[n] for - each n in indices. v can be scalar or shorter than indices, and - it will repeat. - + """a.put(indices, values, mode) sets a.flat[n] = values[n] for + each n in indices. If values is shorter than indices then it + will repeat. """)) -add_newdoc('numpy.core.multiarray', 'ndarray', ('putmask', - """a.putmask(values, mask) sets a.flat[n] = v[n] for each n where - mask.flat[n] is true. v can be scalar. +add_newdoc('numpy.core.multiarray', 'putmask', + """putmask(a, mask, values) sets a.flat[n] = values[n] for each n where + mask.flat[n] is true. If values is not the same size of a and mask then + it will repeat. This gives different behavior than a[mask] = values. + """) - """)) - add_newdoc('numpy.core.multiarray', 'ndarray', ('ravel', """a.ravel([fortran]) return a 1-d array (copy only if needed) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/core/fromnumeric.py 2006-09-22 19:42:43 UTC (rev 3207) @@ -1,7 +1,7 @@ # Module containing non-deprecated functions borrowed from Numeric. # functions that are now methods -__all__ = ['take', 'reshape', 'choose', 'repeat', 'put', 'putmask', +__all__ = ['take', 'reshape', 'choose', 'repeat', 'put', 'swapaxes', 'transpose', 'sort', 'argsort', 'argmax', 'argmin', 'searchsorted', 'alen', 'resize', 'diagonal', 'trace', 'ravel', 'nonzero', 'shape', @@ -94,15 +94,8 @@ for i in ind: a.flat[i] = v[i] a must be a contiguous numpy array. """ - return a.put(v,ind, mode) + return a.put(ind, v, mode) -def putmask (a, mask, v): - """putmask(a, mask, v) results in a = v for all places mask is true. - If v is shorter than mask it will be repeated as necessary. - In particular v can be a scalar or length 1 array. - """ - return a.putmask(v, mask) - def swapaxes(a, axis1, axis2): """swapaxes(a, axis1, axis2) returns array a with axis1 and axis2 interchanged. Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/core/numeric.py 2006-09-22 19:42:43 UTC (rev 3207) @@ -14,7 +14,7 @@ 'fromiter', 'array_equal', 'array_equiv', 'indices', 'fromfunction', 'load', 'loads', 'isscalar', 'binary_repr', 'base_repr', - 'ones', 'identity', 'allclose', 'compare_chararrays', + 'ones', 'identity', 'allclose', 'compare_chararrays', 'putmask', 'seterr', 'geterr', 'setbufsize', 'getbufsize', 'seterrcall', 'geterrcall', 'flatnonzero', 'Inf', 'inf', 'infty', 'Infinity', @@ -120,8 +120,8 @@ can_cast = multiarray.can_cast lexsort = multiarray.lexsort compare_chararrays = multiarray.compare_chararrays +putmask = multiarray.putmask - def asarray(a, dtype=None, order=None): """Returns a as an array. Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/core/src/arraymethods.c 2006-09-22 19:42:43 UTC (rev 3207) @@ -40,10 +40,10 @@ { PyObject *indices, *values; NPY_CLIPMODE mode=NPY_RAISE; - static char *kwlist[] = {"values", "indices", "mode", NULL}; + static char *kwlist[] = {"indices", "values", "mode", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|O&", kwlist, - &values, &indices, + &indices, &values, PyArray_ClipmodeConverter, &mode)) return NULL; @@ -51,19 +51,6 @@ } static PyObject * -array_putmask(PyArrayObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *mask, *values; - - static char *kwlist[] = {"values", "mask", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO", kwlist, - &values, &mask)) - return NULL; - return PyArray_PutMask(self, values, mask); -} - -static PyObject * array_reshape(PyArrayObject *self, PyObject *args, PyObject *kwds) { PyArray_Dims newshape; @@ -1827,8 +1814,6 @@ METH_VARARGS | METH_KEYWORDS, NULL}, {"put", (PyCFunction)array_put, METH_VARARGS | METH_KEYWORDS, NULL}, - {"putmask", (PyCFunction)array_putmask, - METH_VARARGS | METH_KEYWORDS, NULL}, {"ravel", (PyCFunction)array_ravel, METH_VARARGS, NULL}, {"repeat", (PyCFunction)array_repeat, Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-22 19:42:43 UTC (rev 3207) @@ -3648,6 +3648,22 @@ return NULL; } +static PyObject * +array_putmask(PyObject *module, PyObject *args, PyObject *kwds) +{ + PyObject *mask, *values; + PyObject *array; + + static char *kwlist[] = {"arr", "mask", "values", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!OO:putmask", kwlist, + &PyArray_Type, + &array, &mask, &values)) + return NULL; + + return PyArray_PutMask(array, values, mask); +} + /*MULTIARRAY_API Put values into an array according to a mask. */ @@ -6687,6 +6703,8 @@ METH_VARARGS, NULL}, {"lexsort", (PyCFunction)array_lexsort, METH_VARARGS | METH_KEYWORDS, NULL}, + {"putmask", (PyCFunction)array_putmask, + METH_VARARGS | METH_KEYWORDS, NULL}, {"fromstring",(PyCFunction)array_fromString, METH_VARARGS|METH_KEYWORDS, NULL}, {"fromiter",(PyCFunction)array_fromIter, Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/core/src/scalartypes.inc.src 2006-09-22 19:42:43 UTC (rev 3207) @@ -1122,7 +1122,7 @@ /**begin repeat -#name=take, getfield, put, putmask, repeat, tofile, mean, trace, diagonal, clip, std, var, sum, cumsum, prod, cumprod, compress, sort, argsort, round, argmax, argmin, max, min, ptp, any, all, resize, reshape, choose# +#name=take, getfield, put, repeat, tofile, mean, trace, diagonal, clip, std, var, sum, cumsum, prod, cumprod, compress, sort, argsort, round, argmax, argmin, max, min, ptp, any, all, resize, reshape, choose# */ static PyObject * @@ -1331,8 +1331,6 @@ METH_VARARGS|METH_KEYWORDS, NULL}, {"put", (PyCFunction)gentype_put, METH_VARARGS|METH_KEYWORDS, NULL}, - {"putmask", (PyCFunction)gentype_putmask, - METH_VARARGS|METH_KEYWORDS, NULL}, {"repeat", (PyCFunction)gentype_repeat, METH_VARARGS|METH_KEYWORDS, NULL}, {"choose", (PyCFunction)gentype_choose, Modified: trunk/numpy/lib/shape_base.py =================================================================== --- trunk/numpy/lib/shape_base.py 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/lib/shape_base.py 2006-09-22 19:42:43 UTC (rev 3207) @@ -26,7 +26,7 @@ indlist.remove(axis) i[axis] = slice(None,None) outshape = asarray(arr.shape).take(indlist) - i.put(ind, indlist) + i.put(indlist, ind) res = func1d(arr[tuple(i.tolist())],*args) # if res is a number, then we have a smaller output array if isscalar(res): @@ -42,7 +42,7 @@ ind[n-1] += 1 ind[n] = 0 n -= 1 - i.put(ind,indlist) + i.put(indlist,ind) res = func1d(arr[tuple(i.tolist())],*args) outarr[ind] = res k += 1 @@ -63,7 +63,7 @@ ind[n-1] += 1 ind[n] = 0 n -= 1 - i.put(ind, indlist) + i.put(indlist, ind) res = func1d(arr[tuple(i.tolist())],*args) outarr[tuple(i.tolist())] = res k += 1 Modified: trunk/numpy/oldnumeric/misc.py =================================================================== --- trunk/numpy/oldnumeric/misc.py 2006-09-22 08:02:11 UTC (rev 3206) +++ trunk/numpy/oldnumeric/misc.py 2006-09-22 19:42:43 UTC (rev 3207) @@ -1,12 +1,12 @@ # Functions that already have the correct syntax or miscellaneous functions -__all__ = ['load', 'sort', 'copy_reg', 'clip', 'putmask', 'Unpickler', 'rank', +__all__ = ['load', 'sort', 'copy_reg', 'clip', 'Unpickler', 'rank', 'sign', 'shape', 'types', 'allclose', 'size', 'choose', 'swapaxes', 'array_str', - 'pi', 'math', 'concatenate', + 'pi', 'math', 'concatenate', 'putmask', 'put', 'around', 'vdot', 'transpose', 'array2string', 'diagonal', - 'searchsorted', 'put', 'fromfunction', 'copy', 'resize', + 'searchsorted', 'fromfunction', 'copy', 'resize', 'array_repr', 'e', 'StringIO', 'pickle', 'argsort', 'convolve', 'loads', 'cross_correlate', 'Pickler', 'dot', 'outerproduct', 'innerproduct', 'insert'] @@ -19,10 +19,10 @@ import copy_reg from pickle import load, loads -from numpy import sort, clip, putmask, rank, sign, shape, allclose, size,\ - choose, swapaxes, array_str, array_repr, e, pi, \ +from numpy import sort, clip, rank, sign, shape, putmask, allclose, size,\ + choose, swapaxes, array_str, array_repr, e, pi, put, \ fromfunction, resize, around, concatenate, vdot, transpose, \ - diagonal, searchsorted, put, argsort, convolve, dot, \ + diagonal, searchsorted, argsort, convolve, dot, \ outer as outerproduct, inner as innerproduct, correlate as cross_correlate, \ place as insert From numpy-svn at scipy.org Fri Sep 22 23:32:18 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Sep 2006 22:32:18 -0500 (CDT) Subject: [Numpy-svn] r3208 - trunk/numpy/core/src Message-ID: <20060923033218.3E65D39C00B@new.scipy.org> Author: oliphant Date: 2006-09-22 22:32:14 -0500 (Fri, 22 Sep 2006) New Revision: 3208 Modified: trunk/numpy/core/src/arraymethods.c Log: Fix .take() default-axis argument bug. Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-22 19:42:43 UTC (rev 3207) +++ trunk/numpy/core/src/arraymethods.c 2006-09-23 03:32:14 UTC (rev 3208) @@ -11,7 +11,6 @@ NPY_CLIPMODE mode=NPY_RAISE; static char *kwlist[] = {"indices", "axis", "out", "mode", NULL}; - dimension=0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&O&O&", kwlist, &indices, PyArray_AxisConverter, &dimension, From numpy-svn at scipy.org Fri Sep 22 23:47:31 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Sep 2006 22:47:31 -0500 (CDT) Subject: [Numpy-svn] r3209 - trunk/numpy/core/include/numpy Message-ID: <20060923034731.B514239C00B@new.scipy.org> Author: oliphant Date: 2006-09-22 22:47:27 -0500 (Fri, 22 Sep 2006) New Revision: 3209 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: Fix the Python2.5-compatibility macros so that conflicts with other libraries are avoided. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-23 03:32:14 UTC (rev 3208) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-23 03:47:27 UTC (rev 3209) @@ -639,11 +639,18 @@ #define NPY_SIZEOF_INTP SIZEOF_PY_INTPTR_T #define NPY_SIZEOF_UINTP SIZEOF_PY_INTPTR_T +#ifdef constchar +#undef constchar +#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 + #ifndef PY_SSIZE_T_MIN + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #endif #define NPY_SSIZE_T_PYFMT "i" +#undef PyIndex_Check #define constchar const char #define PyIndex_Check(op) 0 #else From numpy-svn at scipy.org Sat Sep 23 00:45:16 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Sep 2006 23:45:16 -0500 (CDT) Subject: [Numpy-svn] r3210 - trunk/numpy/core/tests Message-ID: <20060923044516.CE91A39C00B@new.scipy.org> Author: oliphant Date: 2006-09-22 23:45:08 -0500 (Fri, 22 Sep 2006) New Revision: 3210 Modified: trunk/numpy/core/tests/test_regression.py Log: Add test for default axis in method and functions. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-23 03:47:27 UTC (rev 3209) +++ trunk/numpy/core/tests/test_regression.py 2006-09-23 04:45:08 UTC (rev 3210) @@ -411,6 +411,45 @@ x = N.array((1,2), dtype=dt) x = x.byteswap() assert(x['one'] > 1 and x['two'] > 2) + + def check_method_args(self, level=rlevel): + # Make sure methods and functions have same default axis + # keyword and arguments + funcs1= ['argmax', 'argmin', 'sum', ('product', 'prod'), + ('sometrue', 'any'), + ('alltrue', 'all'), 'cumsum', ('cumproduct', 'cumprod'), + 'ptp', 'cumprod', 'prod', 'std', 'var', 'mean', + 'round', 'min', 'max', 'argsort', 'sort'] + funcs2 = ['compress', 'take', 'repeat'] + for func in funcs1: + arr = N.random.rand(8,7) + arr2 = arr.copy() + if isinstance(func, tuple): + func_meth = func[1] + func = func[0] + else: + func_meth = func + res1 = getattr(arr, func_meth)() + res2 = getattr(N, func)(arr2) + if res1 is None: + assert abs(arr-res2).max() < 1e-8, func + else: + assert abs(res1-res2).max() < 1e-8, func + + for func in funcs2: + arr1 = N.random.rand(8,7) + arr2 = N.random.rand(8,7) + res1 = None + if func == 'compress': + arr1 = arr1.ravel() + res1 = getattr(arr2, func)(arr1) + else: + arr2 = (15*arr2).astype(int).ravel() + if res1 is None: + res1 = getattr(arr1, func)(arr2) + res2 = getattr(N, func)(arr1, arr2) + assert abs(res1-res2).max() < 1e-8, func + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Sat Sep 23 13:59:21 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Sep 2006 12:59:21 -0500 (CDT) Subject: [Numpy-svn] r3211 - trunk/numpy/lib Message-ID: <20060923175921.B4CF239C03E@new.scipy.org> Author: oliphant Date: 2006-09-23 12:59:06 -0500 (Sat, 23 Sep 2006) New Revision: 3211 Modified: trunk/numpy/lib/shape_base.py Log: Fix for #291 Modified: trunk/numpy/lib/shape_base.py =================================================================== --- trunk/numpy/lib/shape_base.py 2006-09-23 04:45:08 UTC (rev 3210) +++ trunk/numpy/lib/shape_base.py 2006-09-23 17:59:06 UTC (rev 3211) @@ -530,7 +530,7 @@ def repmat(a, m, n): """Repeat a 0-d to 2-d array mxn times """ - a = asarray(a) + a = asanyarray(a) ndim = a.ndim if ndim == 0: origrows, origcols = (1,1) From numpy-svn at scipy.org Sat Sep 23 14:04:32 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Sep 2006 13:04:32 -0500 (CDT) Subject: [Numpy-svn] r3212 - trunk/numpy/core/src Message-ID: <20060923180432.9B0A839C03E@new.scipy.org> Author: oliphant Date: 2006-09-23 13:04:13 -0500 (Sat, 23 Sep 2006) New Revision: 3212 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix Ticket #288 Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-23 17:59:06 UTC (rev 3211) +++ trunk/numpy/core/src/arrayobject.c 2006-09-23 18:04:13 UTC (rev 3212) @@ -3916,7 +3916,7 @@ char *data; if (self->nd == 0) { - PyErr_SetString(PyExc_ValueError, "cannot slice a scalar"); + PyErr_SetString(PyExc_ValueError, "cannot slice a 0-d array"); return NULL; } @@ -5811,7 +5811,7 @@ { if (arr->nd == 0) { PyErr_SetString(PyExc_TypeError, - "iteration over a scalar (0-dim array)"); + "iteration over a 0-d array"); return NULL; } return PySeqIter_New((PyObject *)arr); From numpy-svn at scipy.org Sat Sep 23 14:36:03 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Sep 2006 13:36:03 -0500 (CDT) Subject: [Numpy-svn] r3213 - in trunk/numpy/core: . src Message-ID: <20060923183603.3C01039C03E@new.scipy.org> Author: oliphant Date: 2006-09-23 13:35:46 -0500 (Sat, 23 Sep 2006) New Revision: 3213 Modified: trunk/numpy/core/numeric.py trunk/numpy/core/src/arrayobject.c Log: Fix ticket #289 plus improve the way array data-types print and arrays represent themselves. Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2006-09-23 18:04:13 UTC (rev 3212) +++ trunk/numpy/core/numeric.py 2006-09-23 18:35:46 UTC (rev 3213) @@ -427,7 +427,7 @@ if issubclass(arr.dtype.type, flexible): typename = str(arr.dtype) lf = '\n'+' '*len("array(") - return cName + "(%s, %sdtype=%s)" % (lst, lf, typename) + return cName + "(%s, %sdtype='%s')" % (lst, lf, typename) def array_str(a, max_line_width=None, precision=None, suppress_small=None): return array2string(a, max_line_width, precision, suppress_small, ' ', "", str) Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-23 18:04:13 UTC (rev 3212) +++ trunk/numpy/core/src/arrayobject.c 2006-09-23 18:35:46 UTC (rev 3213) @@ -7739,6 +7739,12 @@ if (newtype == NULL) {newtype = oldtype; Py_INCREF(oldtype);} type = newtype->type_num; itemsize = newtype->elsize; + if (itemsize == 0) { + PyArray_DESCR_REPLACE(newtype); + if (newtype == NULL) return NULL; + newtype->elsize = oldtype->elsize; + itemsize = newtype->elsize; + } /* Don't copy if sizes are compatible */ if ((flags & ENSURECOPY) || PyArray_EquivTypes(oldtype, newtype)) { @@ -11126,13 +11132,11 @@ PyString_ConcatAndDel(&t, PyString_FromString(")")); sub = t; } + else if (PyDataType_ISFLEXIBLE(self) || !PyArray_ISNBO(self->byteorder)) { + sub = arraydescr_protocol_typestr_get(self); + } else { - if (!PyArray_ISNBO(self->byteorder)) { - sub = arraydescr_protocol_typestr_get(self); - } - else { - sub = arraydescr_typename_get(self); - } + sub = arraydescr_typename_get(self); } return sub; } From numpy-svn at scipy.org Sun Sep 24 03:08:59 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Sep 2006 02:08:59 -0500 (CDT) Subject: [Numpy-svn] r3214 - trunk/numpy/lib/tests Message-ID: <20060924070859.36DA739C023@new.scipy.org> Author: oliphant Date: 2006-09-24 02:08:26 -0500 (Sun, 24 Sep 2006) New Revision: 3214 Modified: trunk/numpy/lib/tests/test_ufunclike.py Log: Fix doctests for new dtype Modified: trunk/numpy/lib/tests/test_ufunclike.py =================================================================== --- trunk/numpy/lib/tests/test_ufunclike.py 2006-09-23 18:35:46 UTC (rev 3213) +++ trunk/numpy/lib/tests/test_ufunclike.py 2006-09-24 07:08:26 UTC (rev 3214) @@ -18,26 +18,26 @@ Test isposinf, isneginf, sign >>> a = nx.array([nx.Inf, -nx.Inf, nx.NaN, 0.0, 3.0, -3.0]) >>> U.isposinf(a) -array([True, False, False, False, False, False], dtype=bool) +array([True, False, False, False, False, False], dtype='bool') >>> U.isneginf(a) -array([False, True, False, False, False, False], dtype=bool) +array([False, True, False, False, False, False], dtype='bool') >>> nx.sign(a) array([ 1., -1., 0., 0., 1., -1.]) Same thing with an output array: >>> y = nx.zeros(a.shape, bool) >>> U.isposinf(a, y) -array([True, False, False, False, False, False], dtype=bool) +array([True, False, False, False, False, False], dtype='bool') >>> y -array([True, False, False, False, False, False], dtype=bool) +array([True, False, False, False, False, False], dtype='bool') >>> U.isneginf(a, y) -array([False, True, False, False, False, False], dtype=bool) +array([False, True, False, False, False, False], dtype='bool') >>> y -array([False, True, False, False, False, False], dtype=bool) +array([False, True, False, False, False, False], dtype='bool') >>> nx.sign(a, y) -array([True, True, False, False, True, True], dtype=bool) +array([True, True, False, False, True, True], dtype='bool') >>> y -array([True, True, False, False, True, True], dtype=bool) +array([True, True, False, False, True, True], dtype='bool') Now log2: >>> a = nx.array([4.5, 2.3, 6.5]) From numpy-svn at scipy.org Mon Sep 25 12:27:20 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Sep 2006 11:27:20 -0500 (CDT) Subject: [Numpy-svn] r3215 - in trunk/numpy: core lib/tests Message-ID: <20060925162720.A98CF39C089@new.scipy.org> Author: oliphant Date: 2006-09-25 11:26:43 -0500 (Mon, 25 Sep 2006) New Revision: 3215 Modified: trunk/numpy/core/numeric.py trunk/numpy/lib/tests/test_ufunclike.py Log: Fix back repr of arrays to not have quote unless flexible. Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2006-09-24 07:08:26 UTC (rev 3214) +++ trunk/numpy/core/numeric.py 2006-09-25 16:26:43 UTC (rev 3215) @@ -425,9 +425,9 @@ typename=arr.dtype.name lf = '' if issubclass(arr.dtype.type, flexible): - typename = str(arr.dtype) + typename = "'%s'" % str(arr.dtype) lf = '\n'+' '*len("array(") - return cName + "(%s, %sdtype='%s')" % (lst, lf, typename) + return cName + "(%s, %sdtype=%s)" % (lst, lf, typename) def array_str(a, max_line_width=None, precision=None, suppress_small=None): return array2string(a, max_line_width, precision, suppress_small, ' ', "", str) Modified: trunk/numpy/lib/tests/test_ufunclike.py =================================================================== --- trunk/numpy/lib/tests/test_ufunclike.py 2006-09-24 07:08:26 UTC (rev 3214) +++ trunk/numpy/lib/tests/test_ufunclike.py 2006-09-25 16:26:43 UTC (rev 3215) @@ -18,26 +18,26 @@ Test isposinf, isneginf, sign >>> a = nx.array([nx.Inf, -nx.Inf, nx.NaN, 0.0, 3.0, -3.0]) >>> U.isposinf(a) -array([True, False, False, False, False, False], dtype='bool') +array([True, False, False, False, False, False], dtype=bool) >>> U.isneginf(a) -array([False, True, False, False, False, False], dtype='bool') +array([False, True, False, False, False, False], dtype=bool) >>> nx.sign(a) array([ 1., -1., 0., 0., 1., -1.]) Same thing with an output array: >>> y = nx.zeros(a.shape, bool) >>> U.isposinf(a, y) -array([True, False, False, False, False, False], dtype='bool') +array([True, False, False, False, False, False], dtype=bool) >>> y -array([True, False, False, False, False, False], dtype='bool') +array([True, False, False, False, False, False], dtype=bool) >>> U.isneginf(a, y) -array([False, True, False, False, False, False], dtype='bool') +array([False, True, False, False, False, False], dtype=bool) >>> y -array([False, True, False, False, False, False], dtype='bool') +array([False, True, False, False, False, False], dtype=bool) >>> nx.sign(a, y) -array([True, True, False, False, True, True], dtype='bool') +array([True, True, False, False, True, True], dtype=bool) >>> y -array([True, True, False, False, True, True], dtype='bool') +array([True, True, False, False, True, True], dtype=bool) Now log2: >>> a = nx.array([4.5, 2.3, 6.5]) From numpy-svn at scipy.org Mon Sep 25 13:52:04 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Sep 2006 12:52:04 -0500 (CDT) Subject: [Numpy-svn] r3216 - trunk/numpy/oldnumeric Message-ID: <20060925175204.2EDDA39C039@new.scipy.org> Author: oliphant Date: 2006-09-25 12:51:52 -0500 (Mon, 25 Sep 2006) New Revision: 3216 Modified: trunk/numpy/oldnumeric/typeconv.py Log: Add oldtypecodes to oldnumeric.typeconv so that old Numeric character codes can be identified. Modified: trunk/numpy/oldnumeric/typeconv.py =================================================================== --- trunk/numpy/oldnumeric/typeconv.py 2006-09-25 16:26:43 UTC (rev 3215) +++ trunk/numpy/oldnumeric/typeconv.py 2006-09-25 17:51:52 UTC (rev 3216) @@ -1,5 +1,5 @@ -__all__ = ['oldtype2dtype', 'convtypecode', 'convtypecode2'] +__all__ = ['oldtype2dtype', 'convtypecode', 'convtypecode2', 'oldtypecodes'] import numpy as N @@ -42,3 +42,20 @@ return N.dtype(typecode) else: return dtype + +_changedtypes = {'B': 'b', + 'b': '1', + 'h': 's', + 'H': 'w', + 'I': 'u'} + +class _oldtypecodes(dict): + def __getitem__(self, obj): + char = N.dtype(obj).char + try: + return _changedtypes[char] + except KeyError: + return char + + +oldtypecodes = _oldtypecodes() From numpy-svn at scipy.org Tue Sep 26 07:20:39 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Sep 2006 06:20:39 -0500 (CDT) Subject: [Numpy-svn] r3217 - trunk/numpy Message-ID: <20060926112039.BA56639C070@new.scipy.org> Author: stefan Date: 2006-09-26 06:20:17 -0500 (Tue, 26 Sep 2006) New Revision: 3217 Modified: trunk/numpy/ctypeslib.py Log: Draft documentation for ndpointer. Modified: trunk/numpy/ctypeslib.py =================================================================== --- trunk/numpy/ctypeslib.py 2006-09-25 17:51:52 UTC (rev 3216) +++ trunk/numpy/ctypeslib.py 2006-09-26 11:20:17 UTC (rev 3217) @@ -80,6 +80,29 @@ # use with ctypes argtypes mechanism _pointer_type_cache = {} def ndpointer(dtype=None, ndim=None, shape=None, flags=None): + """Array-checking restype/argtypes. + + An ndpointer instance is used to describe an ndarray in restypes + and argtypes specifications. This approach is more flexible than + using, for example, + + POINTER(c_double) + + since several restrictions can be specified, which are verified + upon calling the ctypes function. These include data type + (dtype), number of dimensions (ndim), shape and flags (e.g. + 'CONTIGUOUS' or 'FORTRAN'). If a given array does not satisfy the + specified restrictions, a TypeError is raised. + + Example: + + clib.somefunc.argtypes = [ndpointer(dtype=float64, + ndim=1, + flags='CONTIGUOUS')] + clib.somefunc(array([1,2,3],dtype=float64)) + + """ + if dtype is not None: dtype = _dtype(dtype) num = None From numpy-svn at scipy.org Tue Sep 26 13:01:30 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Sep 2006 12:01:30 -0500 (CDT) Subject: [Numpy-svn] r3218 - trunk/numpy/lib Message-ID: <20060926170130.9ABDE39C17E@new.scipy.org> Author: stefan Date: 2006-09-26 12:01:15 -0500 (Tue, 26 Sep 2006) New Revision: 3218 Modified: trunk/numpy/lib/function_base.py Log: Sort only once in median. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2006-09-26 11:20:17 UTC (rev 3217) +++ trunk/numpy/lib/function_base.py 2006-09-26 17:01:15 UTC (rev 3218) @@ -1046,11 +1046,10 @@ """median(m) returns a median of m along the first dimension of m. """ sorted = msort(m) + index = int(sorted.shape[0]/2) if sorted.shape[0] % 2 == 1: - return sorted[int(sorted.shape[0]/2)] + return sorted[index] else: - sorted = msort(m) - index = sorted.shape[0]/2 return (sorted[index-1]+sorted[index])/2.0 def trapz(y, x=None, dx=1.0, axis=-1): From numpy-svn at scipy.org Tue Sep 26 18:39:36 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Sep 2006 17:39:36 -0500 (CDT) Subject: [Numpy-svn] r3219 - trunk/numpy/core/src Message-ID: <20060926223936.AD82939C06C@new.scipy.org> Author: oliphant Date: 2006-09-26 17:39:14 -0500 (Tue, 26 Sep 2006) New Revision: 3219 Modified: trunk/numpy/core/src/arraytypes.inc.src trunk/numpy/core/src/multiarraymodule.c trunk/numpy/core/src/scalartypes.inc.src Log: Allow scalars to be constructed with default values of 0. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2006-09-26 17:01:15 UTC (rev 3218) +++ trunk/numpy/core/src/arraytypes.inc.src 2006-09-26 22:39:14 UTC (rev 3219) @@ -341,7 +341,7 @@ static PyObject * OBJECT_getitem(char *ip, PyArrayObject *ap) { - if (PyArray_ISALIGNED(ap)) { + if (!ap || PyArray_ISALIGNED(ap)) { Py_INCREF(*(PyObject **)ip); return *(PyObject **)ip; } @@ -358,7 +358,7 @@ OBJECT_setitem(PyObject *op, char *ov, PyArrayObject *ap) { Py_INCREF(op); - if (PyArray_ISALIGNED(ap)) { + if (!ap || PyArray_ISALIGNED(ap)) { Py_XDECREF(*(PyObject **)ov); *(PyObject **)ov = op; } Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-26 17:01:15 UTC (rev 3218) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-26 22:39:14 UTC (rev 3219) @@ -3661,7 +3661,7 @@ &array, &mask, &values)) return NULL; - return PyArray_PutMask(array, values, mask); + return PyArray_PutMask((PyArrayObject *)array, values, mask); } /*MULTIARRAY_API Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2006-09-26 17:01:15 UTC (rev 3218) +++ trunk/numpy/core/src/scalartypes.inc.src 2006-09-26 22:39:14 UTC (rev 3219) @@ -1707,6 +1707,7 @@ #name=byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, object# #TYPE=BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, OBJECT# #work=0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,1# +#default=0*16,1*2,2# */ static PyObject * @name at _arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) @@ -1717,9 +1718,26 @@ _WORK at work@ - if (!PyArg_ParseTuple(args, "O", &obj)) return NULL; + if (!PyArg_ParseTuple(args, "|O", &obj)) return NULL; typecode = PyArray_DescrFromType(PyArray_ at TYPE@); + if (obj == NULL) { +#if @default@ == 0 + char *mem; + PyObject *obj; + mem = malloc(sizeof(@name@)); + memset(mem, 0, sizeof(@name@)); + obj = PyArray_Scalar(mem, typecode, NULL); + free(mem); + return obj; +#elif @default@ == 1 + return PyArray_Scalar(NULL, typecode, NULL); +#elif @default@ == 2 + PyObject *obj = Py_None; + return PyArray_Scalar(&obj, typecode, NULL); +#endif + } + arr = PyArray_FromAny(obj, typecode, 0, 0, FORCECAST, NULL); return PyArray_Return((PyArrayObject *)arr); } @@ -1737,7 +1755,9 @@ PyObject *obj=NULL; PyObject *arr; - if (!PyArg_ParseTuple(args, "O", &obj)) return NULL; + if (!PyArg_ParseTuple(args, "|O", &obj)) return NULL; + if (obj == NULL) + PyArrayScalar_RETURN_FALSE; if (obj == Py_False) PyArrayScalar_RETURN_FALSE; if (obj == Py_True) From numpy-svn at scipy.org Wed Sep 27 13:01:46 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Sep 2006 12:01:46 -0500 (CDT) Subject: [Numpy-svn] r3220 - trunk/numpy/core Message-ID: <20060927170146.5788039C0B5@new.scipy.org> Author: oliphant Date: 2006-09-27 12:01:35 -0500 (Wed, 27 Sep 2006) New Revision: 3220 Modified: trunk/numpy/core/numerictypes.py Log: Fix so that 'i4' and 'int32' are allways inserted into sctypeDict together. Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2006-09-26 22:39:14 UTC (rev 3219) +++ trunk/numpy/core/numerictypes.py 2006-09-27 17:01:35 UTC (rev 3220) @@ -171,7 +171,7 @@ typeobj = typeinfo[a][-1] # insert bit-width version for this class (if relevant) base, bit, char = bitname(typeobj) - if base[-3:] == 'int': continue + if base[-3:] == 'int' or char[0] in 'ui': continue if base != '': myname = "%s%d" % (base, bit) if (name != 'longdouble' and name != 'clongdouble') or \ @@ -209,6 +209,8 @@ for ctype in _ctypes: val = typeinfo[ctype] bits = val[2] + charname = 'i%d' % (bits/8,) + ucharname = 'u%d' % (bits/8,) intname = 'int%d' % bits UIntname = 'UInt%d' % bits Intname = 'Int%d' % bits @@ -223,6 +225,8 @@ sctypeDict[uintname] = utypeobj sctypeDict[Intname] = typeobj sctypeDict[UIntname] = utypeobj + sctypeDict[charname] = typeobj + sctypeDict[ucharname] = utypeobj sctypeNA[Intname] = typeobj sctypeNA[UIntname] = utypeobj sctypeNA[typeobj] = Intname From numpy-svn at scipy.org Wed Sep 27 13:40:35 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Sep 2006 12:40:35 -0500 (CDT) Subject: [Numpy-svn] r3221 - trunk/numpy/core/src Message-ID: <20060927174035.4BF2439C034@new.scipy.org> Author: oliphant Date: 2006-09-27 12:40:14 -0500 (Wed, 27 Sep 2006) New Revision: 3221 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Fix setting string and unicode arrays so that non-string sequences are not allowed. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2006-09-27 17:01:35 UTC (rev 3220) +++ trunk/numpy/core/src/arraytypes.inc.src 2006-09-27 17:40:14 UTC (rev 3221) @@ -92,7 +92,14 @@ else { temp = (@typ@)@func2@(op); } - if (PyErr_Occurred()) return -1; + if (PyErr_Occurred()) { + if (PySequence_Check(op)) { + PyErr_Clear(); + PyErr_SetString(PyExc_TypeError, "setting an array"\ + " element with a sequence."); + } + return -1; + } if (ap == NULL || PyArray_ISBEHAVED(ap)) *((@typ@ *)ov)=temp; else { @@ -265,6 +272,13 @@ char *buffer; #endif + if (!PyString_Check(op) && !PyUnicode_Check(op) && + PySequence_Check(op)) { + PyErr_SetString(PyExc_TypeError, + "setting an array element with a sequence"); + return -1; + } + if ((temp=PyObject_Unicode(op)) == NULL) return -1; ptr = PyUnicode_AS_UNICODE(temp); if ((ptr == NULL) || (PyErr_Occurred())) { @@ -320,9 +334,15 @@ { char *ptr; int len; - PyObject *temp=PyObject_Str(op); + PyObject *temp=NULL; - if (temp == NULL) return -1; + if (!PyString_Check(op) && !PyUnicode_Check(op) && + PySequence_Check(op)) { + PyErr_SetString(PyExc_TypeError, + "setting an array element with a sequence"); + return -1; + } + if ((temp = PyObject_Str(op)) == NULL) return -1; if (PyString_AsStringAndSize(temp, &ptr, &len) == -1) { Py_DECREF(temp); From numpy-svn at scipy.org Wed Sep 27 18:46:33 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Sep 2006 17:46:33 -0500 (CDT) Subject: [Numpy-svn] r3222 - trunk/numpy/core Message-ID: <20060927224633.60A4939C00C@new.scipy.org> Author: oliphant Date: 2006-09-27 17:46:11 -0500 (Wed, 27 Sep 2006) New Revision: 3222 Modified: trunk/numpy/core/arrayprint.py Log: Add quotes to printing strings. Modified: trunk/numpy/core/arrayprint.py =================================================================== --- trunk/numpy/core/arrayprint.py 2006-09-27 17:40:14 UTC (rev 3221) +++ trunk/numpy/core/arrayprint.py 2006-09-27 22:46:11 UTC (rev 3222) @@ -169,7 +169,8 @@ data.imag, precision, suppress_small, sign=1) format_function = lambda x: \ _formatComplex(x, real_format, imag_format) - elif issubclass(dtype, _nt.unicode_): + elif issubclass(dtype, _nt.unicode_) or \ + issubclass(dtype, _nt.string_): format = "%s" format_function = lambda x: repr(x) else: From numpy-svn at scipy.org Wed Sep 27 19:20:30 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Sep 2006 18:20:30 -0500 (CDT) Subject: [Numpy-svn] r3223 - in trunk/numpy/core: . src Message-ID: <20060927232030.BDB4139C00C@new.scipy.org> Author: oliphant Date: 2006-09-27 18:20:24 -0500 (Wed, 27 Sep 2006) New Revision: 3223 Modified: trunk/numpy/core/arrayprint.py trunk/numpy/core/src/scalartypes.inc.src Log: Fix printing of arrays with records so that nested arrays print as lists instead of using array syntax Modified: trunk/numpy/core/arrayprint.py =================================================================== --- trunk/numpy/core/arrayprint.py 2006-09-27 22:46:11 UTC (rev 3222) +++ trunk/numpy/core/arrayprint.py 2006-09-27 23:20:24 UTC (rev 3223) @@ -187,6 +187,17 @@ return lst +def _convert_arrays(obj): + newtup = [] + for k in obj: + if isinstance(k, _gen.ndarray): + k = k.tolist() + elif isinstance(k, tuple): + k = _convert_arrays(k) + newtup.append(k) + return tuple(newtup) + + def array2string(a, max_line_width = None, precision = None, suppress_small = None, separator=' ', prefix="", style=repr): @@ -196,6 +207,8 @@ try: lst = a._format(x) except AttributeError: + if isinstance(x, tuple): + x = _convert_arrays(x) lst = style(x) elif reduce(product, a.shape) == 0: # treat as a null array if any of shape elements == 0 @@ -212,6 +225,7 @@ line += word return s, line + def _formatArray(a, format_function, rank, max_line_len, next_line_prefix, separator, edge_items, summary_insert): """formatArray is designed for two modes of operation: @@ -222,7 +236,10 @@ """ if rank == 0: - return str(a.item()) + obj = a.item() + if isinstance(obj, tuple): + obj = _convert_arrays(obj) + return str(obj) if summary_insert and 2*edge_items < len(a): leading_items, trailing_items, summary_insert1 = \ Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2006-09-27 22:46:11 UTC (rev 3222) +++ trunk/numpy/core/src/scalartypes.inc.src 2006-09-27 23:20:24 UTC (rev 3223) @@ -452,27 +452,26 @@ gentype_str(PyObject *self) { PyArrayObject *arr; - PyObject *ret, *tmp; + PyObject *ret; arr = (PyArrayObject *)PyArray_FromScalar(self, NULL); if (arr==NULL) return NULL; - ret = PyObject_Str((tmp=arr->descr->f->getitem(arr->data, arr))); + ret = PyObject_Str((PyObject *)arr); Py_DECREF(arr); - Py_XDECREF(tmp); return ret; } + static PyObject * gentype_repr(PyObject *self) { PyArrayObject *arr; - PyObject *ret, *tmp ; + PyObject *ret; arr = (PyArrayObject *)PyArray_FromScalar(self, NULL); if (arr==NULL) return NULL; - ret = PyObject_Repr((tmp=arr->descr->f->getitem(arr->data, arr))); + ret = PyObject_Str((PyObject *)arr); Py_DECREF(arr); - Py_XDECREF(tmp); return ret; } From numpy-svn at scipy.org Wed Sep 27 22:22:44 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Sep 2006 21:22:44 -0500 (CDT) Subject: [Numpy-svn] r3224 - trunk/numpy/lib Message-ID: <20060928022244.0BE4739C0A8@new.scipy.org> Author: oliphant Date: 2006-09-27 21:22:21 -0500 (Wed, 27 Sep 2006) New Revision: 3224 Modified: trunk/numpy/lib/index_tricks.py Log: Don't copy arrays inside ix_ Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2006-09-27 23:20:24 UTC (rev 3223) +++ trunk/numpy/lib/index_tricks.py 2006-09-28 02:22:21 UTC (rev 3224) @@ -72,7 +72,7 @@ nd = len(args) baseshape = [1]*nd for k in range(nd): - new = _nx.array(args[k]) + new = _nx.asarray(args[k]) if (new.ndim != 1): raise ValueError, "Cross index must be 1 dimensional" if issubclass(new.dtype.type, _nx.bool_): From numpy-svn at scipy.org Thu Sep 28 05:56:53 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 04:56:53 -0500 (CDT) Subject: [Numpy-svn] r3225 - in trunk/numpy: core numarray oldnumeric Message-ID: <20060928095653.7C63539C00C@new.scipy.org> Author: oliphant Date: 2006-09-28 04:56:41 -0500 (Thu, 28 Sep 2006) New Revision: 3225 Modified: trunk/numpy/core/info.py trunk/numpy/core/numeric.py trunk/numpy/numarray/functions.py trunk/numpy/oldnumeric/functions.py trunk/numpy/oldnumeric/misc.py Log: Fix the fromfunction routine to use float as default. Update oldnumeric and numarray compatibility modules. Modified: trunk/numpy/core/info.py =================================================================== --- trunk/numpy/core/info.py 2006-09-28 02:22:21 UTC (rev 3224) +++ trunk/numpy/core/info.py 2006-09-28 09:56:41 UTC (rev 3225) @@ -16,7 +16,7 @@ - reshape - Return array with new shape - repeat - Repeat elements of array - choose - Construct new array from indexed array tuple -- cross_correlate - Correlate two 1-d arrays +- correlate - Correlate two 1-d arrays - searchsorted - Search for element in 1-d array - sum - Total sum over a specified dimension - average - Average, possibly weighted, over axis or array. @@ -29,9 +29,8 @@ More Functions: -- arrayrange (arange) - Return regularly spaced array +- arange - Return regularly spaced array - asarray - Guarantee NumPy array -- sarray - Guarantee a NumPy array that keeps precision - convolve - Convolve two 1-d arrays - swapaxes - Exchange axes - concatenate - Join arrays together @@ -40,9 +39,9 @@ - argsort - Indices of sorted array - argmax - Index of largest value - argmin - Index of smallest value -- innerproduct - Innerproduct of two arrays +- inner - Innerproduct of two arrays - dot - Dot product (matrix multiplication) -- outerproduct - Outerproduct of two arrays +- outer - Outerproduct of two arrays - resize - Return array with arbitrary new shape - indices - Tuple of indices - fromfunction - Construct array from universal function Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2006-09-28 02:22:21 UTC (rev 3224) +++ trunk/numpy/core/numeric.py 2006-09-28 09:56:41 UTC (rev 3225) @@ -448,17 +448,21 @@ lst.append( add.accumulate(tmp, i, dtype)-1 ) return array(lst) -def fromfunction(function, dimensions, **kwargs): - """fromfunction(function, dimensions, dtype=int) returns an array constructed by - calling function on a tuple of number grids. The function should - accept as many arguments as there are dimensions which is a list of - numbers indicating the length of the desired output for each axis. +def fromfunction(function, shape, **kwargs): + """returns an array constructed by calling a function on a tuple + of number grids. The function should accept as many arguments as the + length of shape and work on array inputs. The shape argument is a + sequence of numbers indicating the length of the desired output + for each axis. - The function can also accept keyword arguments which will be - passed in as well. + The function can also accept keyword arguments (except dtype), + which will be passed through fromfunction to the function itself. + The dtype argument (default float) determines the data-type of + the index grid passed to the function. + """ - dtype = kwargs.get('dtype', int) - args = indices(dimensions,dtype=dtype) + dtype = kwargs.pop('dtype', float) + args = indices(shape, dtype=dtype) return function(*args,**kwargs) def isscalar(num): Modified: trunk/numpy/numarray/functions.py =================================================================== --- trunk/numpy/numarray/functions.py 2006-09-28 02:22:21 UTC (rev 3224) +++ trunk/numpy/numarray/functions.py 2006-09-28 09:56:41 UTC (rev 3225) @@ -43,7 +43,7 @@ from numpy import dot as matrixmultiply, dot, vdot, ravel, concatenate, all,\ allclose, any, around, argsort, array_equal, array_equiv,\ array_str, array_repr, CLIP, RAISE, WRAP, clip, concatenate, \ - diagonal, e, pi, fromfunction, indices, inner as innerproduct, nonzero, \ + diagonal, e, pi, indices, inner as innerproduct, nonzero, \ outer as outerproduct, kron as kroneckerproduct, lexsort, putmask, rank, \ resize, searchsorted, shape, size, sort, swapaxes, trace, transpose import numpy as N @@ -67,9 +67,12 @@ else: dtype = N.dtype(type) if use_default and dtype is None: - dtype = N.dtype(None) + dtype = N.dtype('int') return dtype - + +def fromfunction(shape, dimensions, type=None, typecode=None, dtype=None): + dtype = type2dtype(typecode, type, dtype, 1) + return N.fromfunction(shape, dimensions, dtype=dtype) def ones(shape, type=None, typecode=None, dtype=None): dtype = type2dtype(typecode, type, dtype, 1) return N.ones(shape, dtype) Modified: trunk/numpy/oldnumeric/functions.py =================================================================== --- trunk/numpy/oldnumeric/functions.py 2006-09-28 02:22:21 UTC (rev 3224) +++ trunk/numpy/oldnumeric/functions.py 2006-09-28 09:56:41 UTC (rev 3225) @@ -6,7 +6,7 @@ from typeconv import convtypecode, convtypecode2 __all__ = ['take', 'repeat', 'sum', 'product', 'sometrue', 'alltrue', - 'cumsum', 'cumproduct', 'compress', + 'cumsum', 'cumproduct', 'compress', 'fromfunction', 'ones', 'empty', 'identity', 'zeros', 'array', 'asarray', 'nonzero', 'reshape', 'arange', 'fromstring', 'ravel', 'trace', 'indices', 'where','sarray','cross_product', 'argmax', 'argmin', @@ -44,7 +44,10 @@ def compress(condition, m, axis=-1): return N.compress(condition, m, axis) - + +def fromfunction(args, dimensions): + return N.fromfunction(args, dimensions, dtype=int) + def ones(shape, typecode='l', savespace=0, dtype=None): """ones(shape, dtype=int) returns an array of the given dimensions which is initialized to all ones. Modified: trunk/numpy/oldnumeric/misc.py =================================================================== --- trunk/numpy/oldnumeric/misc.py 2006-09-28 02:22:21 UTC (rev 3224) +++ trunk/numpy/oldnumeric/misc.py 2006-09-28 09:56:41 UTC (rev 3225) @@ -6,7 +6,7 @@ 'choose', 'swapaxes', 'array_str', 'pi', 'math', 'concatenate', 'putmask', 'put', 'around', 'vdot', 'transpose', 'array2string', 'diagonal', - 'searchsorted', 'fromfunction', 'copy', 'resize', + 'searchsorted', 'copy', 'resize', 'array_repr', 'e', 'StringIO', 'pickle', 'argsort', 'convolve', 'loads', 'cross_correlate', 'Pickler', 'dot', 'outerproduct', 'innerproduct', 'insert'] @@ -21,7 +21,7 @@ from numpy import sort, clip, rank, sign, shape, putmask, allclose, size,\ choose, swapaxes, array_str, array_repr, e, pi, put, \ - fromfunction, resize, around, concatenate, vdot, transpose, \ + resize, around, concatenate, vdot, transpose, \ diagonal, searchsorted, argsort, convolve, dot, \ outer as outerproduct, inner as innerproduct, correlate as cross_correlate, \ place as insert From numpy-svn at scipy.org Thu Sep 28 06:06:11 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 05:06:11 -0500 (CDT) Subject: [Numpy-svn] r3226 - trunk/numpy/fft Message-ID: <20060928100611.53C1639C00C@new.scipy.org> Author: oliphant Date: 2006-09-28 05:06:08 -0500 (Thu, 28 Sep 2006) New Revision: 3226 Modified: trunk/numpy/fft/info.py Log: Fix documentation of fft sub-package to eliminate references to refft. Modified: trunk/numpy/fft/info.py =================================================================== --- trunk/numpy/fft/info.py 2006-09-28 09:56:41 UTC (rev 3225) +++ trunk/numpy/fft/info.py 2006-09-28 10:06:08 UTC (rev 3226) @@ -13,12 +13,12 @@ Real FFTs - refft - irefft - refft2 - irefft2 - refftn - irefftn + rfft + irfft + rfft2 + irfft2 + rfftn + irfftn Hermite FFTs From numpy-svn at scipy.org Thu Sep 28 07:20:58 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 06:20:58 -0500 (CDT) Subject: [Numpy-svn] r3227 - in trunk/numpy: core/src numarray Message-ID: <20060928112058.5AE5E39C049@new.scipy.org> Author: cookedm Date: 2006-09-28 06:20:52 -0500 (Thu, 28 Sep 2006) New Revision: 3227 Modified: trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/arraytypes.inc.src trunk/numpy/core/src/scalartypes.inc.src trunk/numpy/core/src/ufuncobject.c trunk/numpy/numarray/_capi.c Log: Python 2.5 fixes: replace int with Py_ssize_t where appropiate Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2006-09-28 10:06:08 UTC (rev 3226) +++ trunk/numpy/core/src/arraymethods.c 2006-09-28 11:20:52 UTC (rev 3227) @@ -905,7 +905,8 @@ else if (PyDescr_HASFIELDS(dtype)) { PyObject *key, *value, *title=NULL; PyArray_Descr *new; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; @@ -1080,7 +1081,7 @@ int fortran; PyObject *rawdata; char *datastr; - int len; + Py_ssize_t len; intp size, dimensions[MAX_DIMS]; int nd; Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-28 10:06:08 UTC (rev 3226) +++ trunk/numpy/core/src/arrayobject.c 2006-09-28 11:20:52 UTC (rev 3227) @@ -163,7 +163,8 @@ else if (PyDescr_HASFIELDS(descr)) { PyObject *key, *value, *title=NULL; PyArray_Descr *new; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; while (PyDict_Next(descr->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; @@ -190,7 +191,8 @@ else if PyDescr_HASFIELDS(descr) { PyObject *key, *value, *title=NULL; PyArray_Descr *new; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; while (PyDict_Next(descr->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; @@ -4521,7 +4523,7 @@ PyObject *res=NULL, *temp, *a, *b; PyObject *key, *value, *temp2; PyObject *op; - int pos=0; + Py_ssize_t pos=0; op = (cmp_op == Py_EQ ? n_ops.logical_and : n_ops.logical_or); while (PyDict_Next(self->descr->fields, &pos, &key, &value)) { a = PyArray_EnsureAnyArray(array_subscript(self, key)); @@ -5390,7 +5392,8 @@ else if (PyDescr_HASFIELDS(dtype)) { PyObject *key, *value, *title=NULL; PyArray_Descr *new; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; @@ -5566,7 +5569,8 @@ if (PyDescr_HASFIELDS(dtype)) { PyObject *key, *value, *title=NULL; PyArray_Descr *new; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; @@ -6601,7 +6605,7 @@ static PyObject * -array_alloc(PyTypeObject *type, int nitems) +array_alloc(PyTypeObject *type, Py_ssize_t nitems) { PyObject *obj; /* nitems will always be 0 */ @@ -10674,7 +10678,8 @@ else { PyObject *key, *value, *title=NULL; PyArray_Descr *new; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; while(PyDict_Next(self->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return -1; @@ -10864,7 +10869,8 @@ if (PyDescr_HASFIELDS(self)) { PyObject *key, *value, *title=NULL; PyArray_Descr *new; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; while (PyDict_Next(self->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { @@ -11025,7 +11031,8 @@ PyObject *newvalue; PyObject *old; PyArray_Descr *newdescr; - int pos = 0, len, i; + Py_ssize_t pos = 0; + int len, i; newfields = PyDict_New(); /* make new dictionary with replaced */ /* PyArray_Descr Objects */ Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2006-09-28 10:06:08 UTC (rev 3226) +++ trunk/numpy/core/src/arraytypes.inc.src 2006-09-28 11:20:52 UTC (rev 3227) @@ -333,7 +333,7 @@ STRING_setitem(PyObject *op, char *ov, PyArrayObject *ap) { char *ptr; - int len; + Py_ssize_t len; PyObject *temp=NULL; if (!PyString_Check(op) && !PyUnicode_Check(op) && @@ -1250,7 +1250,8 @@ if (PyArray_HASFIELDS(arr)) { PyObject *key, *value, *title=NULL; PyArray_Descr *new, *descr; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; descr = arr->descr; while (PyDict_Next(descr->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, @@ -1278,7 +1279,8 @@ if (PyArray_HASFIELDS(arr)) { PyObject *key, *value, *title=NULL; PyArray_Descr *new, *descr; - int offset, pos=0; + int offset; + Py_ssize_t pos=0; descr = arr->descr; /* Save it */ while (PyDict_Next(descr->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, @@ -1500,7 +1502,8 @@ if (PyArray_HASFIELDS(ap)) { PyArray_Descr *descr, *new; PyObject *key, *value, *title; - int savedflags, offset, pos=0; + int savedflags, offset; + Py_ssize_t pos=0; descr = ap->descr; savedflags = ap->flags; while (PyDict_Next(descr->fields, &pos, &key, &value)) { Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2006-09-28 10:06:08 UTC (rev 3226) +++ trunk/numpy/core/src/scalartypes.inc.src 2006-09-28 11:20:52 UTC (rev 3227) @@ -275,7 +275,7 @@ static PyObject * -gentype_alloc(PyTypeObject *type, int nitems) +gentype_alloc(PyTypeObject *type, Py_ssize_t nitems) { PyObject *obj; const size_t size = _PyObject_VAR_SIZE(type, nitems+1); @@ -1080,8 +1080,8 @@ return self; } -static int -gentype_getreadbuf(PyObject *, int, void **); +static Py_ssize_t +gentype_getreadbuf(PyObject *, Py_ssize_t, void **); static PyObject * gentype_byteswap(PyObject *self, PyObject *args) @@ -1596,8 +1596,8 @@ -static int -gentype_getreadbuf(PyObject *self, int segment, void **ptrptr) +static Py_ssize_t +gentype_getreadbuf(PyObject *self, Py_ssize_t segment, void **ptrptr) { int numbytes; PyArray_Descr *outcode; @@ -1616,8 +1616,8 @@ return numbytes; } -static int -gentype_getsegcount(PyObject *self, int *lenp) +static Py_ssize_t +gentype_getsegcount(PyObject *self, Py_ssize_t *lenp) { PyArray_Descr *outcode; @@ -1628,8 +1628,8 @@ return 1; } -static int -gentype_getcharbuf(PyObject *self, int segment, constchar **ptrptr) +static Py_ssize_t +gentype_getcharbuf(PyObject *self, Py_ssize_t segment, constchar **ptrptr) { if (PyArray_IsScalar(self, String) || \ PyArray_IsScalar(self, Unicode)) @@ -1644,10 +1644,10 @@ static PyBufferProcs gentype_as_buffer = { - (getreadbufferproc)gentype_getreadbuf, /*bf_getreadbuffer*/ - (getwritebufferproc)0, /*bf_getwritebuffer*/ - (getsegcountproc)gentype_getsegcount, /*bf_getsegcount*/ - (getcharbufferproc)gentype_getcharbuf, /*bf_getcharbuffer*/ + gentype_getreadbuf, /*bf_getreadbuffer*/ + NULL, /*bf_getwritebuffer*/ + gentype_getsegcount, /*bf_getsegcount*/ + gentype_getcharbuf, /*bf_getcharbuffer*/ }; @@ -2133,7 +2133,7 @@ static Py_ssize_t object_arrtype_getsegcount(PyObjectScalarObject *self, Py_ssize_t *lenp) { - int newlen; + Py_ssize_t newlen; int cnt; PyBufferProcs *pb = self->obval->ob_type->tp_as_buffer; Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2006-09-28 10:06:08 UTC (rev 3226) +++ trunk/numpy/core/src/ufuncobject.c 2006-09-28 11:20:52 UTC (rev 3227) @@ -2958,7 +2958,7 @@ PyUFunc_PyFuncData *fdata; PyUFuncObject *self; char *fname, *str; - int fname_len=-1; + Py_ssize_t fname_len=-1; int offset[2]; if (!PyArg_ParseTuple(args, "Oii", &function, &nin, &nout)) return NULL; Modified: trunk/numpy/numarray/_capi.c =================================================================== --- trunk/numpy/numarray/_capi.c 2006-09-28 10:06:08 UTC (rev 3226) +++ trunk/numpy/numarray/_capi.c 2006-09-28 11:20:52 UTC (rev 3227) @@ -123,7 +123,7 @@ static int getBufferSize(PyObject *buffobj) { - int segcount, size=0; + Py_ssize_t segcount, size=0; PyObject *buff2; if ((buff2 = getBuffer(buffobj))) { From numpy-svn at scipy.org Thu Sep 28 07:23:21 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 06:23:21 -0500 (CDT) Subject: [Numpy-svn] r3228 - trunk/numpy/distutils Message-ID: <20060928112321.96DE639C049@new.scipy.org> Author: cookedm Date: 2006-09-28 06:23:18 -0500 (Thu, 28 Sep 2006) New Revision: 3228 Modified: trunk/numpy/distutils/system_info.py Log: For the MKL library, define the macro SCIPY_MKL_H Modified: trunk/numpy/distutils/system_info.py =================================================================== --- trunk/numpy/distutils/system_info.py 2006-09-28 11:20:52 UTC (rev 3227) +++ trunk/numpy/distutils/system_info.py 2006-09-28 11:23:18 UTC (rev 3228) @@ -806,7 +806,10 @@ return info = {} dict_append(info,**mkl) - dict_append(info,libraries = ['pthread'], include_dirs = incl_dirs) + dict_append(info, + libraries = ['pthread'], + define_macros=[('SCIPY_MKL_H',None)], + include_dirs = incl_dirs) self.set_info(**info) class lapack_mkl_info(mkl_info): From numpy-svn at scipy.org Thu Sep 28 08:49:04 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 07:49:04 -0500 (CDT) Subject: [Numpy-svn] r3229 - trunk/numpy/core/src Message-ID: <20060928124904.23C4F39C014@new.scipy.org> Author: oliphant Date: 2006-09-28 07:49:01 -0500 (Thu, 28 Sep 2006) New Revision: 3229 Modified: trunk/numpy/core/src/_sortmodule.c.src trunk/numpy/core/src/multiarraymodule.c Log: Fix merge argsort for strings. Code was not indexing correctly into the array of strings. Add object-detection so future addition of an object MERGE sort doesn't cause lexsort and threading to die. Modified: trunk/numpy/core/src/_sortmodule.c.src =================================================================== --- trunk/numpy/core/src/_sortmodule.c.src 2006-09-28 11:23:18 UTC (rev 3228) +++ trunk/numpy/core/src/_sortmodule.c.src 2006-09-28 12:49:01 UTC (rev 3229) @@ -360,24 +360,24 @@ /**begin repeat #TYPE=STRING,UNICODE# #comp=strncmp,PyArray_CompareUCS4# -#type=char *, PyArray_UCS4 *# +#type=char, PyArray_UCS4# */ static void - at TYPE@_amergesort0(intp *pl, intp *pr, @type@*v, intp *pw, int elsize) + at TYPE@_amergesort0(intp *pl, intp *pr, @type@ *v, intp *pw, int len) { - @type@ vp; + @type@ *vp; intp vi, *pi, *pj, *pk, *pm; if (pr - pl > SMALL_MERGESORT) { /* merge sort */ pm = pl + ((pr - pl + 1)>>1); - @TYPE at _amergesort0(pl,pm-1,v,pw,elsize); - @TYPE at _amergesort0(pm,pr,v,pw,elsize); + @TYPE at _amergesort0(pl,pm-1,v,pw,len); + @TYPE at _amergesort0(pm,pr,v,pw,len); for(pi = pw, pj = pl; pj < pm; ++pi, ++pj) { *pi = *pj; } for(pk = pw, pm = pl; pk < pi && pj <= pr; ++pm) { - if (@comp@(v[*pk],v[*pj],elsize)<=0) { + if (@comp@(v+(*pk)*len,v+(*pj)*len,len)<=0) { *pm = *pk; ++pk; }else{ @@ -392,9 +392,9 @@ /* insertion sort */ for(pi = pl + 1; pi <= pr; ++pi) { vi = *pi; - vp = v[vi]; - for(pj = pi, pk = pi - 1; \ - pj > pl && (@comp@(vp, v[*pk],elsize)<=0); \ + vp = v + vi*len; + for(pj = pi, pk = pi - 1; \ + pj > pl && (@comp@(vp, v+(*pk)*len,len)<=0); \ --pj, --pk) { *pj = *pk; } @@ -404,13 +404,15 @@ } static int - at TYPE@_amergesort(@type@*v, intp *tosort, intp num, PyArrayObject *arr) + at TYPE@_amergesort(@type@ *v, intp *tosort, intp num, PyArrayObject *arr) { intp *pl, *pr, *pw; - int elsize; + int elsize, chars; elsize = arr->descr->elsize; + chars = elsize / sizeof(@type@); + pl = tosort; pr = pl + num - 1; pw = PyDimMem_NEW((1+num/2)); @@ -419,7 +421,7 @@ return -1; } - @TYPE at _amergesort0(pl, pr, v, pw, elsize); + @TYPE at _amergesort0(pl, pr, v, pw, chars); PyDimMem_FREE(pw); return 0; } Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2006-09-28 11:23:18 UTC (rev 3228) +++ trunk/numpy/core/src/multiarraymodule.c 2006-09-28 12:49:01 UTC (rev 3229) @@ -2364,8 +2364,9 @@ int needcopy=0, i,j; intp N, size; int elsize; - int maxelsize; + int maxelsize; intp astride, rstride, *iptr; + int object=0; PyArray_ArgSortFunc *argsort; NPY_BEGIN_THREADS_DEF @@ -2402,6 +2403,7 @@ "merge sort not available for item %d", i); goto fail; } + if (!object && mps[i]->descr->hasobject) object = 1; its[i] = (PyArrayIterObject *)PyArray_IterAllButAxis \ ((PyObject *)mps[i], &axis); if (its[i]==NULL) goto fail; @@ -2414,10 +2416,10 @@ mps[0]->dimensions, PyArray_INTP, NULL, NULL, 0, 0, NULL); - + if (ret == NULL) goto fail; *((intp *)(ret->data)) = 0; - goto finish; + goto finish; } if (axis < 0) axis += nd; if ((axis < 0) || (axis >= nd)) { @@ -2437,29 +2439,29 @@ PyArray_IterAllButAxis((PyObject *)ret, &axis); if (rit == NULL) goto fail; - NPY_BEGIN_THREADS + if (!object) {NPY_BEGIN_THREADS} size = rit->size; N = mps[0]->dimensions[axis]; rstride = PyArray_STRIDE(ret,axis); - maxelsize = mps[0]->descr->elsize; + maxelsize = mps[0]->descr->elsize; needcopy = (rstride != sizeof(intp)); for (j=0; jflags & ALIGNED) || \ + needcopy = PyArray_ISBYTESWAPPED(mps[j]) || \ + !(mps[j]->flags & ALIGNED) || \ (mps[j]->strides[axis] != (intp)mps[j]->descr->elsize); - if (mps[j]->descr->elsize > maxelsize) - maxelsize = mps[j]->descr->elsize; + if (mps[j]->descr->elsize > maxelsize) + maxelsize = mps[j]->descr->elsize; } if (needcopy) { char *valbuffer, *indbuffer; - int *swaps; + int *swaps; valbuffer = PyDataMem_NEW(N*maxelsize); - indbuffer = PyDataMem_NEW(N*sizeof(intp)); - swaps = malloc(n*sizeof(int)); - for (j=0; jstrides[axis]; argsort = mps[j]->descr->f->argsort[PyArray_MERGESORT]; _unaligned_strided_byte_copy(valbuffer, (intp) elsize, - its[j]->dataptr, astride, N, elsize); - if (swaps[j]) - _strided_byte_swap(valbuffer, (intp) elsize, N, elsize); + its[j]->dataptr, astride, N, elsize); + if (swaps[j]) + _strided_byte_swap(valbuffer, (intp) elsize, N, elsize); if (argsort(valbuffer, (intp *)indbuffer, N, mps[j]) < 0) { PyDataMem_FREE(valbuffer); - PyDataMem_FREE(indbuffer); - free(swaps); - goto fail; + PyDataMem_FREE(indbuffer); + free(swaps); + goto fail; } PyArray_ITER_NEXT(its[j]); } _unaligned_strided_byte_copy(rit->dataptr, rstride, indbuffer, - sizeof(intp), N, sizeof(intp)); + sizeof(intp), N, sizeof(intp)); PyArray_ITER_NEXT(rit); } PyDataMem_FREE(valbuffer); - PyDataMem_FREE(indbuffer); - free(swaps); + PyDataMem_FREE(indbuffer); + free(swaps); } else { while (size--) { @@ -2501,7 +2503,7 @@ } } - NPY_END_THREADS + if (!object) {NPY_END_THREADS} finish: for (i=0; i Author: oliphant Date: 2006-09-28 07:58:14 -0500 (Thu, 28 Sep 2006) New Revision: 3230 Modified: trunk/numpy/add_newdocs.py Log: Update lexsort documentation a bit to give a hint as to how to use the keys to implement primary and secondary sorting Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2006-09-28 12:49:01 UTC (rev 3229) +++ trunk/numpy/add_newdocs.py 2006-09-28 12:58:14 UTC (rev 3230) @@ -363,8 +363,10 @@ key[0], then the resulting list of indices is further manipulated by sorting on key[1], and so forth. The result is a sort on multiple keys. If the keys represented columns of a spreadsheet, for example, - this would sort using multiple columns. The keys argument must be a - sequence of things that can be converted to arrays of the same shape. + this would sort using multiple columns (the last key being used for the + primary sort order, the second-to-last key for the secondary sort order, + and so on). The keys argument must be a sequence of things that can be + converted to arrays of the same shape. """) From numpy-svn at scipy.org Thu Sep 28 11:57:37 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 10:57:37 -0500 (CDT) Subject: [Numpy-svn] r3231 - trunk/numpy/core/tests Message-ID: <20060928155737.A57FE39C012@new.scipy.org> Author: stefan Date: 2006-09-28 10:56:19 -0500 (Thu, 28 Sep 2006) New Revision: 3231 Modified: trunk/numpy/core/tests/test_regression.py Log: Add test for ticket #298. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2006-09-28 12:58:14 UTC (rev 3230) +++ trunk/numpy/core/tests/test_regression.py 2006-09-28 15:56:19 UTC (rev 3231) @@ -451,5 +451,10 @@ res2 = getattr(N, func)(arr1, arr2) assert abs(res1-res2).max() < 1e-8, func + def check_mem_lexsort_strings(self, level=rlevel): + """Ticket #298""" + lst = ['abc','cde','fgh'] + N.lexsort((lst,)) + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Thu Sep 28 12:23:50 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 11:23:50 -0500 (CDT) Subject: [Numpy-svn] r3232 - trunk/numpy/lib Message-ID: <20060928162350.01C1239C012@new.scipy.org> Author: stefan Date: 2006-09-28 11:22:43 -0500 (Thu, 28 Sep 2006) New Revision: 3232 Modified: trunk/numpy/lib/arraysetops.py Log: Change unique1d's argument name from retindx to return_index. Modified: trunk/numpy/lib/arraysetops.py =================================================================== --- trunk/numpy/lib/arraysetops.py 2006-09-28 15:56:19 UTC (rev 3231) +++ trunk/numpy/lib/arraysetops.py 2006-09-28 16:22:43 UTC (rev 3232) @@ -48,16 +48,18 @@ ## # 01.11.2005, c # 02.11.2005 -def unique1d(ar1, retindx=False): - """Unique elements of 1D array. When ret_indx is True, return also the - indices indx such that ar1.flat[indx] is the resulting array of unique - elements.""" +def unique1d(ar1, return_index=False): + """Unique elements of 1D array. When return_index is True, return + also the indices indx such that ar1.flat[indx] is the resulting + array of unique elements. + + """ ar = numpy.asarray(ar1).ravel() if ar.size == 0: - if retindx: return numpy.empty(0, numpy.bool), ar + if return_index: return numpy.empty(0, numpy.bool), ar else: return ar - if retindx: + if return_index: perm = ar.argsort() aux = ar.take(perm) flag = ediff1d(aux, 1) != 0 From numpy-svn at scipy.org Thu Sep 28 13:46:26 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Sep 2006 12:46:26 -0500 (CDT) Subject: [Numpy-svn] r3233 - in trunk/numpy/core: include/numpy src Message-ID: <20060928174626.0DF0739C0CA@new.scipy.org> Author: oliphant Date: 2006-09-28 12:46:22 -0500 (Thu, 28 Sep 2006) New Revision: 3233 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arrayobject.c Log: Create PyArray_HasArrayInterface macro to simplify getting an array from the array interface. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-28 16:22:43 UTC (rev 3232) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2006-09-28 17:46:22 UTC (rev 3233) @@ -1416,6 +1416,13 @@ #define PyArray_Check(op) ((op)->ob_type == &PyArray_Type || \ PyObject_TypeCheck((op), &PyArray_Type)) #define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type) +#define PyArray_HasArrayInterfaceType(op, type, context, out) \ + ((((out)=PyArray_FromStructInterface(op)) != Py_NotImplemented) || \ + (((out)=PyArray_FromInterface(op)) != Py_NotImplemented) || \ + (((out)=PyArray_FromArrayAttr(op, type, context)) != \ + Py_NotImplemented)) +#define PyArray_HasArrayInterface(op, out) \ + PyArray_HasArrayInterfaceType(op, NULL, NULL, out) #define PyArray_IsZeroDim(op) (PyArray_Check(op) && (PyArray_NDIM(op) == 0)) #define PyArray_IsScalar(obj, cls) \ Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2006-09-28 16:22:43 UTC (rev 3232) +++ trunk/numpy/core/src/arrayobject.c 2006-09-28 17:46:22 UTC (rev 3233) @@ -1158,7 +1158,7 @@ PyArray_CopyObject(PyArrayObject *dest, PyObject *src_object) { PyArrayObject *src; - PyArray_Descr* dtype; + PyObject *r; int ret; /* Special code to mimic Numeric behavior for @@ -1184,17 +1184,24 @@ } if (PyArray_Check(src_object)) { - dtype = NULL; + src = (PyArrayObject *)src_object; + Py_INCREF(src); } + else if (!PyArray_IsScalar(src_object, Generic) && + PyArray_HasArrayInterface(src_object, r)) { + src = (PyArrayObject *)r; + } else { + PyArray_Descr* dtype; dtype = dest->descr; Py_INCREF(dtype); + src = (PyArrayObject *)PyArray_FromAny(src_object, dtype, 0, + dest->nd, + FORTRAN_IF(dest), + NULL); } - src = (PyArrayObject *)PyArray_FromAny(src_object, dtype, 0, - dest->nd, - FORTRAN_IF(dest), NULL); if (src == NULL) return -1; - + ret = PyArray_MoveInto(dest, src); Py_DECREF(src); return ret; @@ -8253,10 +8260,7 @@ if (flags & UPDATEIFCOPY) goto err; r = Array_FromPyScalar(op, newtype); } - else if (((r = PyArray_FromStructInterface(op))!=Py_NotImplemented)|| \ - ((r = PyArray_FromInterface(op)) != Py_NotImplemented) || \ - ((r = PyArray_FromArrayAttr(op, newtype, context)) \ - != Py_NotImplemented)) { + else if (PyArray_HasArrayInterfaceType(op, newtype, context, r)) { PyObject *new; if (r == NULL) {Py_XDECREF(newtype); return NULL;} if (newtype != NULL || flags != 0) { From numpy-svn at scipy.org Fri Sep 29 13:59:00 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 29 Sep 2006 12:59:00 -0500 (CDT) Subject: [Numpy-svn] r3234 - trunk/numpy/core/src Message-ID: <20060929175900.182C239C01C@new.scipy.org> Author: oliphant Date: 2006-09-29 12:58:55 -0500 (Fri, 29 Sep 2006) New Revision: 3234 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Allow -1 to be used on uint32 and uint64 Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2006-09-28 17:46:22 UTC (rev 3233) +++ trunk/numpy/core/src/arraytypes.inc.src 2006-09-29 17:58:55 UTC (rev 3234) @@ -1,27 +1,64 @@ /* -*- c -*- */ -/**begin repeat -#name=UnsignedLong,UnsignedLongLong,LongLong# -#type=ulong,ulonglong,longlong# - */ -static @type@ -MyPyLong_As at name@(PyObject *vv) +static longlong +MyPyLong_AsLongLong(PyObject *vv) { - @type@ ret; + longlong ret; if (!PyLong_Check(vv)) { PyObject *mylong; mylong = PyNumber_Long(vv); - if (mylong == NULL) return (@type@) -1; + if (mylong == NULL) return (longlong) -1; vv = mylong; } + else Py_INCREF(vv); + + ret = PyLong_AsLongLong(vv); + Py_DECREF(vv); + return ret; +} + +static ulong +MyPyLong_AsUnsignedLong(PyObject *vv) +{ + longlong val; + + if (!PyLong_Check(vv)) { + PyObject *mylong; + mylong = PyNumber_Long(vv); + if (mylong == NULL) return (ulong) -1; + vv = mylong; + } else Py_INCREF(vv); - ret = PyLong_As at name@(vv); + val = PyLong_AsLongLong(vv); Py_DECREF(vv); + return (ulong) val; +} + +static ulonglong +MyPyLong_AsUnsignedLongLong(PyObject *vv) +{ + ulonglong ret; + + if (!PyLong_Check(vv)) { + PyObject *mylong; + mylong = PyNumber_Long(vv); + if (mylong == NULL) return (ulonglong) -1; + vv = mylong; + } + else Py_INCREF(vv); + + ret = PyLong_AsUnsignedLongLong(vv); + if (PyErr_Occurred()) { + longlong new; + PyErr_Clear(); + new = PyLong_AsLongLong(vv); + ret = (ulonglong) new; + } + Py_DECREF(vv); return ret; } -/**end repeat**/ static double @@ -86,6 +123,7 @@ @TYP at _setitem(PyObject *op, char *ov, PyArrayObject *ap) { @typ@ temp; /* ensures alignment */ + if (PyArray_IsScalar(op, @kind@)) { temp = ((Py at kind@ScalarObject *)op)->obval; } @@ -95,7 +133,7 @@ if (PyErr_Occurred()) { if (PySequence_Check(op)) { PyErr_Clear(); - PyErr_SetString(PyExc_TypeError, "setting an array"\ + PyErr_SetString(PyExc_ValueError, "setting an array" \ " element with a sequence."); } return -1; @@ -274,11 +312,10 @@ if (!PyString_Check(op) && !PyUnicode_Check(op) && PySequence_Check(op)) { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_ValueError, "setting an array element with a sequence"); return -1; } - if ((temp=PyObject_Unicode(op)) == NULL) return -1; ptr = PyUnicode_AS_UNICODE(temp); if ((ptr == NULL) || (PyErr_Occurred())) { @@ -338,7 +375,7 @@ if (!PyString_Check(op) && !PyUnicode_Check(op) && PySequence_Check(op)) { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_ValueError, "setting an array element with a sequence"); return -1; } From numpy-svn at scipy.org Fri Sep 29 14:02:36 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 29 Sep 2006 13:02:36 -0500 (CDT) Subject: [Numpy-svn] r3235 - trunk/numpy/core/src Message-ID: <20060929180236.781DA39C0B8@new.scipy.org> Author: oliphant Date: 2006-09-29 13:02:25 -0500 (Fri, 29 Sep 2006) New Revision: 3235 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Only use the LongLong conversion if negative conversion worked. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2006-09-29 17:58:55 UTC (rev 3234) +++ trunk/numpy/core/src/arraytypes.inc.src 2006-09-29 18:02:25 UTC (rev 3235) @@ -54,7 +54,9 @@ longlong new; PyErr_Clear(); new = PyLong_AsLongLong(vv); - ret = (ulonglong) new; + if (!PyErr_Occurred() && new < 0) + ret = (ulonglong) new; + ret = NPY_MAX_ULONGLONG; } Py_DECREF(vv); return ret; From numpy-svn at scipy.org Sat Sep 30 17:03:13 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 30 Sep 2006 16:03:13 -0500 (CDT) Subject: [Numpy-svn] r3236 - in trunk/numpy/f2py/lib: . src Message-ID: <20060930210313.65ABD39C0D3@new.scipy.org> Author: pearu Date: 2006-09-30 16:02:52 -0500 (Sat, 30 Sep 2006) New Revision: 3236 Added: trunk/numpy/f2py/lib/generate_pyobj_tofrom_funcs.py trunk/numpy/f2py/lib/wrapper_base.py Modified: trunk/numpy/f2py/lib/block_statements.py trunk/numpy/f2py/lib/python_wrapper.py trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c trunk/numpy/f2py/lib/src/pyobj_to_long.c trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c trunk/numpy/f2py/lib/src/pyobj_to_string_len.c trunk/numpy/f2py/lib/typedecl_statements.py Log: F2PY G3: wrapping nested derived types. Modified: trunk/numpy/f2py/lib/block_statements.py =================================================================== --- trunk/numpy/f2py/lib/block_statements.py 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/block_statements.py 2006-09-30 21:02:52 UTC (rev 3236) @@ -1007,6 +1007,37 @@ s += tab + 'END TYPE ' + self.name + '\n' return s + # Wrapper methods: + + def get_bit_size(self, _cache={}): + try: + return _cache[id(self)] + except KeyError: + s = 0 + for name,var in self.a.components.items(): + s += var.get_bit_size() + _cache[id(self)] = s + return s + + def get_f_type(self): + return 'TYPE(%s)' % (self.name) + + def get_c_type(self): + return 'f2py_type_%s_%s' % (self.name, self.get_bit_size()) + + def get_c_name(self): + return 'f2py_type_%s' % (self.name) + + def get_c_struct_name(self): + return self.get_c_name() + '_struct' + + def get_c_struct(self): + l = [] + for name, var in self.a.components.items(): + t = var.get_typedecl() + l.append(' %s %s;' % (t.get_c_type(), name)) + return 'typedef struct {\n%s\n} %s;' % ('\n'.join(l), self.get_c_struct_name()) + TypeDecl = Type # Enum Added: trunk/numpy/f2py/lib/generate_pyobj_tofrom_funcs.py =================================================================== --- trunk/numpy/f2py/lib/generate_pyobj_tofrom_funcs.py 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/generate_pyobj_tofrom_funcs.py 2006-09-30 21:02:52 UTC (rev 3236) @@ -0,0 +1,129 @@ +""" +Generate + int pyobj_to_(PyObject* obj, * value) + PyObject* pyobj_from_(* value) +functions. +""" +__all__ = ['pyobj_to_npy_scalar','pyobj_to_f2py_string','pyobj_from_npy_scalar'] + +from utils import CHAR_BIT + +def pyobj_from_npy_int(ctype): + ctype_bits = int(ctype[7:]) + itemsize = ctype_bits/CHAR_BIT + dtype = ctype.upper() + return '''\ +static PyObject* pyobj_from_%(ctype)s(%(ctype)s* value) { + return PyArray_Return(PyArray_SimpleNewFromData(0, NULL, %(dtype)s, (char*)value)); +} +''' % (locals()) + +def pyobj_from_f2py_type(ctype): + ctype_bits = int(ctype[10:]) + raise NotImplementedError,`ctype` + return '''\ +static PyObject* pyobj_from_%(ctype)s(%(ctype)s* value) { + fprintf(stderr,"In pyobj_from_%(ctype)s (%%p)\\n", value); +} +''' + +def pyobj_to_npy_int(ctype): + ctype_bits = int(ctype[7:]) + return ''' +/* depends: pyobj_to_long.c, pyobj_to_npy_longlong.c */ +#if NPY_BITSOF_LONG == %(ctype_bits)s +#define pyobj_to_%(ctype)s pyobj_to_long +#else +#if NPY_BITSOF_LONG > %(ctype_bits)s +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + long tmp; + if (pyobj_to_long(obj,&tmp)) { + *value = (%(ctype)s)tmp; + return 1; + } + return 0; +} +#else +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + npy_longlong tmp; + if (pyobj_to_npy_longlong(obj,&tmp)) { + *value = (%(ctype)s)tmp; + return 1; + } + return 0; +} +#endif +#endif +''' % (locals()) + +def pyobj_to_npy_float(ctype): + ctype_bits = int(ctype[9:]) + return ''' +/* depends: pyobj_to_double.c */ +#if NPY_BITSOF_DOUBLE == %(ctype_bits)s +#define pyobj_to_%(ctype)s pyobj_to_double +#else +#if NPY_BITSOF_DOUBLE > %(ctype_bits)s +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + double tmp; + if (pyobj_to_double(obj,&tmp)) { + *value = (%(ctype)s)tmp; + return 1; + } + return 0; +} +#else +#error, "NOTIMPLEMENTED pyobj_to_%(ctype)s" +#endif +#endif +''' % (locals()) + +def pyobj_to_npy_complex(ctype): + ctype_bits = int(ctype[11:]) + cfloat_bits = ctype_bits/2 + return ''' +/* depends: pyobj_to_Py_complex.c */ +#if NPY_BITSOF_DOUBLE >= %(cfloat_bits)s +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + Py_complex c; + if (pyobj_to_Py_complex(obj,&c)) { + (*value).real = (npy_float%(cfloat_bits)s)c.real; + (*value).imag = (npy_float%(cfloat_bits)s)c.imag; + return 1; + } + return 0; +} +#else +#error, "NOTIMPLEMENTED pyobj_to_%(ctype)s" +#endif +''' % (locals()) + +def pyobj_to_npy_scalar(ctype): + if ctype.startswith('npy_int'): + return dict(c_code=pyobj_to_npy_int(ctype)) + elif ctype.startswith('npy_float'): + return dict(c_code=pyobj_to_npy_float(ctype)) + elif ctype.startswith('npy_complex'): + return dict(c_code=pyobj_to_npy_complex(ctype)) + raise NotImplementedError,`ctype` + +def pyobj_to_f2py_string(ctype): + ctype_bits = int(ctype[11:]) + ctype_bytes = ctype_bits / CHAR_BIT + return dict( + c_code = ''' +/* depends: pyobj_to_string_len.c */ +static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + return pyobj_to_string_len(obj, (f2py_string*)value, %(ctype_bytes)s); +} +''' % (locals()), + typedef = ['typedef char * f2py_string;', + 'typedef struct { char data[%(ctype_bytes)s]; } %(ctype); ' % (locals())], + header = ['#include '], + ) + +def pyobj_from_npy_scalar(ctype): + if ctype.startswith('npy_int'): + return dict(c_code=pyobj_from_npy_int(ctype)) + raise NotImplementedError,`ctype` + Modified: trunk/numpy/f2py/lib/python_wrapper.py =================================================================== --- trunk/numpy/f2py/lib/python_wrapper.py 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/python_wrapper.py 2006-09-30 21:02:52 UTC (rev 3236) @@ -9,87 +9,8 @@ #from typedecl_statements import intrinsic_type_spec, Character from utils import CHAR_BIT -class WrapperBase: +from wrapper_base import * - - def __init__(self): - self.srcdir = os.path.join(os.path.dirname(__file__),'src') - return - def warning(self, message): - print >> sys.stderr, message - def info(self, message): - print >> sys.stderr, message - - def get_resource_content(self, name, ext): - if name.startswith('pyobj_to_'): - body = self.generate_pyobj_to_ctype_c(name[9:]) - if body is not None: return body - generator_mth_name = 'generate_' + name + ext.replace('.','_') - generator_mth = getattr(self, generator_mth_name, lambda : None) - body = generator_mth() - if body is not None: - return body - fn = os.path.join(self.srcdir,name+ext) - if os.path.isfile(fn): - f = open(fn,'r') - body = f.read() - f.close() - return body - self.warning('No such file: %r' % (fn)) - return - - def get_dependencies(self, code): - l = [] - for uses in re.findall(r'(?<=depends:)([,\w\s.]+)', code, re.I): - for use in uses.split(','): - use = use.strip() - if not use: continue - l.append(use) - return l - - def apply_attributes(self, template): - """ - Apply instance attributes to template string. - - Replace rules for attributes: - _list - will be joined with newline - _clist - _list will be joined with comma - _elist - _list will be joined - ..+.. - attributes will be added - [..] - will be evaluated - """ - replace_names = set(re.findall(r'[ ]*%\(.*?\)s', template)) - d = {} - for name in replace_names: - tab = ' ' * (len(name)-len(name.lstrip())) - name = name.lstrip()[2:-2] - names = name.split('+') - joinsymbol = '\n' - attrs = None - for n in names: - realname = n.strip() - if n.endswith('_clist'): - joinsymbol = ', ' - realname = realname[:-6] + '_list' - elif n.endswith('_elist'): - joinsymbol = '' - realname = realname[:-6] + '_list' - if hasattr(self, realname): - attr = getattr(self, realname) - elif realname.startswith('['): - attr = eval(realname) - else: - self.warning('Undefined %r attribute: %r' % (self.__class__.__name__, realname)) - continue - if attrs is None: - attrs = attr - else: - attrs += attr - if isinstance(attrs, list): - attrs = joinsymbol.join(attrs) - d[name] = str(attrs).replace('\n','\n'+tab) - return template % d - class PythonWrapperModule(WrapperBase): main_template = '''\ @@ -101,21 +22,29 @@ #define PY_ARRAY_UNIQUE_SYMBOL PyArray_API #include "numpy/arrayobject.h" -%(include_list)s -%(cppmacro_list)s +%(header_list)s + %(typedef_list)s + +%(extern_list)s + +%(c_code_list)s + +%(capi_code_list)s + %(objdecl_list)s -%(extern_list)s -%(c_function_list)s -%(capi_function_list)s + static PyObject *f2py_module; + static PyMethodDef f2py_module_methods[] = { %(module_method_list)s {NULL,NULL,0,NULL} }; + PyMODINIT_FUNC init%(modulename)s(void) { f2py_module = Py_InitModule("%(modulename)s", f2py_module_methods); - %(initialize_interface_list)s + import_array(); + %(module_init_list)s if (PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "can\'t initialize module %(modulename)s"); return; @@ -133,31 +62,49 @@ def __init__(self, modulename): WrapperBase.__init__(self) self.modulename = modulename - self.include_list = [] + #self.include_list = [] + #self.cppmacro_list = [] + + self.header_list = [] self.typedef_list = [] - self.cppmacro_list = [] + self.extern_list = [] self.objdecl_list = [] - self.c_function_list = [] - self.extern_list = [] - self.capi_function_list = [] + self.c_code_list = [] + self.capi_code_list = [] + self.module_method_list = [] - self.initialize_interface_list = [] + self.module_init_list = [] + self.fortran_code_list = [] - self.defined_types = [] - self.defined_macros = [] - self.defined_c_functions = [] - self.defined_typedefs = [] + #self.defined_types = [] + #self.defined_macros = [] + #self.defined_c_functions = [] + #self.defined_typedefs = [] + + self.list_names = ['header', 'typedef', 'extern', 'objdecl', + 'c_code','capi_code','module_method','module_init', + 'fortran_code'] + return def add(self, block): if isinstance(block, BeginSource): - for name, subblock in block.a.external_subprogram.items(): - self.add(subblock) + for name, moduleblock in block.a.module.items(): + self.add(moduleblock) + #for name, subblock in block.a.external_subprogram.items(): + # self.add(subblock) elif isinstance(block, (Subroutine, Function)): self.info('Generating interface for %s' % (block.name)) f = PythonCAPIFunction(self, block) - f.fill() + f.fill() + elif isinstance(block, Module): + for name,declblock in block.a.type_decls.items(): + self.add(declblock) + elif isinstance(block, TypeDecl): + PythonCAPIDerivedType(self, block) + elif isinstance(block, tuple(declaration_type_spec)): + PythonCAPIIntrinsicType(self, block) else: raise NotImplementedError,`block.__class__.__name__` return @@ -167,155 +114,306 @@ def fortran_code(self): return self.apply_attributes(self.main_fortran_template) - def add_c_function(self, name): - if name not in self.defined_c_functions: - body = self.get_resource_content(name,'.c') - if body is None: - self.warning('Failed to get C function %r content.' % (name)) - return - for d in self.get_dependencies(body): - if d.endswith('.cpp'): - self.add_cppmacro(d[:-4]) - elif d.endswith('.c'): - self.add_c_function(d[:-2]) - else: - self.warning('Unknown dependence: %r.' % (d)) - self.defined_c_functions.append(name) - self.c_function_list.append(body) + def add_subroutine(self, block): + raise + f = PythonCAPIFunction(self, block) + f.fill() return - def add_cppmacro(self, name): - if name not in self.defined_macros: - body = self.get_resource_content(name,'.cpp') - if body is None: - self.warning('Failed to get CPP macro %r content.' % (name)) - return - for d in self.get_dependencies(body): - if d.endswith('.cpp'): - self.add_cppmacro(d[:-4]) - elif d.endswith('.c'): - self.add_c_function(d[:-2]) - else: - self.warning('Unknown dependence: %r.' % (d)) - self.defined_macros.append(name) - self.cppmacro_list.append(body) - return - def add_type(self, typedecl): - typewrap = TypeDecl(self, typedecl) - typename = typewrap.typename - if typename not in self.defined_types: - self.defined_types.append(typename) - typewrap.fill() - return typename - def add_typedef(self, name, code): - if name not in self.defined_typedefs: - self.typedef_list.append(code) - self.defined_types.append(name) - return + +class PythonCAPIIntrinsicType(WrapperBase): + """ + Fortran intrinsic type hooks. + """ + _defined_types = [] + def __init__(self, parent, typedecl): + WrapperBase.__init__(self) + self.name = name = typedecl.name + if name in self._defined_types: + return + self._defined_types.append(name) - def add_include(self, include): - if include not in self.include_list: - self.include_list.append(include) - return + self.ctype = ctype = typedecl.get_c_type() - def add_subroutine(self, block): - f = PythonCAPIFunction(self, block) - f.fill() + if ctype.startswith('npy_'): + from generate_pyobj_tofrom_funcs import pyobj_to_npy_scalar + d = pyobj_to_npy_scalar(ctype) + for v in d.values(): + self.resolve_dependencies(parent, v) + for k,v in d.items(): + l = getattr(parent, k+'_list') + l.append(v) + return + + if not ctype.startswith('f2py_type_'): + raise NotImplementedError,`name,ctype` + + for n in parent.list_names: + l = getattr(parent,n + '_list') + l.append(self.apply_attributes(getattr(self, n+'_template',''))) + return - def generate_pyobj_to_ctype_c(self, ctype): - if ctype.startswith('npy_int'): - ctype_bits = int(ctype[7:]) - return ''' -/* depends: pyobj_to_long.c, pyobj_to_npy_longlong.c */ -#if NPY_BITSOF_LONG == %(ctype_bits)s -#define pyobj_to_%(ctype)s pyobj_to_long -#else -#if NPY_BITSOF_LONG > %(ctype_bits)s -static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { - long tmp; - if (pyobj_to_long(obj,&tmp)) { - *value = (%(ctype)s)tmp; - return 1; - } - return 0; +class PythonCAPIDerivedType(WrapperBase): + """ + Fortran 90 derived type hooks. + """ + + header_template = '''\ +#define %(oname)sObject_Check(obj) \\ + PyObject_TypeCheck((PyObject*)obj, &%(oname)sType) +#define %(init_func)s_f \\ + F_FUNC(%(init_func)s,%(INIT_FUNC)s) +''' + + typedef_template = '''\ +typedef void * %(ctype)s; +typedef struct { + PyObject_HEAD + %(ptrstruct_list)s + %(ctype)s data; +} %(oname)sObject; +''' + + extern_template = '''\ +static PyTypeObject %(oname)sType; +''' + + objdecl_template = '''\ +static PyMethodDef %(oname)s_methods[] = { + %(type_method_list)s + {NULL} /* Sentinel */ +}; + +static PyGetSetDef %(oname)s_getseters[] = { + %(type_getseters_list)s + {NULL} /* Sentinel */ +}; + +static PyTypeObject %(oname)sType = { + PyObject_HEAD_INIT(NULL) + 0, /*ob_size*/ + "%(name)s", /*tp_name*/ + sizeof(%(oname)sObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)%(oname)s_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + %(oname)s_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "Fortran derived type %(name)s objects", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + %(oname)s_methods, /* tp_methods */ + 0 /*%(oname)s_members*/, /* tp_members */ + %(oname)s_getseters, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)%(oname)s_init, /* tp_init */ + 0, /* tp_alloc */ + %(oname)s_new, /* tp_new */ +}; +''' + + module_init_template = '''\ +if (PyType_Ready(&%(oname)sType) < 0) + return; +PyModule_AddObject(f2py_module, "%(name)s", + (PyObject *)&%(oname)sType); +''' + + c_code_template = '''\ +static void %(init_func)s_c( + %(init_func_c_arg_clist)s) { + %(init_func_c_body_list)s } -#else -static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { - npy_longlong tmp; - if (pyobj_to_npy_longlong(obj,&tmp)) { - *value = (%(ctype)s)tmp; - return 1; - } - return 0; +''' + + capi_code_template = '''\ +static void %(oname)s_dealloc(%(oname)sObject* self) { + PyMem_Free(self->data); + self->ob_type->tp_free((PyObject*)self); } -#endif -#endif -''' % (locals()) - elif ctype.startswith('npy_float'): - ctype_bits = int(ctype[9:]) - return ''' -/* depends: pyobj_to_double.c */ -#if NPY_BITSOF_DOUBLE == %(ctype_bits)s -#define pyobj_to_%(ctype)s pyobj_to_double -#else -#if NPY_BITSOF_DOUBLE > %(ctype_bits)s -static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { - double tmp; - if (pyobj_to_double(obj,&tmp)) { - *value = (%(ctype)s)tmp; + +static int pyobj_to_%(ctype)s(PyObject *obj, + %(ctype)s* value_ptr) { + if (%(oname)sObject_Check(obj)) { + if (!memcpy(value_ptr,((%(oname)sObject *)obj)->data, %(byte_size)s)) { + PyErr_SetString(PyExc_MemoryError, + "failed to copy %(name)s instance memory to %(ctype)s object."); + } return 1; } return 0; } -#else -#error, "NOTIMPLEMENTED pyobj_to_%(ctype)s" -#endif -#endif -''' % (locals()) - elif ctype.startswith('npy_complex'): - ctype_bits = int(ctype[11:]) - cfloat_bits = ctype_bits/2 - return ''' -/* depends: pyobj_to_Py_complex.c */ -#if NPY_BITSOF_DOUBLE >= %(cfloat_bits)s -static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { - Py_complex c; - if (pyobj_to_Py_complex(obj,&c)) { - (*value).real = (npy_float%(cfloat_bits)s)c.real; - (*value).imag = (npy_float%(cfloat_bits)s)c.imag; - return 1; + +static PyObject* pyobj_from_%(ctype)s(%(ctype)s* value_ptr) { + %(oname)sObject* obj = (%(oname)sObject*)(%(oname)sType.tp_alloc(&%(oname)sType, 0)); + if (obj == NULL) + return NULL; + obj->data = PyMem_Malloc(%(byte_size)s); + if (obj->data == NULL) { + Py_DECREF(obj); + return PyErr_NoMemory(); } - return 0; + if (value_ptr) { + if (!memcpy(obj->data, value_ptr, %(byte_size)s)) { + PyErr_SetString(PyExc_MemoryError, + "failed to copy %(ctype)s object memory to %(name)s instance."); + } + } + %(init_func)s_f(%(init_func)s_c, obj, obj->data); + return (PyObject*)obj; } -#else -#error, "NOTIMPLEMENTED pyobj_to_%(ctype)s" -#endif -''' % (locals()) - elif ctype.startswith('f2py_string'): - ctype_bits = int(ctype[11:]) - ctype_bytes = ctype_bits / CHAR_BIT - self.add_typedef('f2py_string','typedef char * f2py_string;') - self.add_typedef(ctype,'typedef struct { char data[%s]; } %s;' % (ctype_bytes,ctype)) - self.add_include('#include ') - return ''' -/* depends: pyobj_to_string_len.c */ -static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { - return pyobj_to_string_len(obj, (f2py_string*)value, %(ctype_bytes)s); + +static PyObject * %(oname)s_new(PyTypeObject *type, + PyObject *args, PyObject *kwds) +{ + return pyobj_from_%(ctype)s(NULL); } -''' % (locals()) - elif ctype.startswith('f2py_type_'): - ctype_bits = int(ctype.split('_')[-1]) - ctype_bytes = ctype_bits / CHAR_BIT - self.add_typedef(ctype,'typedef struct { char data[%s]; } %s;' % (ctype_bytes,ctype)) - return ''' -static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { - return pyobj_to_string_len(obj, (f2py_string*)value, %(ctype_bytes)s); + +static int %(oname)s_init(%(oname)sObject *self, + PyObject *capi_args, PyObject *capi_kwds) +{ + return !PyArg_ParseTuple(capi_args,"%(attr_format_elist)s" + %(attr_init_clist)s); } -''' % (locals()) - + +static PyObject * %(oname)s_as_tuple(%(oname)sObject * self) { + return Py_BuildValue("%(as_tuple_format_elist)s" + %(as_tuple_arg_clist)s); +} + +static PyObject * %(oname)s_repr(PyObject * self) { + PyObject* r = PyString_FromString("%(name)s("); + PyString_ConcatAndDel(&r, PyObject_Repr(%(oname)s_as_tuple((%(oname)sObject*)self))); + PyString_ConcatAndDel(&r, PyString_FromString(")")); + return r; +} + +%(getset_func_list)s +''' + + fortran_code_template = '''\ + subroutine %(init_func)s(init_func_c, self, obj) + %(use_stmt_list)s + external init_func_c +! self is %(oname)sObject + external self + %(ftype)s obj + call init_func_c(%(init_func_f_arg_clist)s) + end +''' + + #module_method_template = '''''' + + _defined_types = [] + def __init__(self, parent, typedecl): + WrapperBase.__init__(self) + name = typedecl.name + if name in self._defined_types: + return + self._defined_types.append(name) + + self.name = name + self.oname = oname = 'f2py_' + name + self.ctype = typedecl.get_c_type() + self.ctype_ptrs = self.ctype + '_ptrs' + self.ftype = typedecl.get_f_type() + self.byte_size = byte_size = typedecl.get_bit_size() / CHAR_BIT + WrapperCPPMacro(parent, 'F_FUNC') + + self.init_func_f_arg_list = ['self'] + self.init_func_c_arg_list = ['%sObject *self' % (self.oname)] + self.init_func_c_body_list = [] + self.ptrstruct_list = [] + self.attr_decl_list = [] + self.attr_format_list = [] + self.attr_init_list = [] + self.as_tuple_format_list = [] + self.as_tuple_arg_list = [] + self.getset_func_list = [] + self.type_getseters_list = [] + for n in typedecl.a.component_names: + v = typedecl.a.components[n] + t = v.get_typedecl() + ct = t.get_c_type() + on = 'f2py_' + t.name + parent.add(t) + self.ptrstruct_list.append('%s* %s_ptr;' % (ct, n)) + self.init_func_f_arg_list.append('obj %% %s' % (n)) + self.init_func_c_arg_list.append('\n%s * %s_ptr' % (ct, n)) + self.init_func_c_body_list.append('''\ +if (!((void*)%(n)s_ptr >= self->data + && (void*)%(n)s_ptr < self->data + %(byte_size)s )) + fprintf(stderr,"INCONSISTENCY IN %(name)s WRAPPER: " + "self->data=%%p <= %(n)s_ptr=%%p < self->data+%(byte_size)s=%%p\\n", + self->data, %(n)s_ptr, self->data + %(byte_size)s); +self->%(n)s_ptr = %(n)s_ptr; +''' % (locals())) + self.attr_format_list.append('O&') + WrapperCCode(parent, 'pyobj_to_%s' % (ct)) + self.attr_init_list.append('\npyobj_to_%s, self->%s_ptr' % (ct,n)) + WrapperCCode(parent, 'pyobj_from_%s' % (ct)) + self.as_tuple_format_list.append('O&') + self.as_tuple_arg_list.append('\npyobj_from_%s, self->%s_ptr' % (ct, n)) + self.getset_func_list.append('''\ +static PyObject * %(oname)s_get_%(n)s(%(oname)sObject *self, + void *closure) { + return pyobj_from_%(ct)s(self->%(n)s_ptr); +} +static int %(oname)s_set_%(n)s(%(oname)sObject *self, + PyObject *value, void *closure) +{ + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, + "Cannot delete %(name)s attribute %(n)s"); + return -1; + } + if (pyobj_to_%(ct)s(value, self->%(n)s_ptr)) + return 0; + return -1; +} +''' % (locals())) + self.type_getseters_list.append('{"%(n)s",(getter)%(oname)s_get_%(n)s, (setter)%(oname)s_set_%(n)s,\n "component %(n)s",NULL},' % (locals())) + if self.attr_init_list: self.attr_init_list.insert(0,'') + if self.as_tuple_arg_list: self.as_tuple_arg_list.insert(0,'') + self.init_func = self.ctype + '_init' + self.INIT_FUNC = self.init_func.upper() + + self.type_method_list = [] + self.type_method_list.append('{"as_tuple",(PyCFunction)%(oname)s_as_tuple,METH_NOARGS,\n "Return %(name)s components as tuple."},' % (self.__dict__)) + self.cname = typedecl.get_c_name() + + self.use_stmt_list = [] + if isinstance(typedecl.parent, Module): + self.use_stmt_list.append('use %s' % (typedecl.parent.name)) + + for n in parent.list_names: + l = getattr(parent,n + '_list') + l.append(self.apply_attributes(getattr(self, n+'_template',''))) + return + class PythonCAPIFunction(WrapperBase): capi_function_template = ''' static char f2py_doc_%(function_name)s[] = "%(function_doc)s"; @@ -412,15 +510,15 @@ self.parent.pyarg_format_list.append('O&') self.parent.keyword_list.append('"%s"' % (self.name)) - self.grand_parent.add_c_function('pyobj_to_%s' % (self.ctype)) return -class TypeDecl(WrapperBase): + +class TypeDecl2(WrapperBase): cppmacro_template = '''\ #define initialize_%(typename)s_interface F_FUNC(initialize_%(typename)s_interface_f,INITIALIZE_%(TYPENAME)s_INTERFACE_F)\ ''' typedef_template = '''\ -typedef struct { char data[%(byte_size)s] } %(ctype)s; +typedef struct { char data[%(byte_size)s]; } %(ctype)s; typedef %(ctype)s (*create_%(typename)s_functype)(void); typedef void (*initialize_%(typename)s_interface_functype)(create_%(typename)s_functype);\ ''' @@ -449,6 +547,14 @@ call init_c(create_%(typename)s_object_f) end ''' + pyobj_to_type_template = ''' + static int pyobj_to_%(ctype)s(PyObject *obj, %(ctype)s* value) { + if (PyTuple_Check(obj)) { + return 0; + } + return 0; + } +''' def __init__(self, parent, typedecl): WrapperBase.__init__(self) @@ -464,12 +570,17 @@ def fill(self): ctype =self.typedecl.get_c_type() - if ctype.startswith('npy_'): - pass - elif ctype.startswith('f2py_string'): - pass - elif ctype.startswith('f2py_type'): - pass + if ctype.startswith('npy_') or ctype.startswith('f2py_string'): + # wrappers are defined via pyobj_to_* functions + self.parent.add_c_function('pyobj_to_%s' % (self.ctype)) + return + if ctype.startswith('f2py_type'): + return + self.parent.add_typedef(ctype, + self.apply_attributes('typedef struct { char data[%(byte_size)s]; } %(ctype)s;')) + self.parent.add_c_function(self.apply_attributes('pyobj_to_%(ctype)s'), + self.apply_attributes(self.pyobj_to_type_template) + ) else: self.parent.typedef_list.append(self.apply_attributes(self.typedef_template)) self.parent.objdecl_list.append(self.apply_attributes(self.objdecl_template)) @@ -490,9 +601,13 @@ stmt = str2stmt(""" module rat integer :: i + type info + integer flag + end type info type rational integer n - integer*8 d + integer d + type(info) i end type rational end module rat subroutine foo(a) @@ -508,16 +623,20 @@ foo_code = """! -*- f90 -*- module rat + type info + integer flag + end type info type rational - integer d,n + integer n,d + type(info) i end type rational end module rat - subroutine foo(a,b,c) + subroutine foo(a,b) use rat integer a - character*5 b - type(rational) c - print*,'a=',a,b,c + !character*5 b + type(rational) b + print*,'a=',a,b end """ @@ -556,8 +675,31 @@ setup(configuration=configuration) ''') f.close() - print get_char_bit() + #print get_char_bit() os.system('python foo_setup.py config_fc --fcompiler=gnu95 build build_ext --inplace') import foo - print dir(foo) - foo.foo(2,"abcdefg") + #print foo.__doc__ + #print dir(foo) + #print foo.info.__doc__ + #print foo.rational.__doc__ + #print dir(foo.rational) + i = foo.info(7) + #print i #,i.as_tuple() + #print 'i.flag=',i.flag + r = foo.rational(2,3,i) + print r + j = r.i + print 'r.i.flag=',(r.i).flag + print 'j.flag=',j.flag + #print 'r=',r + sys.exit() + n,d,ii = r.as_tuple() + n += 1 + print n,d + print r + #foo.foo(2,r) + print r.n, r.d + r.n = 5 + print r + r.n -= 1 + print r Modified: trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/src/pyobj_to_Py_complex.c 2006-09-30 21:02:52 UTC (rev 3236) @@ -33,7 +33,8 @@ } } if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C Py_complex."); + PyErr_SetString(PyExc_TypeError, + "Failed to convert python object to C Py_complex."); } return 0; } Modified: trunk/numpy/f2py/lib/src/pyobj_to_long.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_long.c 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/src/pyobj_to_long.c 2006-09-30 21:02:52 UTC (rev 3236) @@ -25,7 +25,8 @@ Py_DECREF(tmp); } if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C long."); + PyErr_SetString(PyExc_TypeError, + "Failed to convert python object to C long."); } return 0; } Modified: trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/src/pyobj_to_npy_longlong.c 2006-09-30 21:02:52 UTC (rev 3236) @@ -29,7 +29,8 @@ Py_DECREF(tmp); } if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C npy_longlong."); + PyErr_SetString(PyExc_TypeError, + "Failed to convert python object to C npy_longlong."); } return 0; } Modified: trunk/numpy/f2py/lib/src/pyobj_to_string_len.c =================================================================== --- trunk/numpy/f2py/lib/src/pyobj_to_string_len.c 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/src/pyobj_to_string_len.c 2006-09-30 21:02:52 UTC (rev 3236) @@ -4,7 +4,8 @@ return 1; } if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "Failed to convert python object to C f2py_string."); + PyErr_SetString(PyExc_TypeError, + "Failed to convert python object to C f2py_string."); } return 0; } Modified: trunk/numpy/f2py/lib/typedecl_statements.py =================================================================== --- trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/typedecl_statements.py 2006-09-30 21:02:52 UTC (rev 3236) @@ -470,14 +470,10 @@ raise NotImplementedError,`self.__class__.__name__` def get_bit_size(self): - type_decl = self.get_type_decl(self.name) - s = 0 - for name,var in type_decl.a.components.items(): - s += var.get_bit_size() - return s + return self.get_type_decl(self.name).get_bit_size() def get_c_type(self): - return 'f2py_type_%s_%s' % (self.name, self.get_bit_size()) + return self.get_type_decl(self.name).get_c_type() TypeStmt = Type Added: trunk/numpy/f2py/lib/wrapper_base.py =================================================================== --- trunk/numpy/f2py/lib/wrapper_base.py 2006-09-29 18:02:25 UTC (rev 3235) +++ trunk/numpy/f2py/lib/wrapper_base.py 2006-09-30 21:02:52 UTC (rev 3236) @@ -0,0 +1,162 @@ + +import os +import sys +import re +__all__ = ['WrapperBase','WrapperCPPMacro','WrapperCCode'] + +class WrapperBase: + + def __init__(self): + self.srcdir = os.path.join(os.path.dirname(__file__),'src') + return + def warning(self, message): + print >> sys.stderr, message + def info(self, message): + print >> sys.stderr, message + + def get_resource_content(self, name, ext): + if name.startswith('pyobj_to_'): + try: + return self.generate_pyobj_to_ctype_c(name[9:]) + except NotImplementedError: + pass + elif name.startswith('pyobj_from_'): + try: + return self.generate_pyobj_from_ctype_c(name[11:]) + except NotImplementedError: + pass + generator_mth_name = 'generate_' + name + ext.replace('.','_') + generator_mth = getattr(self, generator_mth_name, lambda : None) + body = generator_mth() + if body is not None: + return body + fn = os.path.join(self.srcdir,name+ext) + if os.path.isfile(fn): + f = open(fn,'r') + body = f.read() + f.close() + return body + self.warning('No such file: %r' % (fn)) + return + + def get_dependencies(self, code): + l = [] + for uses in re.findall(r'(?<=depends:)([,\w\s.]+)', code, re.I): + for use in uses.split(','): + use = use.strip() + if not use: continue + l.append(use) + return l + + def resolve_dependencies(self, parent, body): + assert isinstance(body, str),type(body) + for d in self.get_dependencies(body): + if d.endswith('.cpp'): + WrapperCPPMacro(parent, d[:-4]) + elif d.endswith('.c'): + WrapperCCode(parent, d[:-2]) + else: + self.warning('Unknown dependence: %r.' % (d)) + return + + def apply_attributes(self, template): + """ + Apply instance attributes to template string. + + Replace rules for attributes: + _list - will be joined with newline + _clist - _list will be joined with comma + _elist - _list will be joined + ..+.. - attributes will be added + [..] - will be evaluated + """ + replace_names = set(re.findall(r'[ ]*%\(.*?\)s', template)) + d = {} + for name in replace_names: + tab = ' ' * (len(name)-len(name.lstrip())) + name = name.lstrip()[2:-2] + names = name.split('+') + joinsymbol = '\n' + attrs = None + for n in names: + realname = n.strip() + if n.endswith('_clist'): + joinsymbol = ', ' + realname = realname[:-6] + '_list' + elif n.endswith('_elist'): + joinsymbol = '' + realname = realname[:-6] + '_list' + if hasattr(self, realname): + attr = getattr(self, realname) + elif realname.startswith('['): + attr = eval(realname) + else: + self.warning('Undefined %r attribute: %r' % (self.__class__.__name__, realname)) + continue + if attrs is None: + attrs = attr + else: + attrs += attr + if isinstance(attrs, list): + attrs = joinsymbol.join(attrs) + d[name] = str(attrs).replace('\n','\n'+tab) + return template % d + +class WrapperCPPMacro(WrapperBase): + """ + CPP macros + """ + _defined_macros = [] + def __init__(self, parent, name): + WrapperBase.__init__(self) + if name in self._defined_macros: + return + self._defined_macros.append(name) + + body = self.get_resource_content(name,'.cpp') + if body is None: + self.warning('Failed to get CPP macro %r content.' % (name)) + return + self.resolve_dependencies(parent, body) + parent.header_list.append(body) + return + +class WrapperCCode(WrapperBase): + """ + C code + """ + _defined_codes = [] + def __init__(self, parent, name): + WrapperBase.__init__(self) + if name in self._defined_codes: + return + self._defined_codes.append(name) + + body = self.get_resource_content(name,'.c') + if body is None: + self.warning('Failed to get C code %r content.' % (name)) + return + if isinstance(body, dict): + for k,v in body.items(): + self.resolve_dependencies(parent, v) + for k,v in body.items(): + l = getattr(parent,k+'_list') + l.append(v) + else: + self.resolve_dependencies(parent, body) + parent.c_code_list.append(body) + return + + def generate_pyobj_to_ctype_c(self, ctype): + from generate_pyobj_tofrom_funcs import pyobj_to_npy_scalar, pyobj_to_f2py_string + if ctype.startswith('npy_'): + return pyobj_to_npy_scalar(ctype) + elif ctype.startswith('f2py_string'): + return pyobj_to_f2py_string(ctype) + raise NotImplementedError,`ctype` + + def generate_pyobj_from_ctype_c(self, ctype): + from generate_pyobj_tofrom_funcs import pyobj_from_npy_scalar + if ctype.startswith('npy_'): + return pyobj_from_npy_scalar(ctype) + raise NotImplementedError,`ctype` From numpy-svn at scipy.org Sat Sep 30 19:33:29 2006 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 30 Sep 2006 18:33:29 -0500 (CDT) Subject: [Numpy-svn] r3237 - in trunk/numpy/core: src tests Message-ID: <20060930233329.2DDD839C012@new.scipy.org> Author: oliphant Date: 2006-09-30 18:33:23 -0500 (Sat, 30 Sep 2006) New Revision: 3237 Modified: trunk/numpy/core/src/arraytypes.inc.src trunk/numpy/core/tests/test_multiarray.py Log: Fix setting unicode/string arrays with 0-d arrays of type unicode and/or string. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2006-09-30 21:02:52 UTC (rev 3236) +++ trunk/numpy/core/src/arraytypes.inc.src 2006-09-30 23:33:23 UTC (rev 3237) @@ -313,11 +313,13 @@ #endif if (!PyString_Check(op) && !PyUnicode_Check(op) && - PySequence_Check(op)) { + PySequence_Check(op) && PySequence_Size(op) > 0) { PyErr_SetString(PyExc_ValueError, "setting an array element with a sequence"); return -1; } + /* Sequence_Size might have returned an error */ + if (PyErr_Occurred()) PyErr_Clear(); if ((temp=PyObject_Unicode(op)) == NULL) return -1; ptr = PyUnicode_AS_UNICODE(temp); if ((ptr == NULL) || (PyErr_Occurred())) { @@ -375,12 +377,14 @@ Py_ssize_t len; PyObject *temp=NULL; - if (!PyString_Check(op) && !PyUnicode_Check(op) && - PySequence_Check(op)) { + if (!PyString_Check(op) && !PyUnicode_Check(op) && + PySequence_Check(op) && PySequence_Size(op) > 0) { PyErr_SetString(PyExc_ValueError, "setting an array element with a sequence"); return -1; } + /* Sequence_Size might have returned an error */ + if (PyErr_Occurred()) PyErr_Clear(); if ((temp = PyObject_Str(op)) == NULL) return -1; if (PyString_AsStringAndSize(temp, &ptr, &len) == -1) { Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2006-09-30 21:02:52 UTC (rev 3236) +++ trunk/numpy/core/tests/test_multiarray.py 2006-09-30 23:33:23 UTC (rev 3237) @@ -166,7 +166,7 @@ x[i] = v self.failUnlessRaises(IndexError, assign, a, 0, 42) self.failUnlessRaises(IndexError, assign, b, 0, '') - self.failUnlessRaises(TypeError, assign, a, (), '') + self.failUnlessRaises(ValueError, assign, a, (), '') def check_newaxis(self): a,b = self.d