From 442b49a5a38fc2e50770687359b9dbd733d7635c Mon Sep 17 00:00:00 2001 From: Jacob Schreiber Date: Wed, 16 Sep 2015 10:22:54 +0200 Subject: [PATCH] ENH criterion file cleaned up --- sklearn/ensemble/_gradient_boosting.c | 6 + sklearn/tree/_criterion.c | 6969 +++++++++---------------- sklearn/tree/_criterion.pxd | 7 + sklearn/tree/_criterion.pyx | 592 +-- sklearn/tree/_splitter.c | 2982 +++-------- sklearn/tree/_tree.c | 2570 +++------ sklearn/tree/_utils.c | 1789 ++----- 7 files changed, 4892 insertions(+), 10023 deletions(-) diff --git a/sklearn/ensemble/_gradient_boosting.c b/sklearn/ensemble/_gradient_boosting.c index c8da01b72911a..3eb61704c3659 100644 --- a/sklearn/ensemble/_gradient_boosting.c +++ b/sklearn/ensemble/_gradient_boosting.c @@ -1092,6 +1092,12 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion { double weighted_n_node_samples; double weighted_n_left; double weighted_n_right; + double *node_sum; + double *node_sum_left; + double *node_sum_right; + double yw_sq_sum; + double yw_sq_sum_left; + double yw_sq_sum_right; }; diff --git a/sklearn/tree/_criterion.c b/sklearn/tree/_criterion.c index b2f5e6954a519..adba0059c1d04 100644 --- a/sklearn/tree/_criterion.c +++ b/sklearn/tree/_criterion.c @@ -1,13 +1,25 @@ -/* Generated by Cython 0.23 */ +/* Generated by Cython 0.22.1 */ #define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_23" +#define CYTHON_ABI "0_22_1" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -42,9 +54,6 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 -#define CYTHON_USE_PYLONG_INTERNALS 1 -#endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif @@ -52,12 +61,12 @@ #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif @@ -75,7 +84,7 @@ #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -94,10 +103,12 @@ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) + #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) + #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) @@ -165,32 +176,6 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) - #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ @@ -202,20 +187,46 @@ typedef struct { #define CYTHON_INLINE #endif #endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif #endif -#include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif +#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(T& ref) : ptr(&ref) { } + T *operator->() { return ptr; } + operator T&() { return *ptr; } + private: + T *ptr; +}; +#endif #if PY_MAJOR_VERSION >= 3 @@ -234,6 +245,10 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #endif +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include #define __PYX_HAVE__sklearn__tree___criterion #define __PYX_HAVE_API__sklearn__tree___criterion #include "string.h" @@ -277,34 +292,16 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) @@ -339,9 +336,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); @@ -511,7 +507,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -520,7 +516,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -529,7 +525,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -538,7 +534,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":729 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -547,7 +543,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -556,7 +552,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -565,7 +561,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -574,7 +570,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":736 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -583,7 +579,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -592,7 +588,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":741 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -601,7 +597,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -610,7 +606,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -619,7 +615,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -628,7 +624,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -637,7 +633,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -646,7 +642,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -655,7 +651,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -664,7 +660,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -673,7 +669,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -682,7 +678,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -691,7 +687,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -700,7 +696,7 @@ typedef npy_double __pyx_t_5numpy_double_t; */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* "_utils.pxd":13 +/* "sklearn/tree/_utils.pxd":13 * cimport numpy as np * * ctypedef np.npy_float32 DTYPE_t # Type of X # <<<<<<<<<<<<<< @@ -709,7 +705,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; */ typedef npy_float32 __pyx_t_7sklearn_4tree_6_utils_DTYPE_t; -/* "_utils.pxd":14 +/* "sklearn/tree/_utils.pxd":14 * * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight # <<<<<<<<<<<<<< @@ -718,7 +714,7 @@ typedef npy_float32 __pyx_t_7sklearn_4tree_6_utils_DTYPE_t; */ typedef npy_float64 __pyx_t_7sklearn_4tree_6_utils_DOUBLE_t; -/* "_utils.pxd":15 +/* "sklearn/tree/_utils.pxd":15 * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters # <<<<<<<<<<<<<< @@ -727,7 +723,7 @@ typedef npy_float64 __pyx_t_7sklearn_4tree_6_utils_DOUBLE_t; */ typedef npy_intp __pyx_t_7sklearn_4tree_6_utils_SIZE_t; -/* "_utils.pxd":16 +/* "sklearn/tree/_utils.pxd":16 * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer # <<<<<<<<<<<<<< @@ -736,7 +732,7 @@ typedef npy_intp __pyx_t_7sklearn_4tree_6_utils_SIZE_t; */ typedef npy_int32 __pyx_t_7sklearn_4tree_6_utils_INT32_t; -/* "_utils.pxd":17 +/* "sklearn/tree/_utils.pxd":17 * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer # <<<<<<<<<<<<<< @@ -821,7 +817,7 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion; struct __pyx_obj_7sklearn_4tree_10_criterion_MSE; struct __pyx_obj_7sklearn_4tree_10_criterion_FriedmanMSE; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -830,7 +826,7 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_FriedmanMSE; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -839,7 +835,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -848,7 +844,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -859,7 +855,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_t_7sklearn_4tree_6_utils_StackRecord; struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord; -/* "_utils.pxd":19 +/* "sklearn/tree/_utils.pxd":19 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef enum: # <<<<<<<<<<<<<< @@ -870,7 +866,7 @@ enum { __pyx_e_7sklearn_4tree_6_utils_RAND_R_MAX = 0x7FFFFFFF }; -/* "_utils.pxd":58 +/* "sklearn/tree/_utils.pxd":58 * * # A record on the stack for depth-first tree growing * cdef struct StackRecord: # <<<<<<<<<<<<<< @@ -887,7 +883,7 @@ struct __pyx_t_7sklearn_4tree_6_utils_StackRecord { __pyx_t_7sklearn_4tree_6_utils_SIZE_t n_constant_features; }; -/* "_utils.pxd":84 +/* "sklearn/tree/_utils.pxd":84 * * # A record on the frontier for best-first tree growing * cdef struct PriorityHeapRecord: # <<<<<<<<<<<<<< @@ -907,7 +903,7 @@ struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord { double improvement; }; -/* "_utils.pxd":67 +/* "sklearn/tree/_utils.pxd":67 * SIZE_t n_constant_features * * cdef class Stack: # <<<<<<<<<<<<<< @@ -923,7 +919,7 @@ struct __pyx_obj_7sklearn_4tree_6_utils_Stack { }; -/* "_utils.pxd":96 +/* "sklearn/tree/_utils.pxd":96 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -962,10 +958,16 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion { double weighted_n_node_samples; double weighted_n_left; double weighted_n_right; + double *node_sum_total; + double *node_sum_left; + double *node_sum_right; + double sq_sum_total; + double sq_sum_left; + double sq_sum_right; }; -/* "sklearn/tree/_criterion.pyx":192 +/* "sklearn/tree/_criterion.pyx":205 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< @@ -976,13 +978,10 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion { struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion __pyx_base; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *n_classes; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t label_count_stride; - double *label_count_left; - double *label_count_right; - double *label_count_total; }; -/* "sklearn/tree/_criterion.pyx":516 +/* "sklearn/tree/_criterion.pyx":490 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -994,7 +993,7 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_Entropy { }; -/* "sklearn/tree/_criterion.pyx":620 +/* "sklearn/tree/_criterion.pyx":569 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1006,7 +1005,7 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_Gini { }; -/* "sklearn/tree/_criterion.pyx":729 +/* "sklearn/tree/_criterion.pyx":661 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1015,15 +1014,10 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_Gini { */ struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion { struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion __pyx_base; - double *sq_sum_tmp; - double *sq_sum_total; - double *sum_left; - double *sum_right; - double *sum_total; }; -/* "sklearn/tree/_criterion.pyx":963 +/* "sklearn/tree/_criterion.pyx":862 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1035,7 +1029,7 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_MSE { }; -/* "sklearn/tree/_criterion.pyx":1079 +/* "sklearn/tree/_criterion.pyx":932 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1048,7 +1042,7 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_FriedmanMSE { -/* "_utils.pxd":67 +/* "sklearn/tree/_utils.pxd":67 * SIZE_t n_constant_features * * cdef class Stack: # <<<<<<<<<<<<<< @@ -1064,7 +1058,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack { static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7sklearn_4tree_6_utils_Stack; -/* "_utils.pxd":96 +/* "sklearn/tree/_utils.pxd":96 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -1102,7 +1096,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *__pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion; -/* "sklearn/tree/_criterion.pyx":192 +/* "sklearn/tree/_criterion.pyx":205 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1116,7 +1110,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_ClassificationCriterion { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_vtabptr_7sklearn_4tree_10_criterion_ClassificationCriterion; -/* "sklearn/tree/_criterion.pyx":516 +/* "sklearn/tree/_criterion.pyx":490 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1130,7 +1124,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Entropy { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Entropy *__pyx_vtabptr_7sklearn_4tree_10_criterion_Entropy; -/* "sklearn/tree/_criterion.pyx":620 +/* "sklearn/tree/_criterion.pyx":569 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1144,7 +1138,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Gini { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Gini *__pyx_vtabptr_7sklearn_4tree_10_criterion_Gini; -/* "sklearn/tree/_criterion.pyx":729 +/* "sklearn/tree/_criterion.pyx":661 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1158,7 +1152,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_RegressionCriterion { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_vtabptr_7sklearn_4tree_10_criterion_RegressionCriterion; -/* "sklearn/tree/_criterion.pyx":963 +/* "sklearn/tree/_criterion.pyx":862 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1172,7 +1166,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_MSE { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_MSE *__pyx_vtabptr_7sklearn_4tree_10_criterion_MSE; -/* "sklearn/tree/_criterion.pyx":1079 +/* "sklearn/tree/_criterion.pyx":932 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1202,19 +1196,19 @@ static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_FriedmanMSE *__pyx_vt static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ } #else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif - #define __Pyx_RefNannyFinishContext()\ + #define __Pyx_RefNannyFinishContext() \ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) @@ -1237,13 +1231,13 @@ static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_FriedmanMSE *__pyx_vt #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) @@ -1270,8 +1264,8 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, @@ -1337,8 +1331,6 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable); static void* __Pyx_GetVtable(PyObject *dict); -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - typedef struct { int code_line; PyCodeObject* code_object; @@ -1356,6 +1348,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + typedef struct { Py_ssize_t shape, strides, suboffsets; } __Pyx_Buf_DimInfo; @@ -1489,8 +1483,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); @@ -1546,21 +1538,19 @@ static double __pyx_f_7sklearn_4tree_10_criterion_11FriedmanMSE_impurity_improve /* Module declarations from 'cpython.buffer' */ +/* Module declarations from 'cpython.ref' */ + /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ +/* Module declarations from 'cpython.object' */ + /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'numpy' */ @@ -1599,6 +1589,23 @@ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; +static void __pyx_pf_7sklearn_4tree_10_criterion_9Criterion___dealloc__(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_9Criterion_2__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_9Criterion_4__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d); /* proto */ +static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cinit__(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs, PyArrayObject *__pyx_v_n_classes); /* proto */ +static void __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_2__dealloc__(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_4__reduce__(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_2__reduce__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_Criterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_ClassificationCriterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_Entropy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_Gini(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_RegressionCriterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_MSE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_FriedmanMSE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static char __pyx_k_B[] = "B"; static char __pyx_k_H[] = "H"; static char __pyx_k_I[] = "I"; @@ -1654,25 +1661,6 @@ static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cinit__(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs, PyArrayObject *__pyx_v_n_classes); /* proto */ -static void __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_2__dealloc__(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_4__reduce__(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_6__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_8__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d); /* proto */ -static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs); /* proto */ -static void __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_2__dealloc__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_4__reduce__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_6__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_8__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_Criterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_ClassificationCriterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_Entropy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_Gini(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_RegressionCriterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_MSE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_FriedmanMSE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; @@ -1683,6 +1671,164 @@ static PyObject *__pyx_tuple__6; /* "sklearn/tree/_criterion.pyx":38 * """ * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * """Destructor.""" + * + */ + +/* Python wrapper */ +static void __pyx_pw_7sklearn_4tree_10_criterion_9Criterion_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_7sklearn_4tree_10_criterion_9Criterion_1__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_7sklearn_4tree_10_criterion_9Criterion___dealloc__(((struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_7sklearn_4tree_10_criterion_9Criterion___dealloc__(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "sklearn/tree/_criterion.pyx":41 + * """Destructor.""" + * + * free(self.node_sum_total) # <<<<<<<<<<<<<< + * free(self.node_sum_left) + * free(self.node_sum_right) + */ + free(__pyx_v_self->node_sum_total); + + /* "sklearn/tree/_criterion.pyx":42 + * + * free(self.node_sum_total) + * free(self.node_sum_left) # <<<<<<<<<<<<<< + * free(self.node_sum_right) + * + */ + free(__pyx_v_self->node_sum_left); + + /* "sklearn/tree/_criterion.pyx":43 + * free(self.node_sum_total) + * free(self.node_sum_left) + * free(self.node_sum_right) # <<<<<<<<<<<<<< + * + * def __getstate__(self): + */ + free(__pyx_v_self->node_sum_right); + + /* "sklearn/tree/_criterion.pyx":38 + * """ + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * """Destructor.""" + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "sklearn/tree/_criterion.pyx":45 + * free(self.node_sum_right) + * + * def __getstate__(self): # <<<<<<<<<<<<<< + * return {} + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_9Criterion_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_9Criterion_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0); + __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_9Criterion_2__getstate__(((struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_9Criterion_2__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getstate__", 0); + + /* "sklearn/tree/_criterion.pyx":46 + * + * def __getstate__(self): + * return {} # <<<<<<<<<<<<<< + * + * def __setstate__(self, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "sklearn/tree/_criterion.pyx":45 + * free(self.node_sum_right) + * + * def __getstate__(self): # <<<<<<<<<<<<<< + * return {} + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("sklearn.tree._criterion.Criterion.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "sklearn/tree/_criterion.pyx":48 + * return {} + * + * def __setstate__(self, d): # <<<<<<<<<<<<<< + * pass + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_9Criterion_5__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/ +static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_9Criterion_5__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); + __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_9Criterion_4__setstate__(((struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self), ((PyObject *)__pyx_v_d)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_9Criterion_4__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate__", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "sklearn/tree/_criterion.pyx":51 + * pass + * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< * double weighted_n_samples, SIZE_t* samples, SIZE_t start, * SIZE_t end) nogil: @@ -1693,7 +1839,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_9Criterion_init(CYTHON_UNUSED st /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":66 +/* "sklearn/tree/_criterion.pyx":79 * pass * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -1706,7 +1852,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_9Criterion_reset(CYTHON_UNUSED s /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":74 +/* "sklearn/tree/_criterion.pyx":87 * pass * * cdef void reverse_reset(self) nogil: # <<<<<<<<<<<<<< @@ -1719,7 +1865,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_9Criterion_reverse_reset(CYTHON_ /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":81 +/* "sklearn/tree/_criterion.pyx":94 * pass * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -1732,7 +1878,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_9Criterion_update(CYTHON_UNUSED /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":96 +/* "sklearn/tree/_criterion.pyx":109 * pass * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -1748,7 +1894,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_node_impurity(CYTHO return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":106 +/* "sklearn/tree/_criterion.pyx":119 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -1761,7 +1907,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_9Criterion_children_impurity(CYT /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":126 +/* "sklearn/tree/_criterion.pyx":139 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -1774,7 +1920,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_9Criterion_node_value(CYTHON_UNU /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":140 +/* "sklearn/tree/_criterion.pyx":153 * pass * * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< @@ -1787,7 +1933,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_proxy_impurity_impr double __pyx_v_impurity_right; double __pyx_r; - /* "sklearn/tree/_criterion.pyx":153 + /* "sklearn/tree/_criterion.pyx":166 * cdef double impurity_left * cdef double impurity_right * self.children_impurity(&impurity_left, &impurity_right) # <<<<<<<<<<<<<< @@ -1796,7 +1942,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_proxy_impurity_impr */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self->__pyx_vtab)->children_impurity(__pyx_v_self, (&__pyx_v_impurity_left), (&__pyx_v_impurity_right)); - /* "sklearn/tree/_criterion.pyx":156 + /* "sklearn/tree/_criterion.pyx":169 * * return (- self.weighted_n_right * impurity_right * - self.weighted_n_left * impurity_left) # <<<<<<<<<<<<<< @@ -1806,7 +1952,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_proxy_impurity_impr __pyx_r = (((-__pyx_v_self->weighted_n_right) * __pyx_v_impurity_right) - (__pyx_v_self->weighted_n_left * __pyx_v_impurity_left)); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":140 + /* "sklearn/tree/_criterion.pyx":153 * pass * * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< @@ -1819,7 +1965,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_proxy_impurity_impr return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":158 +/* "sklearn/tree/_criterion.pyx":171 * - self.weighted_n_left * impurity_left) * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -1832,7 +1978,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_impurity_improvemen double __pyx_v_impurity_right; double __pyx_r; - /* "sklearn/tree/_criterion.pyx":185 + /* "sklearn/tree/_criterion.pyx":198 * cdef double impurity_right * * self.children_impurity(&impurity_left, &impurity_right) # <<<<<<<<<<<<<< @@ -1841,7 +1987,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_impurity_improvemen */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self->__pyx_vtab)->children_impurity(__pyx_v_self, (&__pyx_v_impurity_left), (&__pyx_v_impurity_right)); - /* "sklearn/tree/_criterion.pyx":187 + /* "sklearn/tree/_criterion.pyx":200 * self.children_impurity(&impurity_left, &impurity_right) * * return ((self.weighted_n_node_samples / self.weighted_n_samples) * # <<<<<<<<<<<<<< @@ -1851,7 +1997,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_impurity_improvemen __pyx_r = ((__pyx_v_self->weighted_n_node_samples / __pyx_v_self->weighted_n_samples) * ((__pyx_v_impurity - ((__pyx_v_self->weighted_n_right / __pyx_v_self->weighted_n_node_samples) * __pyx_v_impurity_right)) - ((__pyx_v_self->weighted_n_left / __pyx_v_self->weighted_n_node_samples) * __pyx_v_impurity_left))); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":158 + /* "sklearn/tree/_criterion.pyx":171 * - self.weighted_n_left * impurity_left) * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -1864,8 +2010,8 @@ static double __pyx_f_7sklearn_4tree_10_criterion_9Criterion_impurity_improvemen return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":201 - * cdef double* label_count_total +/* "sklearn/tree/_criterion.pyx":211 + * cdef SIZE_t label_count_stride * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< * np.ndarray[SIZE_t, ndim=1] n_classes): @@ -1903,11 +2049,11 @@ static int __pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_1__cin case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_classes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -1915,18 +2061,18 @@ static int __pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_1__cin values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_n_classes = ((PyArrayObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._criterion.ClassificationCriterion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cinit__(((struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *)__pyx_v_self), __pyx_v_n_outputs, __pyx_v_n_classes); /* function exit code */ @@ -1948,10 +2094,10 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini __Pyx_RefNannyDeclarations __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - Py_ssize_t __pyx_t_4; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; int __pyx_t_5; - Py_ssize_t __pyx_t_6; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -1963,11 +2109,11 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini __pyx_pybuffernd_n_classes.rcbuffer = &__pyx_pybuffer_n_classes; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_10_criterion_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_10_criterion_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_n_classes.diminfo[0].strides = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n_classes.diminfo[0].shape = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.shape[0]; - /* "sklearn/tree/_criterion.pyx":213 + /* "sklearn/tree/_criterion.pyx":223 * """ * * self.y = NULL # <<<<<<<<<<<<<< @@ -1976,7 +2122,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_criterion.pyx":214 + /* "sklearn/tree/_criterion.pyx":224 * * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -1985,7 +2131,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_criterion.pyx":215 + /* "sklearn/tree/_criterion.pyx":225 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -1994,7 +2140,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_criterion.pyx":217 + /* "sklearn/tree/_criterion.pyx":227 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -2003,7 +2149,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_criterion.pyx":218 + /* "sklearn/tree/_criterion.pyx":228 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -2012,7 +2158,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_criterion.pyx":219 + /* "sklearn/tree/_criterion.pyx":229 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -2021,7 +2167,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_criterion.pyx":220 + /* "sklearn/tree/_criterion.pyx":230 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -2030,7 +2176,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_criterion.pyx":222 + /* "sklearn/tree/_criterion.pyx":232 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -2039,7 +2185,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.n_outputs = __pyx_v_n_outputs; - /* "sklearn/tree/_criterion.pyx":223 + /* "sklearn/tree/_criterion.pyx":233 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -2048,7 +2194,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.n_node_samples = 0; - /* "sklearn/tree/_criterion.pyx":224 + /* "sklearn/tree/_criterion.pyx":234 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -2057,7 +2203,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.weighted_n_node_samples = 0.0; - /* "sklearn/tree/_criterion.pyx":225 + /* "sklearn/tree/_criterion.pyx":235 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -2066,7 +2212,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_criterion.pyx":226 + /* "sklearn/tree/_criterion.pyx":236 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -2075,52 +2221,52 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_criterion.pyx":229 + /* "sklearn/tree/_criterion.pyx":239 * * # Count labels for each output - * self.label_count_left = NULL # <<<<<<<<<<<<<< - * self.label_count_right = NULL - * self.label_count_total = NULL + * self.node_sum_left = NULL # <<<<<<<<<<<<<< + * self.node_sum_right = NULL + * self.node_sum_total = NULL */ - __pyx_v_self->label_count_left = NULL; + __pyx_v_self->__pyx_base.node_sum_left = NULL; - /* "sklearn/tree/_criterion.pyx":230 + /* "sklearn/tree/_criterion.pyx":240 * # Count labels for each output - * self.label_count_left = NULL - * self.label_count_right = NULL # <<<<<<<<<<<<<< - * self.label_count_total = NULL + * self.node_sum_left = NULL + * self.node_sum_right = NULL # <<<<<<<<<<<<<< + * self.node_sum_total = NULL * self.n_classes = NULL */ - __pyx_v_self->label_count_right = NULL; + __pyx_v_self->__pyx_base.node_sum_right = NULL; - /* "sklearn/tree/_criterion.pyx":231 - * self.label_count_left = NULL - * self.label_count_right = NULL - * self.label_count_total = NULL # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":241 + * self.node_sum_left = NULL + * self.node_sum_right = NULL + * self.node_sum_total = NULL # <<<<<<<<<<<<<< * self.n_classes = NULL * */ - __pyx_v_self->label_count_total = NULL; + __pyx_v_self->__pyx_base.node_sum_total = NULL; - /* "sklearn/tree/_criterion.pyx":232 - * self.label_count_right = NULL - * self.label_count_total = NULL + /* "sklearn/tree/_criterion.pyx":242 + * self.node_sum_right = NULL + * self.node_sum_total = NULL * self.n_classes = NULL # <<<<<<<<<<<<<< * * safe_realloc(&self.n_classes, n_outputs) */ __pyx_v_self->n_classes = NULL; - /* "sklearn/tree/_criterion.pyx":234 + /* "sklearn/tree/_criterion.pyx":244 * self.n_classes = NULL * * safe_realloc(&self.n_classes, n_outputs) # <<<<<<<<<<<<<< * * cdef SIZE_t k = 0 */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_6_utils_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_6_utils_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_criterion.pyx":236 + /* "sklearn/tree/_criterion.pyx":246 * safe_realloc(&self.n_classes, n_outputs) * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -2129,7 +2275,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_k = 0; - /* "sklearn/tree/_criterion.pyx":237 + /* "sklearn/tree/_criterion.pyx":247 * * cdef SIZE_t k = 0 * cdef SIZE_t label_count_stride = 0 # <<<<<<<<<<<<<< @@ -2138,7 +2284,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_label_count_stride = 0; - /* "sklearn/tree/_criterion.pyx":241 + /* "sklearn/tree/_criterion.pyx":251 * # For each target, set the number of unique classes in that target, * # and also compute the maximal stride of all targets * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -2149,7 +2295,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_k = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":242 + /* "sklearn/tree/_criterion.pyx":252 * # and also compute the maximal stride of all targets * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -2159,7 +2305,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini __pyx_t_3 = __pyx_v_k; (__pyx_v_self->n_classes[__pyx_v_k]) = (*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_10_criterion_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_n_classes.diminfo[0].strides)); - /* "sklearn/tree/_criterion.pyx":244 + /* "sklearn/tree/_criterion.pyx":254 * self.n_classes[k] = n_classes[k] * * if n_classes[k] > label_count_stride: # <<<<<<<<<<<<<< @@ -2170,7 +2316,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_10_criterion_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_n_classes.diminfo[0].strides)) > __pyx_v_label_count_stride) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_criterion.pyx":245 + /* "sklearn/tree/_criterion.pyx":255 * * if n_classes[k] > label_count_stride: * label_count_stride = n_classes[k] # <<<<<<<<<<<<<< @@ -2179,18 +2325,12 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_t_6 = __pyx_v_k; __pyx_v_label_count_stride = (*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_10_criterion_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_n_classes.diminfo[0].strides)); - - /* "sklearn/tree/_criterion.pyx":244 - * self.n_classes[k] = n_classes[k] - * - * if n_classes[k] > label_count_stride: # <<<<<<<<<<<<<< - * label_count_stride = n_classes[k] - * - */ + goto __pyx_L5; } + __pyx_L5:; } - /* "sklearn/tree/_criterion.pyx":247 + /* "sklearn/tree/_criterion.pyx":257 * label_count_stride = n_classes[k] * * self.label_count_stride = label_count_stride # <<<<<<<<<<<<<< @@ -2199,110 +2339,86 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini */ __pyx_v_self->label_count_stride = __pyx_v_label_count_stride; - /* "sklearn/tree/_criterion.pyx":249 + /* "sklearn/tree/_criterion.pyx":259 * self.label_count_stride = label_count_stride * * cdef SIZE_t n_elements = n_outputs * label_count_stride # <<<<<<<<<<<<<< - * self.label_count_left = calloc(n_elements, sizeof(double)) - * self.label_count_right = calloc(n_elements, sizeof(double)) + * self.node_sum_left = calloc(n_elements, sizeof(double)) + * self.node_sum_right = calloc(n_elements, sizeof(double)) */ __pyx_v_n_elements = (__pyx_v_n_outputs * __pyx_v_label_count_stride); - /* "sklearn/tree/_criterion.pyx":250 + /* "sklearn/tree/_criterion.pyx":260 * * cdef SIZE_t n_elements = n_outputs * label_count_stride - * self.label_count_left = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< - * self.label_count_right = calloc(n_elements, sizeof(double)) - * self.label_count_total = calloc(n_elements, sizeof(double)) + * self.node_sum_left = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< + * self.node_sum_right = calloc(n_elements, sizeof(double)) + * self.node_sum_total = calloc(n_elements, sizeof(double)) */ - __pyx_v_self->label_count_left = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); + __pyx_v_self->__pyx_base.node_sum_left = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":251 + /* "sklearn/tree/_criterion.pyx":261 * cdef SIZE_t n_elements = n_outputs * label_count_stride - * self.label_count_left = calloc(n_elements, sizeof(double)) - * self.label_count_right = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< - * self.label_count_total = calloc(n_elements, sizeof(double)) + * self.node_sum_left = calloc(n_elements, sizeof(double)) + * self.node_sum_right = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< + * self.node_sum_total = calloc(n_elements, sizeof(double)) * */ - __pyx_v_self->label_count_right = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); + __pyx_v_self->__pyx_base.node_sum_right = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":252 - * self.label_count_left = calloc(n_elements, sizeof(double)) - * self.label_count_right = calloc(n_elements, sizeof(double)) - * self.label_count_total = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":262 + * self.node_sum_left = calloc(n_elements, sizeof(double)) + * self.node_sum_right = calloc(n_elements, sizeof(double)) + * self.node_sum_total = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< * - * if (self.label_count_left == NULL or + * if (self.node_sum_left == NULL or self.node_sum_right == NULL or */ - __pyx_v_self->label_count_total = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); + __pyx_v_self->__pyx_base.node_sum_total = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":254 - * self.label_count_total = calloc(n_elements, sizeof(double)) + /* "sklearn/tree/_criterion.pyx":264 + * self.node_sum_total = calloc(n_elements, sizeof(double)) * - * if (self.label_count_left == NULL or # <<<<<<<<<<<<<< - * self.label_count_right == NULL or - * self.label_count_total == NULL): + * if (self.node_sum_left == NULL or self.node_sum_right == NULL or # <<<<<<<<<<<<<< + * self.node_sum_total == NULL): + * raise MemoryError() */ - __pyx_t_7 = ((__pyx_v_self->label_count_left == NULL) != 0); + __pyx_t_7 = ((__pyx_v_self->__pyx_base.node_sum_left == NULL) != 0); if (!__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } - - /* "sklearn/tree/_criterion.pyx":255 - * - * if (self.label_count_left == NULL or - * self.label_count_right == NULL or # <<<<<<<<<<<<<< - * self.label_count_total == NULL): - * raise MemoryError() - */ - __pyx_t_7 = ((__pyx_v_self->label_count_right == NULL) != 0); + __pyx_t_7 = ((__pyx_v_self->__pyx_base.node_sum_right == NULL) != 0); if (!__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_criterion.pyx":256 - * if (self.label_count_left == NULL or - * self.label_count_right == NULL or - * self.label_count_total == NULL): # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":265 + * + * if (self.node_sum_left == NULL or self.node_sum_right == NULL or + * self.node_sum_total == NULL): # <<<<<<<<<<<<<< * raise MemoryError() * */ - __pyx_t_7 = ((__pyx_v_self->label_count_total == NULL) != 0); + __pyx_t_7 = ((__pyx_v_self->__pyx_base.node_sum_total == NULL) != 0); __pyx_t_5 = __pyx_t_7; __pyx_L7_bool_binop_done:; - - /* "sklearn/tree/_criterion.pyx":254 - * self.label_count_total = calloc(n_elements, sizeof(double)) - * - * if (self.label_count_left == NULL or # <<<<<<<<<<<<<< - * self.label_count_right == NULL or - * self.label_count_total == NULL): - */ if (__pyx_t_5) { - /* "sklearn/tree/_criterion.pyx":257 - * self.label_count_right == NULL or - * self.label_count_total == NULL): + /* "sklearn/tree/_criterion.pyx":266 + * if (self.node_sum_left == NULL or self.node_sum_right == NULL or + * self.node_sum_total == NULL): * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_criterion.pyx":254 - * self.label_count_total = calloc(n_elements, sizeof(double)) - * - * if (self.label_count_left == NULL or # <<<<<<<<<<<<<< - * self.label_count_right == NULL or - * self.label_count_total == NULL): - */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_criterion.pyx":201 - * cdef double* label_count_total + /* "sklearn/tree/_criterion.pyx":211 + * cdef SIZE_t label_count_stride * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< * np.ndarray[SIZE_t, ndim=1] n_classes): @@ -2327,7 +2443,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion___cini return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":259 +/* "sklearn/tree/_criterion.pyx":268 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2350,43 +2466,16 @@ static void __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_2__de __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_criterion.pyx":262 + /* "sklearn/tree/_criterion.pyx":271 * """Destructor.""" * * free(self.n_classes) # <<<<<<<<<<<<<< - * free(self.label_count_left) - * free(self.label_count_right) - */ - free(__pyx_v_self->n_classes); - - /* "sklearn/tree/_criterion.pyx":263 - * - * free(self.n_classes) - * free(self.label_count_left) # <<<<<<<<<<<<<< - * free(self.label_count_right) - * free(self.label_count_total) - */ - free(__pyx_v_self->label_count_left); - - /* "sklearn/tree/_criterion.pyx":264 - * free(self.n_classes) - * free(self.label_count_left) - * free(self.label_count_right) # <<<<<<<<<<<<<< - * free(self.label_count_total) - * - */ - free(__pyx_v_self->label_count_right); - - /* "sklearn/tree/_criterion.pyx":265 - * free(self.label_count_left) - * free(self.label_count_right) - * free(self.label_count_total) # <<<<<<<<<<<<<< * * def __reduce__(self): */ - free(__pyx_v_self->label_count_total); + free(__pyx_v_self->n_classes); - /* "sklearn/tree/_criterion.pyx":259 + /* "sklearn/tree/_criterion.pyx":268 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2398,8 +2487,8 @@ static void __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_2__de __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_criterion.pyx":267 - * free(self.label_count_total) +/* "sklearn/tree/_criterion.pyx":273 + * free(self.n_classes) * * def __reduce__(self): # <<<<<<<<<<<<<< * return (ClassificationCriterion, @@ -2431,7 +2520,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_criterion.pyx":268 + /* "sklearn/tree/_criterion.pyx":274 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< @@ -2440,34 +2529,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_criterion.pyx":269 + /* "sklearn/tree/_criterion.pyx":275 * def __reduce__(self): * return (ClassificationCriterion, * (self.n_outputs, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), * self.__getstate__()) */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_criterion.pyx":270 + /* "sklearn/tree/_criterion.pyx":276 * return (ClassificationCriterion, * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), # <<<<<<<<<<<<<< * self.__getstate__()) * */ - __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_6_utils_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->__pyx_base.n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_6_utils_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->__pyx_base.n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_criterion.pyx":269 + /* "sklearn/tree/_criterion.pyx":275 * def __reduce__(self): * return (ClassificationCriterion, * (self.n_outputs, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), * self.__getstate__()) */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -2476,14 +2565,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_ __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_criterion.pyx":271 + /* "sklearn/tree/_criterion.pyx":277 * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), * self.__getstate__()) # <<<<<<<<<<<<<< * - * def __getstate__(self): + * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { @@ -2496,26 +2585,26 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_ } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_criterion.pyx":268 + /* "sklearn/tree/_criterion.pyx":274 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion))); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); @@ -2526,8 +2615,8 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_ __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":267 - * free(self.label_count_total) + /* "sklearn/tree/_criterion.pyx":273 + * free(self.n_classes) * * def __reduce__(self): # <<<<<<<<<<<<<< * return (ClassificationCriterion, @@ -2548,104 +2637,8 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_ return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":273 - * self.__getstate__()) - * - * def __getstate__(self): # <<<<<<<<<<<<<< - * return {} - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0); - __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_6__getstate__(((struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_6__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getstate__", 0); - - /* "sklearn/tree/_criterion.pyx":274 - * - * def __getstate__(self): - * return {} # <<<<<<<<<<<<<< - * - * def __setstate__(self, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "sklearn/tree/_criterion.pyx":273 - * self.__getstate__()) - * - * def __getstate__(self): # <<<<<<<<<<<<<< - * return {} - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.tree._criterion.ClassificationCriterion.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "sklearn/tree/_criterion.pyx":276 - * return {} - * - * def __setstate__(self, d): # <<<<<<<<<<<<<< - * pass - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); - __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_8__setstate__(((struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *)__pyx_v_self), ((PyObject *)__pyx_v_d)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_8__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate__", 0); - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - /* "sklearn/tree/_criterion.pyx":279 - * pass + * self.__getstate__()) * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< * DOUBLE_t* sample_weight, double weighted_n_samples, @@ -2653,25 +2646,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_23ClassificationCriterion_ */ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_y, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_y_stride, __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_sample_weight, double __pyx_v_weighted_n_samples, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_end) { - double __pyx_v_weighted_n_node_samples; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_total; + double *__pyx_v_node_sum_total; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_p; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_c; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_w; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_offset; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_2; - double *__pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_1; + double *__pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; int __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_8; + int __pyx_t_8; /* "sklearn/tree/_criterion.pyx":304 * """ @@ -2732,7 +2722,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< * self.weighted_n_samples = weighted_n_samples - * cdef double weighted_n_node_samples = 0.0 + * self.weighted_n_node_samples = 0.0 */ __pyx_v_self->__pyx_base.n_node_samples = (__pyx_v_end - __pyx_v_start); @@ -2740,7 +2730,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< - * cdef double weighted_n_node_samples = 0.0 + * self.weighted_n_node_samples = 0.0 * */ __pyx_v_self->__pyx_base.weighted_n_samples = __pyx_v_weighted_n_samples; @@ -2748,148 +2738,92 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s /* "sklearn/tree/_criterion.pyx":312 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples - * cdef double weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< - * - * cdef SIZE_t n_outputs = self.n_outputs - */ - __pyx_v_weighted_n_node_samples = 0.0; - - /* "sklearn/tree/_criterion.pyx":314 - * cdef double weighted_n_node_samples = 0.0 + * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride */ - __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; + __pyx_v_self->__pyx_base.weighted_n_node_samples = 0.0; - /* "sklearn/tree/_criterion.pyx":315 + /* "sklearn/tree/_criterion.pyx":314 + * self.weighted_n_node_samples = 0.0 * - * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total - */ - __pyx_t_2 = __pyx_v_self->n_classes; - __pyx_v_n_classes = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":316 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_total = self.label_count_total + * cdef double* node_sum_total = self.node_sum_total * */ - __pyx_t_1 = __pyx_v_self->label_count_stride; - __pyx_v_label_count_stride = __pyx_t_1; + __pyx_t_1 = __pyx_v_self->n_classes; + __pyx_v_n_classes = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":317 - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":315 * - * cdef SIZE_t i = 0 - */ - __pyx_t_3 = __pyx_v_self->label_count_total; - __pyx_v_label_count_total = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":319 - * cdef double* label_count_total = self.label_count_total + * cdef SIZE_t* n_classes = self.n_classes + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< * - * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 + * cdef SIZE_t i, p, k, c */ - __pyx_v_i = 0; + __pyx_t_2 = __pyx_v_self->__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":320 + /* "sklearn/tree/_criterion.pyx":318 * - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t k = 0 - * cdef SIZE_t c = 0 - */ - __pyx_v_p = 0; - - /* "sklearn/tree/_criterion.pyx":321 - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t c = 0 - * cdef DOUBLE_t w = 1.0 - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_criterion.pyx":322 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 - * cdef SIZE_t c = 0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t w = 1.0 - * cdef SIZE_t offset = 0 - */ - __pyx_v_c = 0; - - /* "sklearn/tree/_criterion.pyx":323 - * cdef SIZE_t k = 0 - * cdef SIZE_t c = 0 + * cdef SIZE_t i, p, k, c * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< * cdef SIZE_t offset = 0 * */ __pyx_v_w = 1.0; - /* "sklearn/tree/_criterion.pyx":324 - * cdef SIZE_t c = 0 + /* "sklearn/tree/_criterion.pyx":319 + * cdef SIZE_t i, p, k, c * cdef DOUBLE_t w = 1.0 * cdef SIZE_t offset = 0 # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ __pyx_v_offset = 0; - /* "sklearn/tree/_criterion.pyx":326 + /* "sklearn/tree/_criterion.pyx":321 * cdef SIZE_t offset = 0 * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * memset(label_count_total + offset, 0, + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * memset(node_sum_total + offset, 0, * n_classes[k] * sizeof(double)) */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_t_3 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":327 + /* "sklearn/tree/_criterion.pyx":322 * - * for k in range(n_outputs): - * memset(label_count_total + offset, 0, # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): + * memset(node_sum_total + offset, 0, # <<<<<<<<<<<<<< * n_classes[k] * sizeof(double)) - * offset += label_count_stride + * offset += self.label_count_stride */ - memset((__pyx_v_label_count_total + __pyx_v_offset), 0, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); + memset((__pyx_v_node_sum_total + __pyx_v_offset), 0, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":329 - * memset(label_count_total + offset, 0, + /* "sklearn/tree/_criterion.pyx":324 + * memset(node_sum_total + offset, 0, * n_classes[k] * sizeof(double)) - * offset += label_count_stride # <<<<<<<<<<<<<< + * offset += self.label_count_stride # <<<<<<<<<<<<<< * * for p in range(start, end): */ - __pyx_v_offset = (__pyx_v_offset + __pyx_v_label_count_stride); + __pyx_v_offset = (__pyx_v_offset + __pyx_v_self->label_count_stride); } - /* "sklearn/tree/_criterion.pyx":331 - * offset += label_count_stride + /* "sklearn/tree/_criterion.pyx":326 + * offset += self.label_count_stride * * for p in range(start, end): # <<<<<<<<<<<<<< * i = samples[p] * */ - __pyx_t_1 = __pyx_v_end; - for (__pyx_t_4 = __pyx_v_start; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_t_3 = __pyx_v_end; + for (__pyx_t_4 = __pyx_v_start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_p = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":332 + /* "sklearn/tree/_criterion.pyx":327 * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< @@ -2898,7 +2832,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_criterion.pyx":336 + /* "sklearn/tree/_criterion.pyx":331 * # w is originally set to be 1.0, meaning that if no sample weights * # are given, the default weight of each sample is 1.0 * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -2908,7 +2842,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s __pyx_t_5 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_criterion.pyx":337 + /* "sklearn/tree/_criterion.pyx":332 * # are given, the default weight of each sample is 1.0 * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -2916,67 +2850,52 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s * # Count weighted class frequency for each target */ __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); - - /* "sklearn/tree/_criterion.pyx":336 - * # w is originally set to be 1.0, meaning that if no sample weights - * # are given, the default weight of each sample is 1.0 - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] - * - */ + goto __pyx_L7; } + __pyx_L7:; - /* "sklearn/tree/_criterion.pyx":340 + /* "sklearn/tree/_criterion.pyx":335 * * # Count weighted class frequency for each target - * for k in range(n_outputs): # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< * c = y[i * y_stride + k] - * label_count_total[k * label_count_stride + c] += w + * node_sum_total[k * self.label_count_stride + c] += w */ - __pyx_t_6 = __pyx_v_n_outputs; + __pyx_t_6 = __pyx_v_self->__pyx_base.n_outputs; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_k = __pyx_t_7; - /* "sklearn/tree/_criterion.pyx":341 + /* "sklearn/tree/_criterion.pyx":336 * # Count weighted class frequency for each target - * for k in range(n_outputs): + * for k in range(self.n_outputs): * c = y[i * y_stride + k] # <<<<<<<<<<<<<< - * label_count_total[k * label_count_stride + c] += w + * node_sum_total[k * self.label_count_stride + c] += w * */ __pyx_v_c = ((__pyx_t_7sklearn_4tree_10_criterion_SIZE_t)(__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)])); - /* "sklearn/tree/_criterion.pyx":342 - * for k in range(n_outputs): + /* "sklearn/tree/_criterion.pyx":337 + * for k in range(self.n_outputs): * c = y[i * y_stride + k] - * label_count_total[k * label_count_stride + c] += w # <<<<<<<<<<<<<< + * node_sum_total[k * self.label_count_stride + c] += w # <<<<<<<<<<<<<< * - * weighted_n_node_samples += w + * self.weighted_n_node_samples += w */ - __pyx_t_8 = ((__pyx_v_k * __pyx_v_label_count_stride) + __pyx_v_c); - (__pyx_v_label_count_total[__pyx_t_8]) = ((__pyx_v_label_count_total[__pyx_t_8]) + __pyx_v_w); + __pyx_t_8 = ((__pyx_v_k * __pyx_v_self->label_count_stride) + __pyx_v_c); + (__pyx_v_node_sum_total[__pyx_t_8]) = ((__pyx_v_node_sum_total[__pyx_t_8]) + __pyx_v_w); } - /* "sklearn/tree/_criterion.pyx":344 - * label_count_total[k * label_count_stride + c] += w - * - * weighted_n_node_samples += w # <<<<<<<<<<<<<< - * - * self.weighted_n_node_samples = weighted_n_node_samples - */ - __pyx_v_weighted_n_node_samples = (__pyx_v_weighted_n_node_samples + __pyx_v_w); - } - - /* "sklearn/tree/_criterion.pyx":346 - * weighted_n_node_samples += w + /* "sklearn/tree/_criterion.pyx":339 + * node_sum_total[k * self.label_count_stride + c] += w * - * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< + * self.weighted_n_node_samples += w # <<<<<<<<<<<<<< * * # Reset to pos=start */ - __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; + __pyx_v_self->__pyx_base.weighted_n_node_samples = (__pyx_v_self->__pyx_base.weighted_n_node_samples + __pyx_v_w); + } - /* "sklearn/tree/_criterion.pyx":349 + /* "sklearn/tree/_criterion.pyx":342 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -2986,7 +2905,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_ClassificationCriterion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reset(((struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self)); /* "sklearn/tree/_criterion.pyx":279 - * pass + * self.__getstate__()) * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< * DOUBLE_t* sample_weight, double weighted_n_samples, @@ -2996,7 +2915,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":351 +/* "sklearn/tree/_criterion.pyx":344 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -3005,20 +2924,16 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_init(s */ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_reset(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_total; - double *__pyx_v_label_count_left; - double *__pyx_v_label_count_right; + double *__pyx_v_node_sum_total; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; double __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; + double *__pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":354 + /* "sklearn/tree/_criterion.pyx":347 * """Reset the criterion at pos=start.""" * * self.pos = self.start # <<<<<<<<<<<<<< @@ -3028,7 +2943,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_reset( __pyx_t_1 = __pyx_v_self->__pyx_base.start; __pyx_v_self->__pyx_base.pos = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":356 + /* "sklearn/tree/_criterion.pyx":349 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -3037,143 +2952,104 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_reset( */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_criterion.pyx":357 + /* "sklearn/tree/_criterion.pyx":350 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< * - * cdef SIZE_t n_outputs = self.n_outputs + * cdef double* node_sum_total = self.node_sum_total */ __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_self->__pyx_base.weighted_n_right = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":359 + /* "sklearn/tree/_criterion.pyx":352 * self.weighted_n_right = self.weighted_n_node_samples * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":360 - * - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total - */ - __pyx_t_3 = __pyx_v_self->n_classes; - __pyx_v_n_classes = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":361 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_total = self.label_count_total - * cdef double* label_count_left = self.label_count_left - */ - __pyx_t_1 = __pyx_v_self->label_count_stride; - __pyx_v_label_count_stride = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":362 - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right */ - __pyx_t_4 = __pyx_v_self->label_count_total; - __pyx_v_label_count_total = __pyx_t_4; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":363 - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total - * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< - * cdef double* label_count_right = self.label_count_right + /* "sklearn/tree/_criterion.pyx":353 * - */ - __pyx_t_4 = __pyx_v_self->label_count_left; - __pyx_v_label_count_left = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":364 - * cdef double* label_count_total = self.label_count_total - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< + * cdef double* node_sum_total = self.node_sum_total + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right * - * cdef SIZE_t k = 0 */ - __pyx_t_4 = __pyx_v_self->label_count_right; - __pyx_v_label_count_right = __pyx_t_4; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":366 - * cdef double* label_count_right = self.label_count_right - * - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":354 + * cdef double* node_sum_total = self.node_sum_total + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * cdef SIZE_t k */ - __pyx_v_k = 0; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":368 - * cdef SIZE_t k = 0 + /* "sklearn/tree/_criterion.pyx":358 + * cdef SIZE_t k * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * memset(label_count_left, 0, n_classes[k] * sizeof(double)) - * memcpy(label_count_right, label_count_total, + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * memset(node_sum_left, 0, self.n_classes[k] * sizeof(double)) + * memcpy(node_sum_right, node_sum_total, */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { - __pyx_v_k = __pyx_t_5; + __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":369 + /* "sklearn/tree/_criterion.pyx":359 * - * for k in range(n_outputs): - * memset(label_count_left, 0, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< - * memcpy(label_count_right, label_count_total, - * n_classes[k] * sizeof(double)) + * for k in range(self.n_outputs): + * memset(node_sum_left, 0, self.n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< + * memcpy(node_sum_right, node_sum_total, + * self.n_classes[k] * sizeof(double)) */ - memset(__pyx_v_label_count_left, 0, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); + memset(__pyx_v_node_sum_left, 0, ((__pyx_v_self->n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":370 - * for k in range(n_outputs): - * memset(label_count_left, 0, n_classes[k] * sizeof(double)) - * memcpy(label_count_right, label_count_total, # <<<<<<<<<<<<<< - * n_classes[k] * sizeof(double)) + /* "sklearn/tree/_criterion.pyx":360 + * for k in range(self.n_outputs): + * memset(node_sum_left, 0, self.n_classes[k] * sizeof(double)) + * memcpy(node_sum_right, node_sum_total, # <<<<<<<<<<<<<< + * self.n_classes[k] * sizeof(double)) * */ - memcpy(__pyx_v_label_count_right, __pyx_v_label_count_total, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); + memcpy(__pyx_v_node_sum_right, __pyx_v_node_sum_total, ((__pyx_v_self->n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":373 - * n_classes[k] * sizeof(double)) + /* "sklearn/tree/_criterion.pyx":363 + * self.n_classes[k] * sizeof(double)) * - * label_count_total += label_count_stride # <<<<<<<<<<<<<< - * label_count_left += label_count_stride - * label_count_right += label_count_stride + * node_sum_total += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_left += self.label_count_stride + * node_sum_right += self.label_count_stride */ - __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); + __pyx_v_node_sum_total = (__pyx_v_node_sum_total + __pyx_v_self->label_count_stride); - /* "sklearn/tree/_criterion.pyx":374 + /* "sklearn/tree/_criterion.pyx":364 * - * label_count_total += label_count_stride - * label_count_left += label_count_stride # <<<<<<<<<<<<<< - * label_count_right += label_count_stride + * node_sum_total += self.label_count_stride + * node_sum_left += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_right += self.label_count_stride * */ - __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); + __pyx_v_node_sum_left = (__pyx_v_node_sum_left + __pyx_v_self->label_count_stride); - /* "sklearn/tree/_criterion.pyx":375 - * label_count_total += label_count_stride - * label_count_left += label_count_stride - * label_count_right += label_count_stride # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":365 + * node_sum_total += self.label_count_stride + * node_sum_left += self.label_count_stride + * node_sum_right += self.label_count_stride # <<<<<<<<<<<<<< * * cdef void reverse_reset(self) nogil: */ - __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); + __pyx_v_node_sum_right = (__pyx_v_node_sum_right + __pyx_v_self->label_count_stride); } - /* "sklearn/tree/_criterion.pyx":351 + /* "sklearn/tree/_criterion.pyx":344 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -3184,8 +3060,8 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_reset( /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":377 - * label_count_right += label_count_stride +/* "sklearn/tree/_criterion.pyx":367 + * node_sum_right += self.label_count_stride * * cdef void reverse_reset(self) nogil: # <<<<<<<<<<<<<< * """Reset the criterion at pos=end.""" @@ -3193,20 +3069,16 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_reset( */ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_reverse_reset(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_total; - double *__pyx_v_label_count_left; - double *__pyx_v_label_count_right; + double *__pyx_v_node_sum_total; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; double __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; + double *__pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":379 + /* "sklearn/tree/_criterion.pyx":369 * cdef void reverse_reset(self) nogil: * """Reset the criterion at pos=end.""" * self.pos = self.end # <<<<<<<<<<<<<< @@ -3216,7 +3088,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_revers __pyx_t_1 = __pyx_v_self->__pyx_base.end; __pyx_v_self->__pyx_base.pos = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":381 + /* "sklearn/tree/_criterion.pyx":371 * self.pos = self.end * * self.weighted_n_left = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3226,143 +3098,104 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_revers __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_self->__pyx_base.weighted_n_left = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":382 + /* "sklearn/tree/_criterion.pyx":372 * * self.weighted_n_left = self.weighted_n_node_samples * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< * - * cdef SIZE_t n_outputs = self.n_outputs + * cdef double* node_sum_total = self.node_sum_total */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_criterion.pyx":384 + /* "sklearn/tree/_criterion.pyx":374 * self.weighted_n_right = 0.0 * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right */ - __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":385 + /* "sklearn/tree/_criterion.pyx":375 + * + * cdef double* node_sum_total = self.node_sum_total + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right * - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total - */ - __pyx_t_3 = __pyx_v_self->n_classes; - __pyx_v_n_classes = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":386 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_total = self.label_count_total - * cdef double* label_count_left = self.label_count_left */ - __pyx_t_1 = __pyx_v_self->label_count_stride; - __pyx_v_label_count_stride = __pyx_t_1; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":387 - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right + /* "sklearn/tree/_criterion.pyx":376 + * cdef double* node_sum_total = self.node_sum_total + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< + * + * cdef SIZE_t k */ - __pyx_t_4 = __pyx_v_self->label_count_total; - __pyx_v_label_count_total = __pyx_t_4; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":388 - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total - * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< - * cdef double* label_count_right = self.label_count_right + /* "sklearn/tree/_criterion.pyx":380 + * cdef SIZE_t k * + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * memset(node_sum_right, 0, self.n_classes[k] * sizeof(double)) + * memcpy(node_sum_left, node_sum_total, */ - __pyx_t_4 = __pyx_v_self->label_count_left; - __pyx_v_label_count_left = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":389 - * cdef double* label_count_total = self.label_count_total - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< - * - * cdef SIZE_t k = 0 - */ - __pyx_t_4 = __pyx_v_self->label_count_right; - __pyx_v_label_count_right = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":391 - * cdef double* label_count_right = self.label_count_right - * - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * - * for k in range(n_outputs): - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_criterion.pyx":393 - * cdef SIZE_t k = 0 - * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * memset(label_count_right, 0, n_classes[k] * sizeof(double)) - * memcpy(label_count_left, label_count_total, - */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { - __pyx_v_k = __pyx_t_5; + __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":394 + /* "sklearn/tree/_criterion.pyx":381 * - * for k in range(n_outputs): - * memset(label_count_right, 0, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< - * memcpy(label_count_left, label_count_total, - * n_classes[k] * sizeof(double)) + * for k in range(self.n_outputs): + * memset(node_sum_right, 0, self.n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< + * memcpy(node_sum_left, node_sum_total, + * self.n_classes[k] * sizeof(double)) */ - memset(__pyx_v_label_count_right, 0, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); + memset(__pyx_v_node_sum_right, 0, ((__pyx_v_self->n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":395 - * for k in range(n_outputs): - * memset(label_count_right, 0, n_classes[k] * sizeof(double)) - * memcpy(label_count_left, label_count_total, # <<<<<<<<<<<<<< - * n_classes[k] * sizeof(double)) + /* "sklearn/tree/_criterion.pyx":382 + * for k in range(self.n_outputs): + * memset(node_sum_right, 0, self.n_classes[k] * sizeof(double)) + * memcpy(node_sum_left, node_sum_total, # <<<<<<<<<<<<<< + * self.n_classes[k] * sizeof(double)) * */ - memcpy(__pyx_v_label_count_left, __pyx_v_label_count_total, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); + memcpy(__pyx_v_node_sum_left, __pyx_v_node_sum_total, ((__pyx_v_self->n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":398 - * n_classes[k] * sizeof(double)) + /* "sklearn/tree/_criterion.pyx":385 + * self.n_classes[k] * sizeof(double)) * - * label_count_total += label_count_stride # <<<<<<<<<<<<<< - * label_count_left += label_count_stride - * label_count_right += label_count_stride + * node_sum_total += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_left += self.label_count_stride + * node_sum_right += self.label_count_stride */ - __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); + __pyx_v_node_sum_total = (__pyx_v_node_sum_total + __pyx_v_self->label_count_stride); - /* "sklearn/tree/_criterion.pyx":399 + /* "sklearn/tree/_criterion.pyx":386 * - * label_count_total += label_count_stride - * label_count_left += label_count_stride # <<<<<<<<<<<<<< - * label_count_right += label_count_stride + * node_sum_total += self.label_count_stride + * node_sum_left += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_right += self.label_count_stride * */ - __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); + __pyx_v_node_sum_left = (__pyx_v_node_sum_left + __pyx_v_self->label_count_stride); - /* "sklearn/tree/_criterion.pyx":400 - * label_count_total += label_count_stride - * label_count_left += label_count_stride - * label_count_right += label_count_stride # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":387 + * node_sum_total += self.label_count_stride + * node_sum_left += self.label_count_stride + * node_sum_right += self.label_count_stride # <<<<<<<<<<<<<< * * cdef void update(self, SIZE_t new_pos) nogil: */ - __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); + __pyx_v_node_sum_right = (__pyx_v_node_sum_right + __pyx_v_self->label_count_stride); } - /* "sklearn/tree/_criterion.pyx":377 - * label_count_right += label_count_stride + /* "sklearn/tree/_criterion.pyx":367 + * node_sum_right += self.label_count_stride * * cdef void reverse_reset(self) nogil: # <<<<<<<<<<<<<< * """Reset the criterion at pos=end.""" @@ -3372,8 +3205,8 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_revers /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":402 - * label_count_right += label_count_stride +/* "sklearn/tree/_criterion.pyx":389 + * node_sum_right += self.label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< * """Updated statistics by moving samples[pos:new_pos] to the left child. @@ -3382,28 +3215,24 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_revers static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_new_pos) { __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_y; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_y_stride; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_sample_weight; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_samples; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_pos; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_end; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; + double *__pyx_v_node_sum_total; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_left; - double *__pyx_v_label_count_right; - double *__pyx_v_label_count_total; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_samples; + __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_sample_weight; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_p; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_c; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_index; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_w; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_diff_w; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_t_1; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; + double *__pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_4; int __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; @@ -3411,49 +3240,19 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_9; long __pyx_t_10; - /* "sklearn/tree/_criterion.pyx":411 + /* "sklearn/tree/_criterion.pyx":398 * child to the left child. * """ * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< - * cdef SIZE_t y_stride = self.y_stride - * cdef DOUBLE_t* sample_weight = self.sample_weight + * cdef SIZE_t pos = self.pos + * cdef SIZE_t end = self.end */ __pyx_t_1 = __pyx_v_self->__pyx_base.y; __pyx_v_y = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":412 + /* "sklearn/tree/_criterion.pyx":399 * """ * cdef DOUBLE_t* y = self.y - * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< - * cdef DOUBLE_t* sample_weight = self.sample_weight - * - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.y_stride; - __pyx_v_y_stride = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":413 - * cdef DOUBLE_t* y = self.y - * cdef SIZE_t y_stride = self.y_stride - * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< - * - * cdef SIZE_t* samples = self.samples - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.sample_weight; - __pyx_v_sample_weight = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":415 - * cdef DOUBLE_t* sample_weight = self.sample_weight - * - * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< - * cdef SIZE_t pos = self.pos - * cdef SIZE_t end = self.end - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.samples; - __pyx_v_samples = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":416 - * - * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< * cdef SIZE_t end = self.end * @@ -3461,140 +3260,86 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update __pyx_t_2 = __pyx_v_self->__pyx_base.pos; __pyx_v_pos = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":417 - * cdef SIZE_t* samples = self.samples + /* "sklearn/tree/_criterion.pyx":400 + * cdef DOUBLE_t* y = self.y * cdef SIZE_t pos = self.pos * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< * - * cdef SIZE_t n_outputs = self.n_outputs + * cdef double* node_sum_left = self.node_sum_left */ __pyx_t_2 = __pyx_v_self->__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":419 + /* "sklearn/tree/_criterion.pyx":402 * cdef SIZE_t end = self.end * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right + * cdef double* node_sum_total = self.node_sum_total */ - __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_2; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":420 + /* "sklearn/tree/_criterion.pyx":403 + * + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< + * cdef double* node_sum_total = self.node_sum_total * - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left - */ - __pyx_t_3 = __pyx_v_self->n_classes; - __pyx_v_n_classes = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":421 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right */ - __pyx_t_2 = __pyx_v_self->label_count_stride; - __pyx_v_label_count_stride = __pyx_t_2; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":422 + /* "sklearn/tree/_criterion.pyx":404 + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< + * * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< - * cdef double* label_count_right = self.label_count_right - * cdef double* label_count_total = self.label_count_total */ - __pyx_t_4 = __pyx_v_self->label_count_left; - __pyx_v_label_count_left = __pyx_t_4; + __pyx_t_3 = __pyx_v_self->__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":423 - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< - * cdef double* label_count_total = self.label_count_total + /* "sklearn/tree/_criterion.pyx":406 + * cdef double* node_sum_total = self.node_sum_total * + * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< + * cdef SIZE_t* samples = self.samples + * cdef DOUBLE_t* sample_weight = self.sample_weight */ - __pyx_t_4 = __pyx_v_self->label_count_right; - __pyx_v_label_count_right = __pyx_t_4; + __pyx_t_4 = __pyx_v_self->n_classes; + __pyx_v_n_classes = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":424 - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right - * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":407 * - * cdef SIZE_t i = 0 - */ - __pyx_t_4 = __pyx_v_self->label_count_total; - __pyx_v_label_count_total = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":426 - * cdef double* label_count_total = self.label_count_total + * cdef SIZE_t* n_classes = self.n_classes + * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< + * cdef DOUBLE_t* sample_weight = self.sample_weight * - * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 */ - __pyx_v_i = 0; + __pyx_t_4 = __pyx_v_self->__pyx_base.samples; + __pyx_v_samples = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":427 + /* "sklearn/tree/_criterion.pyx":408 + * cdef SIZE_t* n_classes = self.n_classes + * cdef SIZE_t* samples = self.samples + * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< * - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t k = 0 - * cdef SIZE_t c = 0 - */ - __pyx_v_p = 0; - - /* "sklearn/tree/_criterion.pyx":428 - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t c = 0 - * cdef SIZE_t label_index = 0 - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_criterion.pyx":429 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 - * cdef SIZE_t c = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t label_index = 0 - * cdef DOUBLE_t w = 1.0 - */ - __pyx_v_c = 0; - - /* "sklearn/tree/_criterion.pyx":430 - * cdef SIZE_t k = 0 - * cdef SIZE_t c = 0 - * cdef SIZE_t label_index = 0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t w = 1.0 - * cdef DOUBLE_t diff_w = 0.0 + * cdef SIZE_t i, p, k, c */ - __pyx_v_label_index = 0; + __pyx_t_1 = __pyx_v_self->__pyx_base.sample_weight; + __pyx_v_sample_weight = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":431 - * cdef SIZE_t c = 0 - * cdef SIZE_t label_index = 0 + /* "sklearn/tree/_criterion.pyx":412 + * cdef SIZE_t i, p, k, c + * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t diff_w = 0.0 - * - */ - __pyx_v_w = 1.0; - - /* "sklearn/tree/_criterion.pyx":432 - * cdef SIZE_t label_index = 0 - * cdef DOUBLE_t w = 1.0 - * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< * * # Update statistics up to new_pos */ - __pyx_v_diff_w = 0.0; + __pyx_v_w = 1.0; - /* "sklearn/tree/_criterion.pyx":442 + /* "sklearn/tree/_criterion.pyx":422 * # of computations, i.e. from pos to new_pos or from end to new_po. * * if (new_pos - pos) <= (end - new_pos): # <<<<<<<<<<<<<< @@ -3604,7 +3349,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update __pyx_t_5 = (((__pyx_v_new_pos - __pyx_v_pos) <= (__pyx_v_end - __pyx_v_new_pos)) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_criterion.pyx":443 + /* "sklearn/tree/_criterion.pyx":423 * * if (new_pos - pos) <= (end - new_pos): * for p in range(pos, new_pos): # <<<<<<<<<<<<<< @@ -3615,7 +3360,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update for (__pyx_t_6 = __pyx_v_pos; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_p = __pyx_t_6; - /* "sklearn/tree/_criterion.pyx":444 + /* "sklearn/tree/_criterion.pyx":424 * if (new_pos - pos) <= (end - new_pos): * for p in range(pos, new_pos): * i = samples[p] # <<<<<<<<<<<<<< @@ -3624,7 +3369,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_criterion.pyx":446 + /* "sklearn/tree/_criterion.pyx":426 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -3634,256 +3379,236 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update __pyx_t_5 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_criterion.pyx":447 + /* "sklearn/tree/_criterion.pyx":427 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); - - /* "sklearn/tree/_criterion.pyx":446 - * i = samples[p] - * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] - * - */ + goto __pyx_L6; } + __pyx_L6:; - /* "sklearn/tree/_criterion.pyx":449 + /* "sklearn/tree/_criterion.pyx":429 * w = sample_weight[i] * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * label_index = (k * label_count_stride + - * y[i * y_stride + k]) + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * label_index = (k * self.label_count_stride + + * y[i * self.y_stride + k]) */ - __pyx_t_7 = __pyx_v_n_outputs; + __pyx_t_7 = __pyx_v_self->__pyx_base.n_outputs; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_k = __pyx_t_8; - /* "sklearn/tree/_criterion.pyx":450 + /* "sklearn/tree/_criterion.pyx":430 * - * for k in range(n_outputs): - * label_index = (k * label_count_stride + # <<<<<<<<<<<<<< - * y[i * y_stride + k]) - * label_count_left[label_index] += w + * for k in range(self.n_outputs): + * label_index = (k * self.label_count_stride + # <<<<<<<<<<<<<< + * y[i * self.y_stride + k]) + * node_sum_left[label_index] += w */ - __pyx_v_label_index = ((__pyx_v_k * __pyx_v_label_count_stride) + ((__pyx_t_7sklearn_4tree_10_criterion_SIZE_t)(__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]))); + __pyx_v_label_index = ((__pyx_v_k * __pyx_v_self->label_count_stride) + ((__pyx_t_7sklearn_4tree_10_criterion_SIZE_t)(__pyx_v_y[((__pyx_v_i * __pyx_v_self->__pyx_base.y_stride) + __pyx_v_k)]))); - /* "sklearn/tree/_criterion.pyx":452 - * label_index = (k * label_count_stride + - * y[i * y_stride + k]) - * label_count_left[label_index] += w # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":432 + * label_index = (k * self.label_count_stride + + * y[i * self.y_stride + k]) + * node_sum_left[label_index] += w # <<<<<<<<<<<<<< * - * diff_w += w + * self.weighted_n_left += w */ __pyx_t_9 = __pyx_v_label_index; - (__pyx_v_label_count_left[__pyx_t_9]) = ((__pyx_v_label_count_left[__pyx_t_9]) + __pyx_v_w); + (__pyx_v_node_sum_left[__pyx_t_9]) = ((__pyx_v_node_sum_left[__pyx_t_9]) + __pyx_v_w); } - /* "sklearn/tree/_criterion.pyx":454 - * label_count_left[label_index] += w + /* "sklearn/tree/_criterion.pyx":434 + * node_sum_left[label_index] += w * - * diff_w += w # <<<<<<<<<<<<<< + * self.weighted_n_left += w # <<<<<<<<<<<<<< + * self.weighted_n_right -= w * - * else: */ - __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); - } + __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_w); - /* "sklearn/tree/_criterion.pyx":442 - * # of computations, i.e. from pos to new_pos or from end to new_po. + /* "sklearn/tree/_criterion.pyx":435 * - * if (new_pos - pos) <= (end - new_pos): # <<<<<<<<<<<<<< - * for p in range(pos, new_pos): - * i = samples[p] + * self.weighted_n_left += w + * self.weighted_n_right -= w # <<<<<<<<<<<<<< + * + * else: */ + __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_w); + } goto __pyx_L3; } + /*else*/ { - /* "sklearn/tree/_criterion.pyx":457 + /* "sklearn/tree/_criterion.pyx":438 * * else: * self.reverse_reset() # <<<<<<<<<<<<<< * * for p in range(end - 1, new_pos - 1, -1): */ - /*else*/ { ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_ClassificationCriterion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reverse_reset(((struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self)); - /* "sklearn/tree/_criterion.pyx":459 + /* "sklearn/tree/_criterion.pyx":440 * self.reverse_reset() * * for p in range(end - 1, new_pos - 1, -1): # <<<<<<<<<<<<<< - * i = samples[p] + * i = self.samples[p] * */ __pyx_t_10 = (__pyx_v_new_pos - 1); for (__pyx_t_2 = (__pyx_v_end - 1); __pyx_t_2 > __pyx_t_10; __pyx_t_2-=1) { __pyx_v_p = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":460 + /* "sklearn/tree/_criterion.pyx":441 * * for p in range(end - 1, new_pos - 1, -1): - * i = samples[p] # <<<<<<<<<<<<<< + * i = self.samples[p] # <<<<<<<<<<<<<< * - * if sample_weight != NULL: + * if self.sample_weight != NULL: */ - __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); + __pyx_v_i = (__pyx_v_self->__pyx_base.samples[__pyx_v_p]); - /* "sklearn/tree/_criterion.pyx":462 - * i = samples[p] + /* "sklearn/tree/_criterion.pyx":443 + * i = self.samples[p] * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + * if self.sample_weight != NULL: # <<<<<<<<<<<<<< + * w = self.sample_weight[i] * */ - __pyx_t_5 = ((__pyx_v_sample_weight != NULL) != 0); + __pyx_t_5 = ((__pyx_v_self->__pyx_base.sample_weight != NULL) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_criterion.pyx":463 - * - * if sample_weight != NULL: - * w = sample_weight[i] # <<<<<<<<<<<<<< - * - * for k in range(n_outputs): - */ - __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); - - /* "sklearn/tree/_criterion.pyx":462 - * i = samples[p] + /* "sklearn/tree/_criterion.pyx":444 * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + * if self.sample_weight != NULL: + * w = self.sample_weight[i] # <<<<<<<<<<<<<< * + * for k in range(self.n_outputs): */ + __pyx_v_w = (__pyx_v_self->__pyx_base.sample_weight[__pyx_v_i]); + goto __pyx_L11; } + __pyx_L11:; - /* "sklearn/tree/_criterion.pyx":465 - * w = sample_weight[i] + /* "sklearn/tree/_criterion.pyx":446 + * w = self.sample_weight[i] * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * label_index = (k * label_count_stride + - * y[i * y_stride + k]) + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * label_index = (k * self.label_count_stride + + * y[i * self.y_stride + k]) */ - __pyx_t_6 = __pyx_v_n_outputs; + __pyx_t_6 = __pyx_v_self->__pyx_base.n_outputs; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_k = __pyx_t_7; - /* "sklearn/tree/_criterion.pyx":466 + /* "sklearn/tree/_criterion.pyx":447 * - * for k in range(n_outputs): - * label_index = (k * label_count_stride + # <<<<<<<<<<<<<< - * y[i * y_stride + k]) - * label_count_left[label_index] -= w + * for k in range(self.n_outputs): + * label_index = (k * self.label_count_stride + # <<<<<<<<<<<<<< + * y[i * self.y_stride + k]) + * node_sum_left[label_index] -= w */ - __pyx_v_label_index = ((__pyx_v_k * __pyx_v_label_count_stride) + ((__pyx_t_7sklearn_4tree_10_criterion_SIZE_t)(__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]))); + __pyx_v_label_index = ((__pyx_v_k * __pyx_v_self->label_count_stride) + ((__pyx_t_7sklearn_4tree_10_criterion_SIZE_t)(__pyx_v_y[((__pyx_v_i * __pyx_v_self->__pyx_base.y_stride) + __pyx_v_k)]))); - /* "sklearn/tree/_criterion.pyx":468 - * label_index = (k * label_count_stride + - * y[i * y_stride + k]) - * label_count_left[label_index] -= w # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":449 + * label_index = (k * self.label_count_stride + + * y[i * self.y_stride + k]) + * node_sum_left[label_index] -= w # <<<<<<<<<<<<<< * - * diff_w -= w + * self.weighted_n_left -= w */ __pyx_t_8 = __pyx_v_label_index; - (__pyx_v_label_count_left[__pyx_t_8]) = ((__pyx_v_label_count_left[__pyx_t_8]) - __pyx_v_w); + (__pyx_v_node_sum_left[__pyx_t_8]) = ((__pyx_v_node_sum_left[__pyx_t_8]) - __pyx_v_w); } - /* "sklearn/tree/_criterion.pyx":470 - * label_count_left[label_index] -= w + /* "sklearn/tree/_criterion.pyx":451 + * node_sum_left[label_index] -= w * - * diff_w -= w # <<<<<<<<<<<<<< + * self.weighted_n_left -= w # <<<<<<<<<<<<<< + * self.weighted_n_right += w * - * self.weighted_n_left += diff_w */ - __pyx_v_diff_w = (__pyx_v_diff_w - __pyx_v_w); - } - } - __pyx_L3:; + __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left - __pyx_v_w); - /* "sklearn/tree/_criterion.pyx":472 - * diff_w -= w + /* "sklearn/tree/_criterion.pyx":452 * - * self.weighted_n_left += diff_w # <<<<<<<<<<<<<< + * self.weighted_n_left -= w + * self.weighted_n_right += w # <<<<<<<<<<<<<< * * # Upate right part statistics */ - __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_diff_w); + __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right + __pyx_v_w); + } + } + __pyx_L3:; - /* "sklearn/tree/_criterion.pyx":475 + /* "sklearn/tree/_criterion.pyx":455 * * # Upate right part statistics - * for k in range(n_outputs): # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< * for c in range(n_classes[k]): - * label_count_right[c] = (label_count_total[c] - + * node_sum_right[c] = node_sum_total[c] - node_sum_left[c] */ - __pyx_t_2 = __pyx_v_n_outputs; + __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "sklearn/tree/_criterion.pyx":476 + /* "sklearn/tree/_criterion.pyx":456 * # Upate right part statistics - * for k in range(n_outputs): + * for k in range(self.n_outputs): * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * label_count_right[c] = (label_count_total[c] - - * label_count_left[c]) + * node_sum_right[c] = node_sum_total[c] - node_sum_left[c] + * */ __pyx_t_7 = (__pyx_v_n_classes[__pyx_v_k]); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_c = __pyx_t_8; - /* "sklearn/tree/_criterion.pyx":477 - * for k in range(n_outputs): + /* "sklearn/tree/_criterion.pyx":457 + * for k in range(self.n_outputs): * for c in range(n_classes[k]): - * label_count_right[c] = (label_count_total[c] - # <<<<<<<<<<<<<< - * label_count_left[c]) + * node_sum_right[c] = node_sum_total[c] - node_sum_left[c] # <<<<<<<<<<<<<< * + * node_sum_right += self.label_count_stride */ - (__pyx_v_label_count_right[__pyx_v_c]) = ((__pyx_v_label_count_total[__pyx_v_c]) - (__pyx_v_label_count_left[__pyx_v_c])); + (__pyx_v_node_sum_right[__pyx_v_c]) = ((__pyx_v_node_sum_total[__pyx_v_c]) - (__pyx_v_node_sum_left[__pyx_v_c])); } - /* "sklearn/tree/_criterion.pyx":480 - * label_count_left[c]) + /* "sklearn/tree/_criterion.pyx":459 + * node_sum_right[c] = node_sum_total[c] - node_sum_left[c] * - * label_count_right += label_count_stride # <<<<<<<<<<<<<< - * label_count_left += label_count_stride - * label_count_total += label_count_stride + * node_sum_right += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_left += self.label_count_stride + * node_sum_total += self.label_count_stride */ - __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); + __pyx_v_node_sum_right = (__pyx_v_node_sum_right + __pyx_v_self->label_count_stride); - /* "sklearn/tree/_criterion.pyx":481 + /* "sklearn/tree/_criterion.pyx":460 * - * label_count_right += label_count_stride - * label_count_left += label_count_stride # <<<<<<<<<<<<<< - * label_count_total += label_count_stride + * node_sum_right += self.label_count_stride + * node_sum_left += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_total += self.label_count_stride * */ - __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); + __pyx_v_node_sum_left = (__pyx_v_node_sum_left + __pyx_v_self->label_count_stride); - /* "sklearn/tree/_criterion.pyx":482 - * label_count_right += label_count_stride - * label_count_left += label_count_stride - * label_count_total += label_count_stride # <<<<<<<<<<<<<< - * - * self.weighted_n_right -= diff_w - */ - __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); - } - - /* "sklearn/tree/_criterion.pyx":484 - * label_count_total += label_count_stride - * - * self.weighted_n_right -= diff_w # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":461 + * node_sum_right += self.label_count_stride + * node_sum_left += self.label_count_stride + * node_sum_total += self.label_count_stride # <<<<<<<<<<<<<< * * self.pos = new_pos */ - __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_diff_w); + __pyx_v_node_sum_total = (__pyx_v_node_sum_total + __pyx_v_self->label_count_stride); + } - /* "sklearn/tree/_criterion.pyx":486 - * self.weighted_n_right -= diff_w + /* "sklearn/tree/_criterion.pyx":463 + * node_sum_total += self.label_count_stride * * self.pos = new_pos # <<<<<<<<<<<<<< * @@ -3891,8 +3616,8 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update */ __pyx_v_self->__pyx_base.pos = __pyx_v_new_pos; - /* "sklearn/tree/_criterion.pyx":402 - * label_count_right += label_count_stride + /* "sklearn/tree/_criterion.pyx":389 + * node_sum_right += self.label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< * """Updated statistics by moving samples[pos:new_pos] to the left child. @@ -3902,7 +3627,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_update /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":488 +/* "sklearn/tree/_criterion.pyx":465 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -3918,7 +3643,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_node return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":491 +/* "sklearn/tree/_criterion.pyx":468 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -3931,7 +3656,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_childr /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":495 +/* "sklearn/tree/_criterion.pyx":472 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -3940,96 +3665,62 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_childr */ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_node_value(struct __pyx_obj_7sklearn_4tree_10_criterion_ClassificationCriterion *__pyx_v_self, double *__pyx_v_dest) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_total; + double *__pyx_v_node_sum_total; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_2; - double *__pyx_t_3; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; + double *__pyx_t_1; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":504 + /* "sklearn/tree/_criterion.pyx":481 * """ * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":505 - * - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total - */ - __pyx_t_2 = __pyx_v_self->n_classes; - __pyx_v_n_classes = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":506 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_total = self.label_count_total - * cdef SIZE_t k - */ - __pyx_t_1 = __pyx_v_self->label_count_stride; - __pyx_v_label_count_stride = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":507 - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< * cdef SIZE_t k * */ - __pyx_t_3 = __pyx_v_self->label_count_total; - __pyx_v_label_count_total = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":510 + /* "sklearn/tree/_criterion.pyx":484 * cdef SIZE_t k * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) - * dest += label_count_stride + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * memcpy(dest, node_sum_total, self.n_classes[k] * sizeof(double)) + * dest += self.label_count_stride */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_k = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":511 + /* "sklearn/tree/_criterion.pyx":485 * - * for k in range(n_outputs): - * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< - * dest += label_count_stride - * label_count_total += label_count_stride + * for k in range(self.n_outputs): + * memcpy(dest, node_sum_total, self.n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< + * dest += self.label_count_stride + * node_sum_total += self.label_count_stride */ - memcpy(__pyx_v_dest, __pyx_v_label_count_total, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); + memcpy(__pyx_v_dest, __pyx_v_node_sum_total, ((__pyx_v_self->n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":512 - * for k in range(n_outputs): - * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) - * dest += label_count_stride # <<<<<<<<<<<<<< - * label_count_total += label_count_stride + /* "sklearn/tree/_criterion.pyx":486 + * for k in range(self.n_outputs): + * memcpy(dest, node_sum_total, self.n_classes[k] * sizeof(double)) + * dest += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_total += self.label_count_stride * */ - __pyx_v_dest = (__pyx_v_dest + __pyx_v_label_count_stride); + __pyx_v_dest = (__pyx_v_dest + __pyx_v_self->label_count_stride); - /* "sklearn/tree/_criterion.pyx":513 - * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) - * dest += label_count_stride - * label_count_total += label_count_stride # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":487 + * memcpy(dest, node_sum_total, self.n_classes[k] * sizeof(double)) + * dest += self.label_count_stride + * node_sum_total += self.label_count_stride # <<<<<<<<<<<<<< * * */ - __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); + __pyx_v_node_sum_total = (__pyx_v_node_sum_total + __pyx_v_self->label_count_stride); } - /* "sklearn/tree/_criterion.pyx":495 + /* "sklearn/tree/_criterion.pyx":472 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -4040,7 +3731,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_node_v /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":532 +/* "sklearn/tree/_criterion.pyx":506 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4049,202 +3740,134 @@ static void __pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_node_v */ static double __pyx_f_7sklearn_4tree_10_criterion_7Entropy_node_impurity(struct __pyx_obj_7sklearn_4tree_10_criterion_Entropy *__pyx_v_self) { - double __pyx_v_weighted_n_node_samples; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_total; + double *__pyx_v_node_sum_total; double __pyx_v_entropy; - double __pyx_v_total_entropy; double __pyx_v_count_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_c; double __pyx_r; - double __pyx_t_1; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_1; + double *__pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; - int __pyx_t_8; + int __pyx_t_7; - /* "sklearn/tree/_criterion.pyx":536 + /* "sklearn/tree/_criterion.pyx":510 * samples[start:end], using the cross-entropy criterion.""" * - * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< - * - * cdef SIZE_t n_outputs = self.n_outputs - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; - __pyx_v_weighted_n_node_samples = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":538 - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":539 - * - * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total + * cdef double* node_sum_total = self.node_sum_total + * cdef double entropy = 0.0 */ - __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; - __pyx_v_n_classes = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.n_classes; + __pyx_v_n_classes = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":540 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_total = self.label_count_total + /* "sklearn/tree/_criterion.pyx":511 * - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; - __pyx_v_label_count_stride = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":541 * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< - * + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< * cdef double entropy = 0.0 + * cdef double count_k */ - __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_total; - __pyx_v_label_count_total = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":543 - * cdef double* label_count_total = self.label_count_total - * + /* "sklearn/tree/_criterion.pyx":512 + * cdef SIZE_t* n_classes = self.n_classes + * cdef double* node_sum_total = self.node_sum_total * cdef double entropy = 0.0 # <<<<<<<<<<<<<< - * cdef double total_entropy = 0.0 * cdef double count_k + * cdef SIZE_t k, c */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_criterion.pyx":544 - * - * cdef double entropy = 0.0 - * cdef double total_entropy = 0.0 # <<<<<<<<<<<<<< - * cdef double count_k - * cdef SIZE_t k - */ - __pyx_v_total_entropy = 0.0; - - /* "sklearn/tree/_criterion.pyx":549 - * cdef SIZE_t c - * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * entropy = 0.0 - * - */ - __pyx_t_2 = __pyx_v_n_outputs; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { - __pyx_v_k = __pyx_t_5; - - /* "sklearn/tree/_criterion.pyx":550 - * - * for k in range(n_outputs): - * entropy = 0.0 # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":516 + * cdef SIZE_t k, c * + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< * for c in range(n_classes[k]): + * count_k = node_sum_total[c] */ - __pyx_v_entropy = 0.0; + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":552 - * entropy = 0.0 + /* "sklearn/tree/_criterion.pyx":517 * + * for k in range(self.n_outputs): * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * count_k = label_count_total[c] + * count_k = node_sum_total[c] * if count_k > 0.0: */ - __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_c = __pyx_t_7; + __pyx_t_5 = (__pyx_v_n_classes[__pyx_v_k]); + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_c = __pyx_t_6; - /* "sklearn/tree/_criterion.pyx":553 - * + /* "sklearn/tree/_criterion.pyx":518 + * for k in range(self.n_outputs): * for c in range(n_classes[k]): - * count_k = label_count_total[c] # <<<<<<<<<<<<<< + * count_k = node_sum_total[c] # <<<<<<<<<<<<<< * if count_k > 0.0: - * count_k /= weighted_n_node_samples + * count_k /= self.weighted_n_node_samples */ - __pyx_v_count_k = (__pyx_v_label_count_total[__pyx_v_c]); + __pyx_v_count_k = (__pyx_v_node_sum_total[__pyx_v_c]); - /* "sklearn/tree/_criterion.pyx":554 + /* "sklearn/tree/_criterion.pyx":519 * for c in range(n_classes[k]): - * count_k = label_count_total[c] + * count_k = node_sum_total[c] * if count_k > 0.0: # <<<<<<<<<<<<<< - * count_k /= weighted_n_node_samples + * count_k /= self.weighted_n_node_samples * entropy -= count_k * log(count_k) */ - __pyx_t_8 = ((__pyx_v_count_k > 0.0) != 0); - if (__pyx_t_8) { + __pyx_t_7 = ((__pyx_v_count_k > 0.0) != 0); + if (__pyx_t_7) { - /* "sklearn/tree/_criterion.pyx":555 - * count_k = label_count_total[c] + /* "sklearn/tree/_criterion.pyx":520 + * count_k = node_sum_total[c] * if count_k > 0.0: - * count_k /= weighted_n_node_samples # <<<<<<<<<<<<<< + * count_k /= self.weighted_n_node_samples # <<<<<<<<<<<<<< * entropy -= count_k * log(count_k) * */ - __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_weighted_n_node_samples); + __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples); - /* "sklearn/tree/_criterion.pyx":556 + /* "sklearn/tree/_criterion.pyx":521 * if count_k > 0.0: - * count_k /= weighted_n_node_samples + * count_k /= self.weighted_n_node_samples * entropy -= count_k * log(count_k) # <<<<<<<<<<<<<< * - * total_entropy += entropy + * node_sum_total += self.label_count_stride */ __pyx_v_entropy = (__pyx_v_entropy - (__pyx_v_count_k * __pyx_f_7sklearn_4tree_6_utils_log(__pyx_v_count_k))); + goto __pyx_L7; + } + __pyx_L7:; + } - /* "sklearn/tree/_criterion.pyx":554 - * for c in range(n_classes[k]): - * count_k = label_count_total[c] - * if count_k > 0.0: # <<<<<<<<<<<<<< - * count_k /= weighted_n_node_samples + /* "sklearn/tree/_criterion.pyx":523 * entropy -= count_k * log(count_k) - */ - } - } - - /* "sklearn/tree/_criterion.pyx":558 - * entropy -= count_k * log(count_k) - * - * total_entropy += entropy # <<<<<<<<<<<<<< - * label_count_total += label_count_stride - * - */ - __pyx_v_total_entropy = (__pyx_v_total_entropy + __pyx_v_entropy); - - /* "sklearn/tree/_criterion.pyx":559 * - * total_entropy += entropy - * label_count_total += label_count_stride # <<<<<<<<<<<<<< + * node_sum_total += self.label_count_stride # <<<<<<<<<<<<<< * - * return total_entropy / n_outputs + * return entropy / self.n_outputs */ - __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); + __pyx_v_node_sum_total = (__pyx_v_node_sum_total + __pyx_v_self->__pyx_base.label_count_stride); } - /* "sklearn/tree/_criterion.pyx":561 - * label_count_total += label_count_stride + /* "sklearn/tree/_criterion.pyx":525 + * node_sum_total += self.label_count_stride * - * return total_entropy / n_outputs # <<<<<<<<<<<<<< + * return entropy / self.n_outputs # <<<<<<<<<<<<<< * * cdef void children_impurity(self, double* impurity_left, */ - __pyx_r = (__pyx_v_total_entropy / __pyx_v_n_outputs); + __pyx_r = (__pyx_v_entropy / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":532 + /* "sklearn/tree/_criterion.pyx":506 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4257,8 +3880,8 @@ static double __pyx_f_7sklearn_4tree_10_criterion_7Entropy_node_impurity(struct return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":563 - * return total_entropy / n_outputs +/* "sklearn/tree/_criterion.pyx":527 + * return entropy / self.n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: @@ -4266,336 +3889,212 @@ static double __pyx_f_7sklearn_4tree_10_criterion_7Entropy_node_impurity(struct */ static void __pyx_f_7sklearn_4tree_10_criterion_7Entropy_children_impurity(struct __pyx_obj_7sklearn_4tree_10_criterion_Entropy *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right) { - CYTHON_UNUSED double __pyx_v_weighted_n_node_samples; - double __pyx_v_weighted_n_left; - double __pyx_v_weighted_n_right; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_left; - double *__pyx_v_label_count_right; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; double __pyx_v_entropy_left; double __pyx_v_entropy_right; - double __pyx_v_total_left; - double __pyx_v_total_right; double __pyx_v_count_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_c; - double __pyx_t_1; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_1; + double *__pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; - int __pyx_t_8; + int __pyx_t_7; - /* "sklearn/tree/_criterion.pyx":578 + /* "sklearn/tree/_criterion.pyx":542 * """ * - * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; - __pyx_v_weighted_n_node_samples = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":579 - * - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< - * cdef double weighted_n_right = self.weighted_n_right - * - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; - __pyx_v_weighted_n_left = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":580 - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< - * - * cdef SIZE_t n_outputs = self.n_outputs - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":582 - * cdef double weighted_n_right = self.weighted_n_right - * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":583 - * - * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right */ - __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; - __pyx_v_n_classes = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.n_classes; + __pyx_v_n_classes = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":584 - * cdef SIZE_t n_outputs = self.n_outputs + /* "sklearn/tree/_criterion.pyx":543 + * * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right + * cdef double entropy_left = 0.0 */ - __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; - __pyx_v_label_count_stride = __pyx_t_2; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":585 + /* "sklearn/tree/_criterion.pyx":544 * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< - * cdef double* label_count_right = self.label_count_right - * - */ - __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_left; - __pyx_v_label_count_left = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":586 - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< - * + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< * cdef double entropy_left = 0.0 + * cdef double entropy_right = 0.0 */ - __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_right; - __pyx_v_label_count_right = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":588 - * cdef double* label_count_right = self.label_count_right - * + /* "sklearn/tree/_criterion.pyx":545 + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right * cdef double entropy_left = 0.0 # <<<<<<<<<<<<<< * cdef double entropy_right = 0.0 - * cdef double total_left = 0.0 + * cdef double count_k */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_criterion.pyx":589 - * + /* "sklearn/tree/_criterion.pyx":546 + * cdef double* node_sum_right = self.node_sum_right * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 # <<<<<<<<<<<<<< - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 - */ - __pyx_v_entropy_right = 0.0; - - /* "sklearn/tree/_criterion.pyx":590 - * cdef double entropy_left = 0.0 - * cdef double entropy_right = 0.0 - * cdef double total_left = 0.0 # <<<<<<<<<<<<<< - * cdef double total_right = 0.0 - * cdef double count_k - */ - __pyx_v_total_left = 0.0; - - /* "sklearn/tree/_criterion.pyx":591 - * cdef double entropy_right = 0.0 - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 # <<<<<<<<<<<<<< * cdef double count_k - * cdef SIZE_t k - */ - __pyx_v_total_right = 0.0; - - /* "sklearn/tree/_criterion.pyx":596 - * cdef SIZE_t c - * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * entropy_left = 0.0 - * entropy_right = 0.0 - */ - __pyx_t_2 = __pyx_v_n_outputs; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { - __pyx_v_k = __pyx_t_5; - - /* "sklearn/tree/_criterion.pyx":597 - * - * for k in range(n_outputs): - * entropy_left = 0.0 # <<<<<<<<<<<<<< - * entropy_right = 0.0 - * + * cdef SIZE_t k, c */ - __pyx_v_entropy_left = 0.0; + __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_criterion.pyx":598 - * for k in range(n_outputs): - * entropy_left = 0.0 - * entropy_right = 0.0 # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":550 + * cdef SIZE_t k, c * + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< * for c in range(n_classes[k]): + * count_k = node_sum_left[c] */ - __pyx_v_entropy_right = 0.0; + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":600 - * entropy_right = 0.0 + /* "sklearn/tree/_criterion.pyx":551 * + * for k in range(self.n_outputs): * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * count_k = label_count_left[c] + * count_k = node_sum_left[c] * if count_k > 0.0: */ - __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_c = __pyx_t_7; + __pyx_t_5 = (__pyx_v_n_classes[__pyx_v_k]); + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_c = __pyx_t_6; - /* "sklearn/tree/_criterion.pyx":601 - * + /* "sklearn/tree/_criterion.pyx":552 + * for k in range(self.n_outputs): * for c in range(n_classes[k]): - * count_k = label_count_left[c] # <<<<<<<<<<<<<< + * count_k = node_sum_left[c] # <<<<<<<<<<<<<< * if count_k > 0.0: - * count_k /= weighted_n_left + * count_k /= self.weighted_n_left */ - __pyx_v_count_k = (__pyx_v_label_count_left[__pyx_v_c]); + __pyx_v_count_k = (__pyx_v_node_sum_left[__pyx_v_c]); - /* "sklearn/tree/_criterion.pyx":602 + /* "sklearn/tree/_criterion.pyx":553 * for c in range(n_classes[k]): - * count_k = label_count_left[c] + * count_k = node_sum_left[c] * if count_k > 0.0: # <<<<<<<<<<<<<< - * count_k /= weighted_n_left + * count_k /= self.weighted_n_left * entropy_left -= count_k * log(count_k) */ - __pyx_t_8 = ((__pyx_v_count_k > 0.0) != 0); - if (__pyx_t_8) { + __pyx_t_7 = ((__pyx_v_count_k > 0.0) != 0); + if (__pyx_t_7) { - /* "sklearn/tree/_criterion.pyx":603 - * count_k = label_count_left[c] + /* "sklearn/tree/_criterion.pyx":554 + * count_k = node_sum_left[c] * if count_k > 0.0: - * count_k /= weighted_n_left # <<<<<<<<<<<<<< + * count_k /= self.weighted_n_left # <<<<<<<<<<<<<< * entropy_left -= count_k * log(count_k) * */ - __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_weighted_n_left); + __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left); - /* "sklearn/tree/_criterion.pyx":604 + /* "sklearn/tree/_criterion.pyx":555 * if count_k > 0.0: - * count_k /= weighted_n_left + * count_k /= self.weighted_n_left * entropy_left -= count_k * log(count_k) # <<<<<<<<<<<<<< * - * count_k = label_count_right[c] + * count_k = node_sum_right[c] */ __pyx_v_entropy_left = (__pyx_v_entropy_left - (__pyx_v_count_k * __pyx_f_7sklearn_4tree_6_utils_log(__pyx_v_count_k))); - - /* "sklearn/tree/_criterion.pyx":602 - * for c in range(n_classes[k]): - * count_k = label_count_left[c] - * if count_k > 0.0: # <<<<<<<<<<<<<< - * count_k /= weighted_n_left - * entropy_left -= count_k * log(count_k) - */ + goto __pyx_L7; } + __pyx_L7:; - /* "sklearn/tree/_criterion.pyx":606 + /* "sklearn/tree/_criterion.pyx":557 * entropy_left -= count_k * log(count_k) * - * count_k = label_count_right[c] # <<<<<<<<<<<<<< + * count_k = node_sum_right[c] # <<<<<<<<<<<<<< * if count_k > 0.0: - * count_k /= weighted_n_right + * count_k /= self.weighted_n_right */ - __pyx_v_count_k = (__pyx_v_label_count_right[__pyx_v_c]); + __pyx_v_count_k = (__pyx_v_node_sum_right[__pyx_v_c]); - /* "sklearn/tree/_criterion.pyx":607 + /* "sklearn/tree/_criterion.pyx":558 * - * count_k = label_count_right[c] + * count_k = node_sum_right[c] * if count_k > 0.0: # <<<<<<<<<<<<<< - * count_k /= weighted_n_right + * count_k /= self.weighted_n_right * entropy_right -= count_k * log(count_k) */ - __pyx_t_8 = ((__pyx_v_count_k > 0.0) != 0); - if (__pyx_t_8) { + __pyx_t_7 = ((__pyx_v_count_k > 0.0) != 0); + if (__pyx_t_7) { - /* "sklearn/tree/_criterion.pyx":608 - * count_k = label_count_right[c] + /* "sklearn/tree/_criterion.pyx":559 + * count_k = node_sum_right[c] * if count_k > 0.0: - * count_k /= weighted_n_right # <<<<<<<<<<<<<< + * count_k /= self.weighted_n_right # <<<<<<<<<<<<<< * entropy_right -= count_k * log(count_k) * */ - __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_weighted_n_right); + __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right); - /* "sklearn/tree/_criterion.pyx":609 + /* "sklearn/tree/_criterion.pyx":560 * if count_k > 0.0: - * count_k /= weighted_n_right + * count_k /= self.weighted_n_right * entropy_right -= count_k * log(count_k) # <<<<<<<<<<<<<< * - * total_left += entropy_left + * node_sum_left += self.label_count_stride */ __pyx_v_entropy_right = (__pyx_v_entropy_right - (__pyx_v_count_k * __pyx_f_7sklearn_4tree_6_utils_log(__pyx_v_count_k))); - - /* "sklearn/tree/_criterion.pyx":607 - * - * count_k = label_count_right[c] - * if count_k > 0.0: # <<<<<<<<<<<<<< - * count_k /= weighted_n_right - * entropy_right -= count_k * log(count_k) - */ + goto __pyx_L8; } + __pyx_L8:; } - /* "sklearn/tree/_criterion.pyx":611 + /* "sklearn/tree/_criterion.pyx":562 * entropy_right -= count_k * log(count_k) * - * total_left += entropy_left # <<<<<<<<<<<<<< - * total_right += entropy_right - * label_count_left += label_count_stride - */ - __pyx_v_total_left = (__pyx_v_total_left + __pyx_v_entropy_left); - - /* "sklearn/tree/_criterion.pyx":612 + * node_sum_left += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_right += self.label_count_stride * - * total_left += entropy_left - * total_right += entropy_right # <<<<<<<<<<<<<< - * label_count_left += label_count_stride - * label_count_right += label_count_stride */ - __pyx_v_total_right = (__pyx_v_total_right + __pyx_v_entropy_right); + __pyx_v_node_sum_left = (__pyx_v_node_sum_left + __pyx_v_self->__pyx_base.label_count_stride); - /* "sklearn/tree/_criterion.pyx":613 - * total_left += entropy_left - * total_right += entropy_right - * label_count_left += label_count_stride # <<<<<<<<<<<<<< - * label_count_right += label_count_stride + /* "sklearn/tree/_criterion.pyx":563 * - */ - __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); - - /* "sklearn/tree/_criterion.pyx":614 - * total_right += entropy_right - * label_count_left += label_count_stride - * label_count_right += label_count_stride # <<<<<<<<<<<<<< + * node_sum_left += self.label_count_stride + * node_sum_right += self.label_count_stride # <<<<<<<<<<<<<< * - * impurity_left[0] = total_left / n_outputs + * impurity_left[0] = entropy_left / self.n_outputs */ - __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); + __pyx_v_node_sum_right = (__pyx_v_node_sum_right + __pyx_v_self->__pyx_base.label_count_stride); } - /* "sklearn/tree/_criterion.pyx":616 - * label_count_right += label_count_stride + /* "sklearn/tree/_criterion.pyx":565 + * node_sum_right += self.label_count_stride * - * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< - * impurity_right[0] = total_right / n_outputs + * impurity_left[0] = entropy_left / self.n_outputs # <<<<<<<<<<<<<< + * impurity_right[0] = entropy_right / self.n_outputs * */ - (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); + (__pyx_v_impurity_left[0]) = (__pyx_v_entropy_left / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); - /* "sklearn/tree/_criterion.pyx":617 + /* "sklearn/tree/_criterion.pyx":566 * - * impurity_left[0] = total_left / n_outputs - * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< + * impurity_left[0] = entropy_left / self.n_outputs + * impurity_right[0] = entropy_right / self.n_outputs # <<<<<<<<<<<<<< * * */ - (__pyx_v_impurity_right[0]) = (__pyx_v_total_right / __pyx_v_n_outputs); + (__pyx_v_impurity_right[0]) = (__pyx_v_entropy_right / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); - /* "sklearn/tree/_criterion.pyx":563 - * return total_entropy / n_outputs + /* "sklearn/tree/_criterion.pyx":527 + * return entropy / self.n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: @@ -4605,7 +4104,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_7Entropy_children_impurity(struc /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":637 +/* "sklearn/tree/_criterion.pyx":586 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4614,182 +4113,130 @@ static void __pyx_f_7sklearn_4tree_10_criterion_7Entropy_children_impurity(struc */ static double __pyx_f_7sklearn_4tree_10_criterion_4Gini_node_impurity(struct __pyx_obj_7sklearn_4tree_10_criterion_Gini *__pyx_v_self) { - double __pyx_v_weighted_n_node_samples; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_total; + double *__pyx_v_node_sum_total; double __pyx_v_gini; - double __pyx_v_total; + double __pyx_v_sq_count; double __pyx_v_count_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_c; double __pyx_r; - double __pyx_t_1; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_1; + double *__pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; - - /* "sklearn/tree/_criterion.pyx":641 - * samples[start:end] using the Gini criterion.""" - * - * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< - * - * cdef SIZE_t n_outputs = self.n_outputs - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; - __pyx_v_weighted_n_node_samples = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":643 - * cdef double weighted_n_node_samples = self.weighted_n_node_samples + /* "sklearn/tree/_criterion.pyx":591 * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":644 * - * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total + * cdef double* node_sum_total = self.node_sum_total + * cdef double gini = 0.0 */ - __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; - __pyx_v_n_classes = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.n_classes; + __pyx_v_n_classes = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":645 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_total = self.label_count_total + /* "sklearn/tree/_criterion.pyx":592 * - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; - __pyx_v_label_count_stride = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":646 * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< - * + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< * cdef double gini = 0.0 + * cdef double sq_count */ - __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_total; - __pyx_v_label_count_total = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":648 - * cdef double* label_count_total = self.label_count_total - * + /* "sklearn/tree/_criterion.pyx":593 + * cdef SIZE_t* n_classes = self.n_classes + * cdef double* node_sum_total = self.node_sum_total * cdef double gini = 0.0 # <<<<<<<<<<<<<< - * cdef double total = 0.0 + * cdef double sq_count * cdef double count_k */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_criterion.pyx":649 - * - * cdef double gini = 0.0 - * cdef double total = 0.0 # <<<<<<<<<<<<<< - * cdef double count_k - * cdef SIZE_t k - */ - __pyx_v_total = 0.0; - - /* "sklearn/tree/_criterion.pyx":654 - * cdef SIZE_t c + /* "sklearn/tree/_criterion.pyx":598 + * cdef SIZE_t k, c * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * gini = 0.0 + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * sq_count = 0.0 * */ - __pyx_t_2 = __pyx_v_n_outputs; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { - __pyx_v_k = __pyx_t_5; + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":655 + /* "sklearn/tree/_criterion.pyx":599 * - * for k in range(n_outputs): - * gini = 0.0 # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): + * sq_count = 0.0 # <<<<<<<<<<<<<< * * for c in range(n_classes[k]): */ - __pyx_v_gini = 0.0; + __pyx_v_sq_count = 0.0; - /* "sklearn/tree/_criterion.pyx":657 - * gini = 0.0 + /* "sklearn/tree/_criterion.pyx":601 + * sq_count = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * count_k = label_count_total[c] - * gini += count_k * count_k + * count_k = node_sum_total[c] + * sq_count += count_k * count_k */ - __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_c = __pyx_t_7; + __pyx_t_5 = (__pyx_v_n_classes[__pyx_v_k]); + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_c = __pyx_t_6; - /* "sklearn/tree/_criterion.pyx":658 + /* "sklearn/tree/_criterion.pyx":602 * * for c in range(n_classes[k]): - * count_k = label_count_total[c] # <<<<<<<<<<<<<< - * gini += count_k * count_k + * count_k = node_sum_total[c] # <<<<<<<<<<<<<< + * sq_count += count_k * count_k * */ - __pyx_v_count_k = (__pyx_v_label_count_total[__pyx_v_c]); + __pyx_v_count_k = (__pyx_v_node_sum_total[__pyx_v_c]); - /* "sklearn/tree/_criterion.pyx":659 + /* "sklearn/tree/_criterion.pyx":603 * for c in range(n_classes[k]): - * count_k = label_count_total[c] - * gini += count_k * count_k # <<<<<<<<<<<<<< + * count_k = node_sum_total[c] + * sq_count += count_k * count_k # <<<<<<<<<<<<<< * - * gini = 1.0 - gini / (weighted_n_node_samples * + * gini += 1.0 - sq_count / (self.weighted_n_node_samples * */ - __pyx_v_gini = (__pyx_v_gini + (__pyx_v_count_k * __pyx_v_count_k)); + __pyx_v_sq_count = (__pyx_v_sq_count + (__pyx_v_count_k * __pyx_v_count_k)); } - /* "sklearn/tree/_criterion.pyx":661 - * gini += count_k * count_k - * - * gini = 1.0 - gini / (weighted_n_node_samples * # <<<<<<<<<<<<<< - * weighted_n_node_samples) - * - */ - __pyx_v_gini = (1.0 - (__pyx_v_gini / (__pyx_v_weighted_n_node_samples * __pyx_v_weighted_n_node_samples))); - - /* "sklearn/tree/_criterion.pyx":664 - * weighted_n_node_samples) + /* "sklearn/tree/_criterion.pyx":605 + * sq_count += count_k * count_k * - * total += gini # <<<<<<<<<<<<<< - * label_count_total += label_count_stride + * gini += 1.0 - sq_count / (self.weighted_n_node_samples * # <<<<<<<<<<<<<< + * self.weighted_n_node_samples) * */ - __pyx_v_total = (__pyx_v_total + __pyx_v_gini); + __pyx_v_gini = (__pyx_v_gini + (1.0 - (__pyx_v_sq_count / (__pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples * __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples)))); - /* "sklearn/tree/_criterion.pyx":665 + /* "sklearn/tree/_criterion.pyx":608 + * self.weighted_n_node_samples) * - * total += gini - * label_count_total += label_count_stride # <<<<<<<<<<<<<< + * node_sum_total += self.label_count_stride # <<<<<<<<<<<<<< * - * return total / n_outputs + * return gini / self.n_outputs */ - __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); + __pyx_v_node_sum_total = (__pyx_v_node_sum_total + __pyx_v_self->__pyx_base.label_count_stride); } - /* "sklearn/tree/_criterion.pyx":667 - * label_count_total += label_count_stride + /* "sklearn/tree/_criterion.pyx":610 + * node_sum_total += self.label_count_stride * - * return total / n_outputs # <<<<<<<<<<<<<< + * return gini / self.n_outputs # <<<<<<<<<<<<<< * * cdef void children_impurity(self, double* impurity_left, */ - __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); + __pyx_r = (__pyx_v_gini / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":637 + /* "sklearn/tree/_criterion.pyx":586 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4802,8 +4249,8 @@ static double __pyx_f_7sklearn_4tree_10_criterion_4Gini_node_impurity(struct __p return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":669 - * return total / n_outputs +/* "sklearn/tree/_criterion.pyx":612 + * return gini / self.n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: @@ -4811,307 +4258,205 @@ static double __pyx_f_7sklearn_4tree_10_criterion_4Gini_node_impurity(struct __p */ static void __pyx_f_7sklearn_4tree_10_criterion_4Gini_children_impurity(struct __pyx_obj_7sklearn_4tree_10_criterion_Gini *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right) { - CYTHON_UNUSED double __pyx_v_weighted_n_node_samples; - double __pyx_v_weighted_n_left; - double __pyx_v_weighted_n_right; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_n_classes; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_label_count_stride; - double *__pyx_v_label_count_left; - double *__pyx_v_label_count_right; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; double __pyx_v_gini_left; double __pyx_v_gini_right; - CYTHON_UNUSED double __pyx_v_total; - double __pyx_v_total_left; - double __pyx_v_total_right; + double __pyx_v_sq_count_left; + double __pyx_v_sq_count_right; double __pyx_v_count_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_c; - double __pyx_t_1; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_1; + double *__pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; - /* "sklearn/tree/_criterion.pyx":684 + /* "sklearn/tree/_criterion.pyx":627 * """ * - * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; - __pyx_v_weighted_n_node_samples = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":685 - * - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< - * cdef double weighted_n_right = self.weighted_n_right - * - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; - __pyx_v_weighted_n_left = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":686 - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< - * - * cdef SIZE_t n_outputs = self.n_outputs - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":688 - * cdef double weighted_n_right = self.weighted_n_right - * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":689 - * - * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right */ - __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; - __pyx_v_n_classes = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.n_classes; + __pyx_v_n_classes = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":690 - * cdef SIZE_t n_outputs = self.n_outputs + /* "sklearn/tree/_criterion.pyx":628 + * * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right + * cdef double gini_left = 0.0 */ - __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; - __pyx_v_label_count_stride = __pyx_t_2; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":691 + /* "sklearn/tree/_criterion.pyx":629 * cdef SIZE_t* n_classes = self.n_classes - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< - * cdef double* label_count_right = self.label_count_right - * - */ - __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_left; - __pyx_v_label_count_left = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":692 - * cdef SIZE_t label_count_stride = self.label_count_stride - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< - * + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< * cdef double gini_left = 0.0 + * cdef double gini_right = 0.0 */ - __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_right; - __pyx_v_label_count_right = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":694 - * cdef double* label_count_right = self.label_count_right - * + /* "sklearn/tree/_criterion.pyx":630 + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right * cdef double gini_left = 0.0 # <<<<<<<<<<<<<< * cdef double gini_right = 0.0 - * cdef double total = 0.0 + * cdef double sq_count_left */ __pyx_v_gini_left = 0.0; - /* "sklearn/tree/_criterion.pyx":695 - * + /* "sklearn/tree/_criterion.pyx":631 + * cdef double* node_sum_right = self.node_sum_right * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 # <<<<<<<<<<<<<< - * cdef double total = 0.0 - * cdef double total_left = 0.0 + * cdef double sq_count_left + * cdef double sq_count_right */ __pyx_v_gini_right = 0.0; - /* "sklearn/tree/_criterion.pyx":696 - * cdef double gini_left = 0.0 - * cdef double gini_right = 0.0 - * cdef double total = 0.0 # <<<<<<<<<<<<<< - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 - */ - __pyx_v_total = 0.0; - - /* "sklearn/tree/_criterion.pyx":697 - * cdef double gini_right = 0.0 - * cdef double total = 0.0 - * cdef double total_left = 0.0 # <<<<<<<<<<<<<< - * cdef double total_right = 0.0 - * cdef double count_k - */ - __pyx_v_total_left = 0.0; - - /* "sklearn/tree/_criterion.pyx":698 - * cdef double total = 0.0 - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 # <<<<<<<<<<<<<< - * cdef double count_k - * cdef SIZE_t k - */ - __pyx_v_total_right = 0.0; - - /* "sklearn/tree/_criterion.pyx":703 - * cdef SIZE_t c + /* "sklearn/tree/_criterion.pyx":637 + * cdef SIZE_t k, c * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * gini_left = 0.0 - * gini_right = 0.0 + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * sq_count_left = 0.0 + * sq_count_right = 0.0 */ - __pyx_t_2 = __pyx_v_n_outputs; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { - __pyx_v_k = __pyx_t_5; + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":704 + /* "sklearn/tree/_criterion.pyx":638 * - * for k in range(n_outputs): - * gini_left = 0.0 # <<<<<<<<<<<<<< - * gini_right = 0.0 + * for k in range(self.n_outputs): + * sq_count_left = 0.0 # <<<<<<<<<<<<<< + * sq_count_right = 0.0 * */ - __pyx_v_gini_left = 0.0; + __pyx_v_sq_count_left = 0.0; - /* "sklearn/tree/_criterion.pyx":705 - * for k in range(n_outputs): - * gini_left = 0.0 - * gini_right = 0.0 # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":639 + * for k in range(self.n_outputs): + * sq_count_left = 0.0 + * sq_count_right = 0.0 # <<<<<<<<<<<<<< * * for c in range(n_classes[k]): */ - __pyx_v_gini_right = 0.0; + __pyx_v_sq_count_right = 0.0; - /* "sklearn/tree/_criterion.pyx":707 - * gini_right = 0.0 + /* "sklearn/tree/_criterion.pyx":641 + * sq_count_right = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * count_k = label_count_left[c] - * gini_left += count_k * count_k + * count_k = node_sum_left[c] + * sq_count_left += count_k * count_k */ - __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_c = __pyx_t_7; + __pyx_t_5 = (__pyx_v_n_classes[__pyx_v_k]); + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_c = __pyx_t_6; - /* "sklearn/tree/_criterion.pyx":708 + /* "sklearn/tree/_criterion.pyx":642 * * for c in range(n_classes[k]): - * count_k = label_count_left[c] # <<<<<<<<<<<<<< - * gini_left += count_k * count_k + * count_k = node_sum_left[c] # <<<<<<<<<<<<<< + * sq_count_left += count_k * count_k * */ - __pyx_v_count_k = (__pyx_v_label_count_left[__pyx_v_c]); + __pyx_v_count_k = (__pyx_v_node_sum_left[__pyx_v_c]); - /* "sklearn/tree/_criterion.pyx":709 + /* "sklearn/tree/_criterion.pyx":643 * for c in range(n_classes[k]): - * count_k = label_count_left[c] - * gini_left += count_k * count_k # <<<<<<<<<<<<<< + * count_k = node_sum_left[c] + * sq_count_left += count_k * count_k # <<<<<<<<<<<<<< * - * count_k = label_count_right[c] + * count_k = node_sum_right[c] */ - __pyx_v_gini_left = (__pyx_v_gini_left + (__pyx_v_count_k * __pyx_v_count_k)); + __pyx_v_sq_count_left = (__pyx_v_sq_count_left + (__pyx_v_count_k * __pyx_v_count_k)); - /* "sklearn/tree/_criterion.pyx":711 - * gini_left += count_k * count_k + /* "sklearn/tree/_criterion.pyx":645 + * sq_count_left += count_k * count_k * - * count_k = label_count_right[c] # <<<<<<<<<<<<<< - * gini_right += count_k * count_k + * count_k = node_sum_right[c] # <<<<<<<<<<<<<< + * sq_count_right += count_k * count_k * */ - __pyx_v_count_k = (__pyx_v_label_count_right[__pyx_v_c]); + __pyx_v_count_k = (__pyx_v_node_sum_right[__pyx_v_c]); - /* "sklearn/tree/_criterion.pyx":712 + /* "sklearn/tree/_criterion.pyx":646 * - * count_k = label_count_right[c] - * gini_right += count_k * count_k # <<<<<<<<<<<<<< + * count_k = node_sum_right[c] + * sq_count_right += count_k * count_k # <<<<<<<<<<<<<< * - * gini_left = 1.0 - gini_left / (weighted_n_left * + * gini_left += 1.0 - sq_count_left / (self.weighted_n_left * */ - __pyx_v_gini_right = (__pyx_v_gini_right + (__pyx_v_count_k * __pyx_v_count_k)); + __pyx_v_sq_count_right = (__pyx_v_sq_count_right + (__pyx_v_count_k * __pyx_v_count_k)); } - /* "sklearn/tree/_criterion.pyx":714 - * gini_right += count_k * count_k + /* "sklearn/tree/_criterion.pyx":648 + * sq_count_right += count_k * count_k * - * gini_left = 1.0 - gini_left / (weighted_n_left * # <<<<<<<<<<<<<< - * weighted_n_left) + * gini_left += 1.0 - sq_count_left / (self.weighted_n_left * # <<<<<<<<<<<<<< + * self.weighted_n_left) * */ - __pyx_v_gini_left = (1.0 - (__pyx_v_gini_left / (__pyx_v_weighted_n_left * __pyx_v_weighted_n_left))); + __pyx_v_gini_left = (__pyx_v_gini_left + (1.0 - (__pyx_v_sq_count_left / (__pyx_v_self->__pyx_base.__pyx_base.weighted_n_left * __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left)))); - /* "sklearn/tree/_criterion.pyx":717 - * weighted_n_left) + /* "sklearn/tree/_criterion.pyx":651 + * self.weighted_n_left) * - * gini_right = 1.0 - gini_right / (weighted_n_right * # <<<<<<<<<<<<<< - * weighted_n_right) + * gini_right += 1.0 - sq_count_right / (self.weighted_n_right * # <<<<<<<<<<<<<< + * self.weighted_n_right) * */ - __pyx_v_gini_right = (1.0 - (__pyx_v_gini_right / (__pyx_v_weighted_n_right * __pyx_v_weighted_n_right))); + __pyx_v_gini_right = (__pyx_v_gini_right + (1.0 - (__pyx_v_sq_count_right / (__pyx_v_self->__pyx_base.__pyx_base.weighted_n_right * __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right)))); - /* "sklearn/tree/_criterion.pyx":720 - * weighted_n_right) + /* "sklearn/tree/_criterion.pyx":654 + * self.weighted_n_right) * - * total_left += gini_left # <<<<<<<<<<<<<< - * total_right += gini_right - * label_count_left += label_count_stride - */ - __pyx_v_total_left = (__pyx_v_total_left + __pyx_v_gini_left); - - /* "sklearn/tree/_criterion.pyx":721 + * node_sum_left += self.label_count_stride # <<<<<<<<<<<<<< + * node_sum_right += self.label_count_stride * - * total_left += gini_left - * total_right += gini_right # <<<<<<<<<<<<<< - * label_count_left += label_count_stride - * label_count_right += label_count_stride */ - __pyx_v_total_right = (__pyx_v_total_right + __pyx_v_gini_right); + __pyx_v_node_sum_left = (__pyx_v_node_sum_left + __pyx_v_self->__pyx_base.label_count_stride); - /* "sklearn/tree/_criterion.pyx":722 - * total_left += gini_left - * total_right += gini_right - * label_count_left += label_count_stride # <<<<<<<<<<<<<< - * label_count_right += label_count_stride + /* "sklearn/tree/_criterion.pyx":655 * - */ - __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); - - /* "sklearn/tree/_criterion.pyx":723 - * total_right += gini_right - * label_count_left += label_count_stride - * label_count_right += label_count_stride # <<<<<<<<<<<<<< + * node_sum_left += self.label_count_stride + * node_sum_right += self.label_count_stride # <<<<<<<<<<<<<< * - * impurity_left[0] = total_left / n_outputs + * impurity_left[0] = gini_left / self.n_outputs */ - __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); + __pyx_v_node_sum_right = (__pyx_v_node_sum_right + __pyx_v_self->__pyx_base.label_count_stride); } - /* "sklearn/tree/_criterion.pyx":725 - * label_count_right += label_count_stride + /* "sklearn/tree/_criterion.pyx":657 + * node_sum_right += self.label_count_stride * - * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< - * impurity_right[0] = total_right / n_outputs + * impurity_left[0] = gini_left / self.n_outputs # <<<<<<<<<<<<<< + * impurity_right[0] = gini_right / self.n_outputs * */ - (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); + (__pyx_v_impurity_left[0]) = (__pyx_v_gini_left / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); - /* "sklearn/tree/_criterion.pyx":726 + /* "sklearn/tree/_criterion.pyx":658 * - * impurity_left[0] = total_left / n_outputs - * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< + * impurity_left[0] = gini_left / self.n_outputs + * impurity_right[0] = gini_right / self.n_outputs # <<<<<<<<<<<<<< * * */ - (__pyx_v_impurity_right[0]) = (__pyx_v_total_right / __pyx_v_n_outputs); + (__pyx_v_impurity_right[0]) = (__pyx_v_gini_right / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); - /* "sklearn/tree/_criterion.pyx":669 - * return total / n_outputs + /* "sklearn/tree/_criterion.pyx":612 + * return gini / self.n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: @@ -5121,8 +4466,8 @@ static void __pyx_f_7sklearn_4tree_10_criterion_4Gini_children_impurity(struct _ /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":747 - * cdef double* sum_total +/* "sklearn/tree/_criterion.pyx":673 + * """ * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< * """Initialize parameters for this criterion. @@ -5157,18 +4502,18 @@ static int __pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_1__cinit__ else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } - __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._criterion.RegressionCriterion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5191,7 +4536,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_criterion.pyx":757 + /* "sklearn/tree/_criterion.pyx":683 * * # Default values * self.y = NULL # <<<<<<<<<<<<<< @@ -5200,7 +4545,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_criterion.pyx":758 + /* "sklearn/tree/_criterion.pyx":684 * # Default values * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -5209,7 +4554,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_criterion.pyx":759 + /* "sklearn/tree/_criterion.pyx":685 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -5218,7 +4563,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_criterion.pyx":761 + /* "sklearn/tree/_criterion.pyx":687 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -5227,7 +4572,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_criterion.pyx":762 + /* "sklearn/tree/_criterion.pyx":688 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -5236,7 +4581,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_criterion.pyx":763 + /* "sklearn/tree/_criterion.pyx":689 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -5245,7 +4590,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_criterion.pyx":764 + /* "sklearn/tree/_criterion.pyx":690 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -5254,7 +4599,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_criterion.pyx":766 + /* "sklearn/tree/_criterion.pyx":692 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -5263,7 +4608,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.n_outputs = __pyx_v_n_outputs; - /* "sklearn/tree/_criterion.pyx":767 + /* "sklearn/tree/_criterion.pyx":693 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -5272,7 +4617,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.n_node_samples = 0; - /* "sklearn/tree/_criterion.pyx":768 + /* "sklearn/tree/_criterion.pyx":694 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -5281,7 +4626,7 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.weighted_n_node_samples = 0.0; - /* "sklearn/tree/_criterion.pyx":769 + /* "sklearn/tree/_criterion.pyx":695 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -5290,201 +4635,140 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_criterion.pyx":770 + /* "sklearn/tree/_criterion.pyx":696 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< * - * # Allocate accumulators. Make sure they are NULL, not uninitialized, + * self.sq_sum_left = 0.0 */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_criterion.pyx":774 - * # Allocate accumulators. Make sure they are NULL, not uninitialized, - * # before an exception can be raised (which triggers __dealloc__). - * self.sq_sum_tmp = NULL # <<<<<<<<<<<<<< - * self.sq_sum_total = NULL - * self.sum_left = NULL + /* "sklearn/tree/_criterion.pyx":698 + * self.weighted_n_right = 0.0 + * + * self.sq_sum_left = 0.0 # <<<<<<<<<<<<<< + * self.sq_sum_right = 0.0 + * self.sq_sum_total = 0.0 */ - __pyx_v_self->sq_sum_tmp = NULL; + __pyx_v_self->__pyx_base.sq_sum_left = 0.0; - /* "sklearn/tree/_criterion.pyx":775 - * # before an exception can be raised (which triggers __dealloc__). - * self.sq_sum_tmp = NULL - * self.sq_sum_total = NULL # <<<<<<<<<<<<<< - * self.sum_left = NULL - * self.sum_right = NULL + /* "sklearn/tree/_criterion.pyx":699 + * + * self.sq_sum_left = 0.0 + * self.sq_sum_right = 0.0 # <<<<<<<<<<<<<< + * self.sq_sum_total = 0.0 + * */ - __pyx_v_self->sq_sum_total = NULL; + __pyx_v_self->__pyx_base.sq_sum_right = 0.0; - /* "sklearn/tree/_criterion.pyx":776 - * self.sq_sum_tmp = NULL - * self.sq_sum_total = NULL - * self.sum_left = NULL # <<<<<<<<<<<<<< - * self.sum_right = NULL - * self.sum_total = NULL + /* "sklearn/tree/_criterion.pyx":700 + * self.sq_sum_left = 0.0 + * self.sq_sum_right = 0.0 + * self.sq_sum_total = 0.0 # <<<<<<<<<<<<<< + * + * # Allocate accumulators. Make sure they are NULL, not uninitialized, */ - __pyx_v_self->sum_left = NULL; + __pyx_v_self->__pyx_base.sq_sum_total = 0.0; - /* "sklearn/tree/_criterion.pyx":777 - * self.sq_sum_total = NULL - * self.sum_left = NULL - * self.sum_right = NULL # <<<<<<<<<<<<<< - * self.sum_total = NULL - * + /* "sklearn/tree/_criterion.pyx":704 + * # Allocate accumulators. Make sure they are NULL, not uninitialized, + * # before an exception can be raised (which triggers __dealloc__). + * self.node_sum_total = NULL # <<<<<<<<<<<<<< + * self.node_sum_left = NULL + * self.node_sum_right = NULL */ - __pyx_v_self->sum_right = NULL; + __pyx_v_self->__pyx_base.node_sum_total = NULL; - /* "sklearn/tree/_criterion.pyx":778 - * self.sum_left = NULL - * self.sum_right = NULL - * self.sum_total = NULL # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":705 + * # before an exception can be raised (which triggers __dealloc__). + * self.node_sum_total = NULL + * self.node_sum_left = NULL # <<<<<<<<<<<<<< + * self.node_sum_right = NULL * - * # Allocate memory for the accumulators */ - __pyx_v_self->sum_total = NULL; + __pyx_v_self->__pyx_base.node_sum_left = NULL; - /* "sklearn/tree/_criterion.pyx":781 + /* "sklearn/tree/_criterion.pyx":706 + * self.node_sum_total = NULL + * self.node_sum_left = NULL + * self.node_sum_right = NULL # <<<<<<<<<<<<<< * * # Allocate memory for the accumulators - * self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< - * self.sq_sum_total = calloc(n_outputs, sizeof(double)) - * self.sum_left = calloc(n_outputs, sizeof(double)) */ - __pyx_v_self->sq_sum_tmp = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); + __pyx_v_self->__pyx_base.node_sum_right = NULL; - /* "sklearn/tree/_criterion.pyx":782 + /* "sklearn/tree/_criterion.pyx":709 + * * # Allocate memory for the accumulators - * self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) - * self.sq_sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< - * self.sum_left = calloc(n_outputs, sizeof(double)) - * self.sum_right = calloc(n_outputs, sizeof(double)) - */ - __pyx_v_self->sq_sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - - /* "sklearn/tree/_criterion.pyx":783 - * self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) - * self.sq_sum_total = calloc(n_outputs, sizeof(double)) - * self.sum_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< - * self.sum_right = calloc(n_outputs, sizeof(double)) - * self.sum_total = calloc(n_outputs, sizeof(double)) + * self.node_sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< + * self.node_sum_left = calloc(n_outputs, sizeof(double)) + * self.node_sum_right = calloc(n_outputs, sizeof(double)) */ - __pyx_v_self->sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); + __pyx_v_self->__pyx_base.node_sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":784 - * self.sq_sum_total = calloc(n_outputs, sizeof(double)) - * self.sum_left = calloc(n_outputs, sizeof(double)) - * self.sum_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< - * self.sum_total = calloc(n_outputs, sizeof(double)) + /* "sklearn/tree/_criterion.pyx":710 + * # Allocate memory for the accumulators + * self.node_sum_total = calloc(n_outputs, sizeof(double)) + * self.node_sum_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< + * self.node_sum_right = calloc(n_outputs, sizeof(double)) * */ - __pyx_v_self->sum_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); + __pyx_v_self->__pyx_base.node_sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":785 - * self.sum_left = calloc(n_outputs, sizeof(double)) - * self.sum_right = calloc(n_outputs, sizeof(double)) - * self.sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":711 + * self.node_sum_total = calloc(n_outputs, sizeof(double)) + * self.node_sum_left = calloc(n_outputs, sizeof(double)) + * self.node_sum_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * - * if (self.sq_sum_tmp == NULL or + * if (self.node_sum_total == NULL or self.node_sum_left == NULL or */ - __pyx_v_self->sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); + __pyx_v_self->__pyx_base.node_sum_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":787 - * self.sum_total = calloc(n_outputs, sizeof(double)) + /* "sklearn/tree/_criterion.pyx":713 + * self.node_sum_right = calloc(n_outputs, sizeof(double)) * - * if (self.sq_sum_tmp == NULL or # <<<<<<<<<<<<<< - * self.sq_sum_total == NULL or - * self.sum_left == NULL or + * if (self.node_sum_total == NULL or self.node_sum_left == NULL or # <<<<<<<<<<<<<< + * self.node_sum_right == NULL): + * raise MemoryError() */ - __pyx_t_2 = ((__pyx_v_self->sq_sum_tmp == NULL) != 0); + __pyx_t_2 = ((__pyx_v_self->__pyx_base.node_sum_total == NULL) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - - /* "sklearn/tree/_criterion.pyx":788 - * - * if (self.sq_sum_tmp == NULL or - * self.sq_sum_total == NULL or # <<<<<<<<<<<<<< - * self.sum_left == NULL or - * self.sum_right == NULL or - */ - __pyx_t_2 = ((__pyx_v_self->sq_sum_total == NULL) != 0); + __pyx_t_2 = ((__pyx_v_self->__pyx_base.node_sum_left == NULL) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_criterion.pyx":789 - * if (self.sq_sum_tmp == NULL or - * self.sq_sum_total == NULL or - * self.sum_left == NULL or # <<<<<<<<<<<<<< - * self.sum_right == NULL or - * self.sum_total == NULL): - */ - __pyx_t_2 = ((__pyx_v_self->sum_left == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_criterion.pyx":790 - * self.sq_sum_total == NULL or - * self.sum_left == NULL or - * self.sum_right == NULL or # <<<<<<<<<<<<<< - * self.sum_total == NULL): - * raise MemoryError() - */ - __pyx_t_2 = ((__pyx_v_self->sum_right == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_criterion.pyx":791 - * self.sum_left == NULL or - * self.sum_right == NULL or - * self.sum_total == NULL): # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":714 + * + * if (self.node_sum_total == NULL or self.node_sum_left == NULL or + * self.node_sum_right == NULL): # <<<<<<<<<<<<<< * raise MemoryError() * */ - __pyx_t_2 = ((__pyx_v_self->sum_total == NULL) != 0); + __pyx_t_2 = ((__pyx_v_self->__pyx_base.node_sum_right == NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - - /* "sklearn/tree/_criterion.pyx":787 - * self.sum_total = calloc(n_outputs, sizeof(double)) - * - * if (self.sq_sum_tmp == NULL or # <<<<<<<<<<<<<< - * self.sq_sum_total == NULL or - * self.sum_left == NULL or - */ if (__pyx_t_1) { - /* "sklearn/tree/_criterion.pyx":792 - * self.sum_right == NULL or - * self.sum_total == NULL): + /* "sklearn/tree/_criterion.pyx":715 + * if (self.node_sum_total == NULL or self.node_sum_left == NULL or + * self.node_sum_right == NULL): * raise MemoryError() # <<<<<<<<<<<<<< * - * def __dealloc__(self): - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_criterion.pyx":787 - * self.sum_total = calloc(n_outputs, sizeof(double)) - * - * if (self.sq_sum_tmp == NULL or # <<<<<<<<<<<<<< - * self.sq_sum_total == NULL or - * self.sum_left == NULL or + * def __reduce__(self): */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_criterion.pyx":747 - * cdef double* sum_total + /* "sklearn/tree/_criterion.pyx":673 + * """ * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< * """Initialize parameters for this criterion. @@ -5502,108 +4786,28 @@ static int __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion___cinit__( return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":794 - * raise MemoryError() - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor""" - * free(self.sq_sum_tmp) - */ - -/* Python wrapper */ -static void __pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_3__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_2__dealloc__(((struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_2__dealloc__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "sklearn/tree/_criterion.pyx":796 - * def __dealloc__(self): - * """Destructor""" - * free(self.sq_sum_tmp) # <<<<<<<<<<<<<< - * free(self.sq_sum_total) - * free(self.sum_left) - */ - free(__pyx_v_self->sq_sum_tmp); - - /* "sklearn/tree/_criterion.pyx":797 - * """Destructor""" - * free(self.sq_sum_tmp) - * free(self.sq_sum_total) # <<<<<<<<<<<<<< - * free(self.sum_left) - * free(self.sum_right) - */ - free(__pyx_v_self->sq_sum_total); - - /* "sklearn/tree/_criterion.pyx":798 - * free(self.sq_sum_tmp) - * free(self.sq_sum_total) - * free(self.sum_left) # <<<<<<<<<<<<<< - * free(self.sum_right) - * free(self.sum_total) - */ - free(__pyx_v_self->sum_left); - - /* "sklearn/tree/_criterion.pyx":799 - * free(self.sq_sum_total) - * free(self.sum_left) - * free(self.sum_right) # <<<<<<<<<<<<<< - * free(self.sum_total) - * - */ - free(__pyx_v_self->sum_right); - - /* "sklearn/tree/_criterion.pyx":800 - * free(self.sum_left) - * free(self.sum_right) - * free(self.sum_total) # <<<<<<<<<<<<<< - * - * def __reduce__(self): - */ - free(__pyx_v_self->sum_total); - - /* "sklearn/tree/_criterion.pyx":794 +/* "sklearn/tree/_criterion.pyx":717 * raise MemoryError() * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor""" - * free(self.sq_sum_tmp) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "sklearn/tree/_criterion.pyx":802 - * free(self.sum_total) - * * def __reduce__(self): # <<<<<<<<<<<<<< * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * */ /* Python wrapper */ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); - __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_4__reduce__(((struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *)__pyx_v_self)); + __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_2__reduce__(((struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_4__reduce__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self) { +static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_2__reduce__(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5615,22 +4819,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_4__r int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_criterion.pyx":803 + /* "sklearn/tree/_criterion.pyx":718 * * def __reduce__(self): * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) # <<<<<<<<<<<<<< * - * def __getstate__(self): + * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -5643,18 +4847,18 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_4__r } } if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion))); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); @@ -5665,8 +4869,8 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_4__r __pyx_t_3 = 0; goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":802 - * free(self.sum_total) + /* "sklearn/tree/_criterion.pyx":717 + * raise MemoryError() * * def __reduce__(self): # <<<<<<<<<<<<<< * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) @@ -5687,131 +4891,29 @@ static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_4__r return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":805 - * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) - * - * def __getstate__(self): # <<<<<<<<<<<<<< - * return {} - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0); - __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_6__getstate__(((struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_6__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getstate__", 0); - - /* "sklearn/tree/_criterion.pyx":806 - * - * def __getstate__(self): - * return {} # <<<<<<<<<<<<<< - * - * def __setstate__(self, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "sklearn/tree/_criterion.pyx":805 +/* "sklearn/tree/_criterion.pyx":720 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * - * def __getstate__(self): # <<<<<<<<<<<<<< - * return {} - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.tree._criterion.RegressionCriterion.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "sklearn/tree/_criterion.pyx":808 - * return {} - * - * def __setstate__(self, d): # <<<<<<<<<<<<<< - * pass - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/ -static PyObject *__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_9__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); - __pyx_r = __pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_8__setstate__(((struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *)__pyx_v_self), ((PyObject *)__pyx_v_d)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_7sklearn_4tree_10_criterion_19RegressionCriterion_8__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate__", 0); - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "sklearn/tree/_criterion.pyx":811 - * pass - * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< * double weighted_n_samples, SIZE_t* samples, SIZE_t start, * SIZE_t end) nogil: */ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_y, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_y_stride, __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_sample_weight, double __pyx_v_weighted_n_samples, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_end) { - double __pyx_v_weighted_n_node_samples; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_sq_sum_total; - double *__pyx_v_sum_total; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_p; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_y_ik; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_w_y_ik; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_w; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_bytes; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - double *__pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; - int __pyx_t_4; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; + int __pyx_t_3; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; - /* "sklearn/tree/_criterion.pyx":817 + /* "sklearn/tree/_criterion.pyx":726 * children samples[start:start] and samples[start:end].""" * # Initialize fields * self.y = y # <<<<<<<<<<<<<< @@ -5820,7 +4922,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ __pyx_v_self->__pyx_base.y = __pyx_v_y; - /* "sklearn/tree/_criterion.pyx":818 + /* "sklearn/tree/_criterion.pyx":727 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -5829,7 +4931,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ __pyx_v_self->__pyx_base.y_stride = __pyx_v_y_stride; - /* "sklearn/tree/_criterion.pyx":819 + /* "sklearn/tree/_criterion.pyx":728 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -5838,7 +4940,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ __pyx_v_self->__pyx_base.sample_weight = __pyx_v_sample_weight; - /* "sklearn/tree/_criterion.pyx":820 + /* "sklearn/tree/_criterion.pyx":729 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -5847,7 +4949,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ __pyx_v_self->__pyx_base.samples = __pyx_v_samples; - /* "sklearn/tree/_criterion.pyx":821 + /* "sklearn/tree/_criterion.pyx":730 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -5856,7 +4958,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ __pyx_v_self->__pyx_base.start = __pyx_v_start; - /* "sklearn/tree/_criterion.pyx":822 + /* "sklearn/tree/_criterion.pyx":731 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -5865,156 +4967,72 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ __pyx_v_self->__pyx_base.end = __pyx_v_end; - /* "sklearn/tree/_criterion.pyx":823 + /* "sklearn/tree/_criterion.pyx":732 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< * self.weighted_n_samples = weighted_n_samples - * cdef double weighted_n_node_samples = 0. + * self.weighted_n_node_samples = 0. */ __pyx_v_self->__pyx_base.n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_criterion.pyx":824 + /* "sklearn/tree/_criterion.pyx":733 * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< - * cdef double weighted_n_node_samples = 0. + * self.weighted_n_node_samples = 0. * */ __pyx_v_self->__pyx_base.weighted_n_samples = __pyx_v_weighted_n_samples; - /* "sklearn/tree/_criterion.pyx":825 + /* "sklearn/tree/_criterion.pyx":734 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples - * cdef double weighted_n_node_samples = 0. # <<<<<<<<<<<<<< - * - * # Initialize accumulators - */ - __pyx_v_weighted_n_node_samples = 0.; - - /* "sklearn/tree/_criterion.pyx":828 - * - * # Initialize accumulators - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* sum_total = self.sum_total - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":829 - * # Initialize accumulators - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< - * cdef double* sum_total = self.sum_total - * - */ - __pyx_t_2 = __pyx_v_self->sq_sum_total; - __pyx_v_sq_sum_total = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":830 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< - * - * cdef SIZE_t i = 0 - */ - __pyx_t_2 = __pyx_v_self->sum_total; - __pyx_v_sum_total = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":832 - * cdef double* sum_total = self.sum_total - * - * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 - */ - __pyx_v_i = 0; - - /* "sklearn/tree/_criterion.pyx":833 - * - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t k = 0 - * cdef DOUBLE_t y_ik = 0.0 - */ - __pyx_v_p = 0; - - /* "sklearn/tree/_criterion.pyx":834 - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t y_ik = 0.0 - * cdef DOUBLE_t w_y_ik = 0.0 - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_criterion.pyx":835 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 - * cdef DOUBLE_t y_ik = 0.0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t w_y_ik = 0.0 - * cdef DOUBLE_t w = 1.0 - */ - __pyx_v_y_ik = 0.0; - - /* "sklearn/tree/_criterion.pyx":836 - * cdef SIZE_t k = 0 - * cdef DOUBLE_t y_ik = 0.0 - * cdef DOUBLE_t w_y_ik = 0.0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t w = 1.0 + * self.weighted_n_node_samples = 0. # <<<<<<<<<<<<<< * + * cdef SIZE_t i, p, k */ - __pyx_v_w_y_ik = 0.0; + __pyx_v_self->__pyx_base.weighted_n_node_samples = 0.; - /* "sklearn/tree/_criterion.pyx":837 - * cdef DOUBLE_t y_ik = 0.0 - * cdef DOUBLE_t w_y_ik = 0.0 + /* "sklearn/tree/_criterion.pyx":739 + * cdef DOUBLE_t y_ik + * cdef DOUBLE_t w_y_ik * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< * - * cdef SIZE_t n_bytes = n_outputs * sizeof(double) + * self.sq_sum_total = 0.0 */ __pyx_v_w = 1.0; - /* "sklearn/tree/_criterion.pyx":839 + /* "sklearn/tree/_criterion.pyx":741 * cdef DOUBLE_t w = 1.0 * - * cdef SIZE_t n_bytes = n_outputs * sizeof(double) # <<<<<<<<<<<<<< - * memset(sq_sum_total, 0, n_bytes) - * memset(sum_total, 0, n_bytes) - */ - __pyx_v_n_bytes = (__pyx_v_n_outputs * (sizeof(double))); - - /* "sklearn/tree/_criterion.pyx":840 - * - * cdef SIZE_t n_bytes = n_outputs * sizeof(double) - * memset(sq_sum_total, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(sum_total, 0, n_bytes) + * self.sq_sum_total = 0.0 # <<<<<<<<<<<<<< + * memset(self.node_sum_total, 0, self.n_outputs * sizeof(double)) * */ - memset(__pyx_v_sq_sum_total, 0, __pyx_v_n_bytes); + __pyx_v_self->__pyx_base.sq_sum_total = 0.0; - /* "sklearn/tree/_criterion.pyx":841 - * cdef SIZE_t n_bytes = n_outputs * sizeof(double) - * memset(sq_sum_total, 0, n_bytes) - * memset(sum_total, 0, n_bytes) # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":742 + * + * self.sq_sum_total = 0.0 + * memset(self.node_sum_total, 0, self.n_outputs * sizeof(double)) # <<<<<<<<<<<<<< * * for p in range(start, end): */ - memset(__pyx_v_sum_total, 0, __pyx_v_n_bytes); + memset(__pyx_v_self->__pyx_base.node_sum_total, 0, (__pyx_v_self->__pyx_base.n_outputs * (sizeof(double)))); - /* "sklearn/tree/_criterion.pyx":843 - * memset(sum_total, 0, n_bytes) + /* "sklearn/tree/_criterion.pyx":744 + * memset(self.node_sum_total, 0, self.n_outputs * sizeof(double)) * * for p in range(start, end): # <<<<<<<<<<<<<< * i = samples[p] * */ __pyx_t_1 = __pyx_v_end; - for (__pyx_t_3 = __pyx_v_start; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { - __pyx_v_p = __pyx_t_3; + for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_p = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":844 + /* "sklearn/tree/_criterion.pyx":745 * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< @@ -6023,104 +5041,88 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_criterion.pyx":846 + /* "sklearn/tree/_criterion.pyx":747 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< * w = sample_weight[i] * */ - __pyx_t_4 = ((__pyx_v_sample_weight != NULL) != 0); - if (__pyx_t_4) { + __pyx_t_3 = ((__pyx_v_sample_weight != NULL) != 0); + if (__pyx_t_3) { - /* "sklearn/tree/_criterion.pyx":847 + /* "sklearn/tree/_criterion.pyx":748 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); - - /* "sklearn/tree/_criterion.pyx":846 - * i = samples[p] - * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] - * - */ + goto __pyx_L5; } + __pyx_L5:; - /* "sklearn/tree/_criterion.pyx":849 + /* "sklearn/tree/_criterion.pyx":750 * w = sample_weight[i] * - * for k in range(n_outputs): # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik */ - __pyx_t_5 = __pyx_v_n_outputs; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_k = __pyx_t_6; + __pyx_t_4 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_criterion.pyx":850 + /* "sklearn/tree/_criterion.pyx":751 * - * for k in range(n_outputs): + * for k in range(self.n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< * w_y_ik = w * y_ik - * sum_total[k] += w_y_ik + * self.node_sum_total[k] += w_y_ik */ __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]); - /* "sklearn/tree/_criterion.pyx":851 - * for k in range(n_outputs): + /* "sklearn/tree/_criterion.pyx":752 + * for k in range(self.n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< - * sum_total[k] += w_y_ik - * sq_sum_total[k] += w_y_ik * y_ik + * self.node_sum_total[k] += w_y_ik + * self.sq_sum_total += w_y_ik * y_ik */ __pyx_v_w_y_ik = (__pyx_v_w * __pyx_v_y_ik); - /* "sklearn/tree/_criterion.pyx":852 + /* "sklearn/tree/_criterion.pyx":753 * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik - * sum_total[k] += w_y_ik # <<<<<<<<<<<<<< - * sq_sum_total[k] += w_y_ik * y_ik + * self.node_sum_total[k] += w_y_ik # <<<<<<<<<<<<<< + * self.sq_sum_total += w_y_ik * y_ik * */ - __pyx_t_7 = __pyx_v_k; - (__pyx_v_sum_total[__pyx_t_7]) = ((__pyx_v_sum_total[__pyx_t_7]) + __pyx_v_w_y_ik); + __pyx_t_6 = __pyx_v_k; + (__pyx_v_self->__pyx_base.node_sum_total[__pyx_t_6]) = ((__pyx_v_self->__pyx_base.node_sum_total[__pyx_t_6]) + __pyx_v_w_y_ik); - /* "sklearn/tree/_criterion.pyx":853 + /* "sklearn/tree/_criterion.pyx":754 * w_y_ik = w * y_ik - * sum_total[k] += w_y_ik - * sq_sum_total[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< + * self.node_sum_total[k] += w_y_ik + * self.sq_sum_total += w_y_ik * y_ik # <<<<<<<<<<<<<< * - * weighted_n_node_samples += w + * self.weighted_n_node_samples += w */ - __pyx_t_7 = __pyx_v_k; - (__pyx_v_sq_sum_total[__pyx_t_7]) = ((__pyx_v_sq_sum_total[__pyx_t_7]) + (__pyx_v_w_y_ik * __pyx_v_y_ik)); + __pyx_v_self->__pyx_base.sq_sum_total = (__pyx_v_self->__pyx_base.sq_sum_total + (__pyx_v_w_y_ik * __pyx_v_y_ik)); } - /* "sklearn/tree/_criterion.pyx":855 - * sq_sum_total[k] += w_y_ik * y_ik - * - * weighted_n_node_samples += w # <<<<<<<<<<<<<< - * - * self.weighted_n_node_samples = weighted_n_node_samples - */ - __pyx_v_weighted_n_node_samples = (__pyx_v_weighted_n_node_samples + __pyx_v_w); - } - - /* "sklearn/tree/_criterion.pyx":857 - * weighted_n_node_samples += w + /* "sklearn/tree/_criterion.pyx":756 + * self.sq_sum_total += w_y_ik * y_ik * - * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< + * self.weighted_n_node_samples += w # <<<<<<<<<<<<<< * * # Reset to pos=start */ - __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; + __pyx_v_self->__pyx_base.weighted_n_node_samples = (__pyx_v_self->__pyx_base.weighted_n_node_samples + __pyx_v_w); + } - /* "sklearn/tree/_criterion.pyx":860 + /* "sklearn/tree/_criterion.pyx":759 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -6129,8 +5131,8 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_RegressionCriterion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reset(((struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self)); - /* "sklearn/tree/_criterion.pyx":811 - * pass + /* "sklearn/tree/_criterion.pyx":720 + * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< * double weighted_n_samples, SIZE_t* samples, SIZE_t start, @@ -6140,7 +5142,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_init(struc /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":862 +/* "sklearn/tree/_criterion.pyx":761 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -6153,35 +5155,54 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reset(stru double __pyx_t_1; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":864 + /* "sklearn/tree/_criterion.pyx":763 * cdef void reset(self) nogil: * """Reset the criterion at pos=start.""" * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) # <<<<<<<<<<<<<< - * memset(self.sum_left, 0, n_bytes) - * memcpy(self.sum_right, self.sum_total, n_bytes) + * memset(self.node_sum_left, 0, n_bytes) + * memcpy(self.node_sum_right, self.node_sum_total, n_bytes) */ __pyx_v_n_bytes = (__pyx_v_self->__pyx_base.n_outputs * (sizeof(double))); - /* "sklearn/tree/_criterion.pyx":865 + /* "sklearn/tree/_criterion.pyx":764 * """Reset the criterion at pos=start.""" * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) - * memset(self.sum_left, 0, n_bytes) # <<<<<<<<<<<<<< - * memcpy(self.sum_right, self.sum_total, n_bytes) + * memset(self.node_sum_left, 0, n_bytes) # <<<<<<<<<<<<<< + * memcpy(self.node_sum_right, self.node_sum_total, n_bytes) * */ - memset(__pyx_v_self->sum_left, 0, __pyx_v_n_bytes); + memset(__pyx_v_self->__pyx_base.node_sum_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_criterion.pyx":866 + /* "sklearn/tree/_criterion.pyx":765 * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) - * memset(self.sum_left, 0, n_bytes) - * memcpy(self.sum_right, self.sum_total, n_bytes) # <<<<<<<<<<<<<< + * memset(self.node_sum_left, 0, n_bytes) + * memcpy(self.node_sum_right, self.node_sum_total, n_bytes) # <<<<<<<<<<<<<< + * + * self.sq_sum_left = 0 + */ + memcpy(__pyx_v_self->__pyx_base.node_sum_right, __pyx_v_self->__pyx_base.node_sum_total, __pyx_v_n_bytes); + + /* "sklearn/tree/_criterion.pyx":767 + * memcpy(self.node_sum_right, self.node_sum_total, n_bytes) + * + * self.sq_sum_left = 0 # <<<<<<<<<<<<<< + * self.sq_sum_right = self.sq_sum_total + * + */ + __pyx_v_self->__pyx_base.sq_sum_left = 0.0; + + /* "sklearn/tree/_criterion.pyx":768 + * + * self.sq_sum_left = 0 + * self.sq_sum_right = self.sq_sum_total # <<<<<<<<<<<<<< * * self.weighted_n_left = 0.0 */ - memcpy(__pyx_v_self->sum_right, __pyx_v_self->sum_total, __pyx_v_n_bytes); + __pyx_t_1 = __pyx_v_self->__pyx_base.sq_sum_total; + __pyx_v_self->__pyx_base.sq_sum_right = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":868 - * memcpy(self.sum_right, self.sum_total, n_bytes) + /* "sklearn/tree/_criterion.pyx":770 + * self.sq_sum_right = self.sq_sum_total * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< * self.weighted_n_right = self.weighted_n_node_samples @@ -6189,7 +5210,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reset(stru */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_criterion.pyx":869 + /* "sklearn/tree/_criterion.pyx":771 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6199,7 +5220,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reset(stru __pyx_t_1 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_self->__pyx_base.weighted_n_right = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":870 + /* "sklearn/tree/_criterion.pyx":772 * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples * self.pos = self.start # <<<<<<<<<<<<<< @@ -6209,7 +5230,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reset(stru __pyx_t_2 = __pyx_v_self->__pyx_base.start; __pyx_v_self->__pyx_base.pos = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":862 + /* "sklearn/tree/_criterion.pyx":761 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -6220,7 +5241,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reset(stru /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":872 +/* "sklearn/tree/_criterion.pyx":774 * self.pos = self.start * * cdef void reverse_reset(self) nogil: # <<<<<<<<<<<<<< @@ -6233,35 +5254,54 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reverse_re double __pyx_t_1; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":874 + /* "sklearn/tree/_criterion.pyx":776 * cdef void reverse_reset(self) nogil: * """Reset the criterion at pos=end.""" * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) # <<<<<<<<<<<<<< - * memset(self.sum_right, 0, n_bytes) - * memcpy(self.sum_left, self.sum_total, n_bytes) + * memset(self.node_sum_right, 0, n_bytes) + * memcpy(self.node_sum_left, self.node_sum_total, n_bytes) */ __pyx_v_n_bytes = (__pyx_v_self->__pyx_base.n_outputs * (sizeof(double))); - /* "sklearn/tree/_criterion.pyx":875 + /* "sklearn/tree/_criterion.pyx":777 * """Reset the criterion at pos=end.""" * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) - * memset(self.sum_right, 0, n_bytes) # <<<<<<<<<<<<<< - * memcpy(self.sum_left, self.sum_total, n_bytes) + * memset(self.node_sum_right, 0, n_bytes) # <<<<<<<<<<<<<< + * memcpy(self.node_sum_left, self.node_sum_total, n_bytes) * */ - memset(__pyx_v_self->sum_right, 0, __pyx_v_n_bytes); + memset(__pyx_v_self->__pyx_base.node_sum_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_criterion.pyx":876 + /* "sklearn/tree/_criterion.pyx":778 * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) - * memset(self.sum_right, 0, n_bytes) - * memcpy(self.sum_left, self.sum_total, n_bytes) # <<<<<<<<<<<<<< + * memset(self.node_sum_right, 0, n_bytes) + * memcpy(self.node_sum_left, self.node_sum_total, n_bytes) # <<<<<<<<<<<<<< + * + * self.sq_sum_left = self.sq_sum_total + */ + memcpy(__pyx_v_self->__pyx_base.node_sum_left, __pyx_v_self->__pyx_base.node_sum_total, __pyx_v_n_bytes); + + /* "sklearn/tree/_criterion.pyx":780 + * memcpy(self.node_sum_left, self.node_sum_total, n_bytes) + * + * self.sq_sum_left = self.sq_sum_total # <<<<<<<<<<<<<< + * self.sq_sum_right = 0.0 + * + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.sq_sum_total; + __pyx_v_self->__pyx_base.sq_sum_left = __pyx_t_1; + + /* "sklearn/tree/_criterion.pyx":781 + * + * self.sq_sum_left = self.sq_sum_total + * self.sq_sum_right = 0.0 # <<<<<<<<<<<<<< * * self.weighted_n_right = 0.0 */ - memcpy(__pyx_v_self->sum_left, __pyx_v_self->sum_total, __pyx_v_n_bytes); + __pyx_v_self->__pyx_base.sq_sum_right = 0.0; - /* "sklearn/tree/_criterion.pyx":878 - * memcpy(self.sum_left, self.sum_total, n_bytes) + /* "sklearn/tree/_criterion.pyx":783 + * self.sq_sum_right = 0.0 * * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< * self.weighted_n_left = self.weighted_n_node_samples @@ -6269,7 +5309,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reverse_re */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_criterion.pyx":879 + /* "sklearn/tree/_criterion.pyx":784 * * self.weighted_n_right = 0.0 * self.weighted_n_left = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6279,7 +5319,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reverse_re __pyx_t_1 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_self->__pyx_base.weighted_n_left = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":880 + /* "sklearn/tree/_criterion.pyx":785 * self.weighted_n_right = 0.0 * self.weighted_n_left = self.weighted_n_node_samples * self.pos = self.end # <<<<<<<<<<<<<< @@ -6289,7 +5329,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reverse_re __pyx_t_2 = __pyx_v_self->__pyx_base.end; __pyx_v_self->__pyx_base.pos = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":872 + /* "sklearn/tree/_criterion.pyx":774 * self.pos = self.start * * cdef void reverse_reset(self) nogil: # <<<<<<<<<<<<<< @@ -6300,7 +5340,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reverse_re /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":882 +/* "sklearn/tree/_criterion.pyx":787 * self.pos = self.end * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -6309,410 +5349,354 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_reverse_re */ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_update(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_new_pos) { + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; + double *__pyx_v_node_sum_total; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_y; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_y_stride; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_sample_weight; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_samples; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_pos; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_end; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_sum_left; - double *__pyx_v_sum_right; - double *__pyx_v_sum_total; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_p; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_w; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_diff_w; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_t_1; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; - int __pyx_t_5; + __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_y_ik; + double *__pyx_t_1; + __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_5; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_7; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_8; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_9; - long __pyx_t_10; + long __pyx_t_9; - /* "sklearn/tree/_criterion.pyx":885 + /* "sklearn/tree/_criterion.pyx":790 * """Updated statistics by moving samples[pos:new_pos] to the left.""" * - * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< - * cdef SIZE_t y_stride = self.y_stride - * cdef DOUBLE_t* sample_weight = self.sample_weight + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right + * cdef double* node_sum_total = self.node_sum_total */ - __pyx_t_1 = __pyx_v_self->__pyx_base.y; - __pyx_v_y = __pyx_t_1; + __pyx_t_1 = __pyx_v_self->__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":886 + /* "sklearn/tree/_criterion.pyx":791 * - * cdef DOUBLE_t* y = self.y - * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< - * cdef DOUBLE_t* sample_weight = self.sample_weight + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< + * cdef double* node_sum_total = self.node_sum_total * */ - __pyx_t_2 = __pyx_v_self->__pyx_base.y_stride; - __pyx_v_y_stride = __pyx_t_2; + __pyx_t_1 = __pyx_v_self->__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":887 - * cdef DOUBLE_t* y = self.y - * cdef SIZE_t y_stride = self.y_stride - * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":792 + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< * - * cdef SIZE_t* samples = self.samples + * cdef DOUBLE_t* y = self.y */ - __pyx_t_1 = __pyx_v_self->__pyx_base.sample_weight; - __pyx_v_sample_weight = __pyx_t_1; + __pyx_t_1 = __pyx_v_self->__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":889 - * cdef DOUBLE_t* sample_weight = self.sample_weight + /* "sklearn/tree/_criterion.pyx":794 + * cdef double* node_sum_total = self.node_sum_total * - * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< + * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< * cdef SIZE_t pos = self.pos * cdef SIZE_t end = self.end */ - __pyx_t_3 = __pyx_v_self->__pyx_base.samples; - __pyx_v_samples = __pyx_t_3; + __pyx_t_2 = __pyx_v_self->__pyx_base.y; + __pyx_v_y = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":890 + /* "sklearn/tree/_criterion.pyx":795 * - * cdef SIZE_t* samples = self.samples + * cdef DOUBLE_t* y = self.y * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< * cdef SIZE_t end = self.end - * + * cdef SIZE_t i, p, k */ - __pyx_t_2 = __pyx_v_self->__pyx_base.pos; - __pyx_v_pos = __pyx_t_2; + __pyx_t_3 = __pyx_v_self->__pyx_base.pos; + __pyx_v_pos = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":891 - * cdef SIZE_t* samples = self.samples + /* "sklearn/tree/_criterion.pyx":796 + * cdef DOUBLE_t* y = self.y * cdef SIZE_t pos = self.pos * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< - * - * cdef SIZE_t n_outputs = self.n_outputs - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.end; - __pyx_v_end = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":893 - * cdef SIZE_t end = self.end - * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":894 - * - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * cdef double* sum_total = self.sum_total - */ - __pyx_t_4 = __pyx_v_self->sum_left; - __pyx_v_sum_left = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":895 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< - * cdef double* sum_total = self.sum_total - * - */ - __pyx_t_4 = __pyx_v_self->sum_right; - __pyx_v_sum_right = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":896 - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< - * - * cdef SIZE_t i = 0 - */ - __pyx_t_4 = __pyx_v_self->sum_total; - __pyx_v_sum_total = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":898 - * cdef double* sum_total = self.sum_total - * - * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 - */ - __pyx_v_i = 0; - - /* "sklearn/tree/_criterion.pyx":899 - * - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t k = 0 - * cdef DOUBLE_t w = 1.0 - */ - __pyx_v_p = 0; - - /* "sklearn/tree/_criterion.pyx":900 - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + * cdef SIZE_t i, p, k * cdef DOUBLE_t w = 1.0 - * cdef DOUBLE_t diff_w = 0.0 */ - __pyx_v_k = 0; + __pyx_t_3 = __pyx_v_self->__pyx_base.end; + __pyx_v_end = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":901 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 + /* "sklearn/tree/_criterion.pyx":798 + * cdef SIZE_t end = self.end + * cdef SIZE_t i, p, k * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t diff_w = 0.0 + * cdef DOUBLE_t y_ik * */ __pyx_v_w = 1.0; - /* "sklearn/tree/_criterion.pyx":902 - * cdef SIZE_t k = 0 - * cdef DOUBLE_t w = 1.0 - * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< - * - * # Update statistics up to new_pos - */ - __pyx_v_diff_w = 0.0; - - /* "sklearn/tree/_criterion.pyx":912 + /* "sklearn/tree/_criterion.pyx":809 * # of computations, i.e. from pos to new_pos or from end to new_po. * * if (new_pos - pos) <= (end - new_pos): # <<<<<<<<<<<<<< * for p in range(pos, new_pos): - * i = samples[p] + * i = self.samples[p] */ - __pyx_t_5 = (((__pyx_v_new_pos - __pyx_v_pos) <= (__pyx_v_end - __pyx_v_new_pos)) != 0); - if (__pyx_t_5) { + __pyx_t_4 = (((__pyx_v_new_pos - __pyx_v_pos) <= (__pyx_v_end - __pyx_v_new_pos)) != 0); + if (__pyx_t_4) { - /* "sklearn/tree/_criterion.pyx":913 + /* "sklearn/tree/_criterion.pyx":810 * * if (new_pos - pos) <= (end - new_pos): * for p in range(pos, new_pos): # <<<<<<<<<<<<<< - * i = samples[p] + * i = self.samples[p] * */ - __pyx_t_2 = __pyx_v_new_pos; - for (__pyx_t_6 = __pyx_v_pos; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { - __pyx_v_p = __pyx_t_6; + __pyx_t_3 = __pyx_v_new_pos; + for (__pyx_t_5 = __pyx_v_pos; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_p = __pyx_t_5; - /* "sklearn/tree/_criterion.pyx":914 + /* "sklearn/tree/_criterion.pyx":811 * if (new_pos - pos) <= (end - new_pos): * for p in range(pos, new_pos): - * i = samples[p] # <<<<<<<<<<<<<< + * i = self.samples[p] # <<<<<<<<<<<<<< * - * if sample_weight != NULL: + * if self.sample_weight != NULL: */ - __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); + __pyx_v_i = (__pyx_v_self->__pyx_base.samples[__pyx_v_p]); - /* "sklearn/tree/_criterion.pyx":916 - * i = samples[p] + /* "sklearn/tree/_criterion.pyx":813 + * i = self.samples[p] * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + * if self.sample_weight != NULL: # <<<<<<<<<<<<<< + * w = self.sample_weight[i] * */ - __pyx_t_5 = ((__pyx_v_sample_weight != NULL) != 0); - if (__pyx_t_5) { + __pyx_t_4 = ((__pyx_v_self->__pyx_base.sample_weight != NULL) != 0); + if (__pyx_t_4) { - /* "sklearn/tree/_criterion.pyx":917 + /* "sklearn/tree/_criterion.pyx":814 * - * if sample_weight != NULL: - * w = sample_weight[i] # <<<<<<<<<<<<<< + * if self.sample_weight != NULL: + * w = self.sample_weight[i] # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ - __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); + __pyx_v_w = (__pyx_v_self->__pyx_base.sample_weight[__pyx_v_i]); + goto __pyx_L6; + } + __pyx_L6:; - /* "sklearn/tree/_criterion.pyx":916 - * i = samples[p] - * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + /* "sklearn/tree/_criterion.pyx":816 + * w = self.sample_weight[i] * + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * y_ik = y[i * self.y_stride + k] + * node_sum_left[k] += w * y_ik */ - } + __pyx_t_6 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_k = __pyx_t_7; - /* "sklearn/tree/_criterion.pyx":919 - * w = sample_weight[i] - * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * sum_left[k] += w * y[i * y_stride + k] + /* "sklearn/tree/_criterion.pyx":817 * + * for k in range(self.n_outputs): + * y_ik = y[i * self.y_stride + k] # <<<<<<<<<<<<<< + * node_sum_left[k] += w * y_ik + * self.sq_sum_left += w * y_ik * y_ik */ - __pyx_t_7 = __pyx_v_n_outputs; - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { - __pyx_v_k = __pyx_t_8; + __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_self->__pyx_base.y_stride) + __pyx_v_k)]); - /* "sklearn/tree/_criterion.pyx":920 + /* "sklearn/tree/_criterion.pyx":818 + * for k in range(self.n_outputs): + * y_ik = y[i * self.y_stride + k] + * node_sum_left[k] += w * y_ik # <<<<<<<<<<<<<< + * self.sq_sum_left += w * y_ik * y_ik * - * for k in range(n_outputs): - * sum_left[k] += w * y[i * y_stride + k] # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __pyx_v_k; + (__pyx_v_node_sum_left[__pyx_t_8]) = ((__pyx_v_node_sum_left[__pyx_t_8]) + (__pyx_v_w * __pyx_v_y_ik)); + + /* "sklearn/tree/_criterion.pyx":819 + * y_ik = y[i * self.y_stride + k] + * node_sum_left[k] += w * y_ik + * self.sq_sum_left += w * y_ik * y_ik # <<<<<<<<<<<<<< * - * diff_w += w + * self.weighted_n_left += w */ - __pyx_t_9 = __pyx_v_k; - (__pyx_v_sum_left[__pyx_t_9]) = ((__pyx_v_sum_left[__pyx_t_9]) + (__pyx_v_w * (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]))); + __pyx_v_self->__pyx_base.sq_sum_left = (__pyx_v_self->__pyx_base.sq_sum_left + ((__pyx_v_w * __pyx_v_y_ik) * __pyx_v_y_ik)); } - /* "sklearn/tree/_criterion.pyx":922 - * sum_left[k] += w * y[i * y_stride + k] + /* "sklearn/tree/_criterion.pyx":821 + * self.sq_sum_left += w * y_ik * y_ik * - * diff_w += w # <<<<<<<<<<<<<< + * self.weighted_n_left += w # <<<<<<<<<<<<<< + * self.weighted_n_right -= w * else: - * self.reverse_reset() */ - __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); - } + __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_w); - /* "sklearn/tree/_criterion.pyx":912 - * # of computations, i.e. from pos to new_pos or from end to new_po. + /* "sklearn/tree/_criterion.pyx":822 * - * if (new_pos - pos) <= (end - new_pos): # <<<<<<<<<<<<<< - * for p in range(pos, new_pos): - * i = samples[p] + * self.weighted_n_left += w + * self.weighted_n_right -= w # <<<<<<<<<<<<<< + * else: + * self.reverse_reset() */ + __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_w); + } goto __pyx_L3; } + /*else*/ { - /* "sklearn/tree/_criterion.pyx":924 - * diff_w += w + /* "sklearn/tree/_criterion.pyx":824 + * self.weighted_n_right -= w * else: * self.reverse_reset() # <<<<<<<<<<<<<< * * for p in range(end - 1, new_pos - 1, -1): */ - /*else*/ { ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_RegressionCriterion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reverse_reset(((struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self)); - /* "sklearn/tree/_criterion.pyx":926 + /* "sklearn/tree/_criterion.pyx":826 * self.reverse_reset() * * for p in range(end - 1, new_pos - 1, -1): # <<<<<<<<<<<<<< - * i = samples[p] + * i = self.samples[p] * */ - __pyx_t_10 = (__pyx_v_new_pos - 1); - for (__pyx_t_2 = (__pyx_v_end - 1); __pyx_t_2 > __pyx_t_10; __pyx_t_2-=1) { - __pyx_v_p = __pyx_t_2; + __pyx_t_9 = (__pyx_v_new_pos - 1); + for (__pyx_t_3 = (__pyx_v_end - 1); __pyx_t_3 > __pyx_t_9; __pyx_t_3-=1) { + __pyx_v_p = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":927 + /* "sklearn/tree/_criterion.pyx":827 * * for p in range(end - 1, new_pos - 1, -1): - * i = samples[p] # <<<<<<<<<<<<<< + * i = self.samples[p] # <<<<<<<<<<<<<< * - * if sample_weight != NULL: + * if self.sample_weight != NULL: */ - __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); + __pyx_v_i = (__pyx_v_self->__pyx_base.samples[__pyx_v_p]); - /* "sklearn/tree/_criterion.pyx":929 - * i = samples[p] + /* "sklearn/tree/_criterion.pyx":829 + * i = self.samples[p] * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + * if self.sample_weight != NULL: # <<<<<<<<<<<<<< + * w = self.sample_weight[i] * */ - __pyx_t_5 = ((__pyx_v_sample_weight != NULL) != 0); - if (__pyx_t_5) { + __pyx_t_4 = ((__pyx_v_self->__pyx_base.sample_weight != NULL) != 0); + if (__pyx_t_4) { - /* "sklearn/tree/_criterion.pyx":930 + /* "sklearn/tree/_criterion.pyx":830 * - * if sample_weight != NULL: - * w = sample_weight[i] # <<<<<<<<<<<<<< + * if self.sample_weight != NULL: + * w = self.sample_weight[i] # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ - __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); + __pyx_v_w = (__pyx_v_self->__pyx_base.sample_weight[__pyx_v_i]); + goto __pyx_L11; + } + __pyx_L11:; - /* "sklearn/tree/_criterion.pyx":929 - * i = samples[p] - * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + /* "sklearn/tree/_criterion.pyx":832 + * w = self.sample_weight[i] * + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * y_ik = y[i * self.y_stride + k] + * node_sum_left[k] -= w * y_ik */ - } + __pyx_t_5 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_k = __pyx_t_6; - /* "sklearn/tree/_criterion.pyx":932 - * w = sample_weight[i] - * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * sum_left[k] -= w * y[i * y_stride + k] + /* "sklearn/tree/_criterion.pyx":833 * + * for k in range(self.n_outputs): + * y_ik = y[i * self.y_stride + k] # <<<<<<<<<<<<<< + * node_sum_left[k] -= w * y_ik + * self.sq_sum_left -= w * y_ik * y_ik */ - __pyx_t_6 = __pyx_v_n_outputs; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_k = __pyx_t_7; + __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_self->__pyx_base.y_stride) + __pyx_v_k)]); - /* "sklearn/tree/_criterion.pyx":933 + /* "sklearn/tree/_criterion.pyx":834 + * for k in range(self.n_outputs): + * y_ik = y[i * self.y_stride + k] + * node_sum_left[k] -= w * y_ik # <<<<<<<<<<<<<< + * self.sq_sum_left -= w * y_ik * y_ik * - * for k in range(n_outputs): - * sum_left[k] -= w * y[i * y_stride + k] # <<<<<<<<<<<<<< + */ + __pyx_t_7 = __pyx_v_k; + (__pyx_v_node_sum_left[__pyx_t_7]) = ((__pyx_v_node_sum_left[__pyx_t_7]) - (__pyx_v_w * __pyx_v_y_ik)); + + /* "sklearn/tree/_criterion.pyx":835 + * y_ik = y[i * self.y_stride + k] + * node_sum_left[k] -= w * y_ik + * self.sq_sum_left -= w * y_ik * y_ik # <<<<<<<<<<<<<< * - * diff_w -= w + * self.weighted_n_left -= w */ - __pyx_t_8 = __pyx_v_k; - (__pyx_v_sum_left[__pyx_t_8]) = ((__pyx_v_sum_left[__pyx_t_8]) - (__pyx_v_w * (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]))); + __pyx_v_self->__pyx_base.sq_sum_left = (__pyx_v_self->__pyx_base.sq_sum_left - ((__pyx_v_w * __pyx_v_y_ik) * __pyx_v_y_ik)); } - /* "sklearn/tree/_criterion.pyx":935 - * sum_left[k] -= w * y[i * y_stride + k] + /* "sklearn/tree/_criterion.pyx":837 + * self.sq_sum_left -= w * y_ik * y_ik * - * diff_w -= w # <<<<<<<<<<<<<< + * self.weighted_n_left -= w # <<<<<<<<<<<<<< + * self.weighted_n_right += w * - * for k in range(n_outputs): */ - __pyx_v_diff_w = (__pyx_v_diff_w - __pyx_v_w); - } - } - __pyx_L3:; + __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left - __pyx_v_w); - /* "sklearn/tree/_criterion.pyx":937 - * diff_w -= w + /* "sklearn/tree/_criterion.pyx":838 * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * sum_right[k] = sum_total[k] - sum_left[k] + * self.weighted_n_left -= w + * self.weighted_n_right += w # <<<<<<<<<<<<<< * + * self.sq_sum_right = self.sq_sum_total - self.sq_sum_left */ - __pyx_t_2 = __pyx_v_n_outputs; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { - __pyx_v_k = __pyx_t_6; + __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right + __pyx_v_w); + } + } + __pyx_L3:; - /* "sklearn/tree/_criterion.pyx":938 - * - * for k in range(n_outputs): - * sum_right[k] = sum_total[k] - sum_left[k] # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":840 + * self.weighted_n_right += w * - * self.weighted_n_left += diff_w + * self.sq_sum_right = self.sq_sum_total - self.sq_sum_left # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): + * node_sum_right[k] = node_sum_total[k] - node_sum_left[k] */ - (__pyx_v_sum_right[__pyx_v_k]) = ((__pyx_v_sum_total[__pyx_v_k]) - (__pyx_v_sum_left[__pyx_v_k])); - } + __pyx_v_self->__pyx_base.sq_sum_right = (__pyx_v_self->__pyx_base.sq_sum_total - __pyx_v_self->__pyx_base.sq_sum_left); - /* "sklearn/tree/_criterion.pyx":940 - * sum_right[k] = sum_total[k] - sum_left[k] + /* "sklearn/tree/_criterion.pyx":841 * - * self.weighted_n_left += diff_w # <<<<<<<<<<<<<< - * self.weighted_n_right -= diff_w + * self.sq_sum_right = self.sq_sum_total - self.sq_sum_left + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * node_sum_right[k] = node_sum_total[k] - node_sum_left[k] * */ - __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_diff_w); + __pyx_t_3 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_criterion.pyx":941 - * - * self.weighted_n_left += diff_w - * self.weighted_n_right -= diff_w # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":842 + * self.sq_sum_right = self.sq_sum_total - self.sq_sum_left + * for k in range(self.n_outputs): + * node_sum_right[k] = node_sum_total[k] - node_sum_left[k] # <<<<<<<<<<<<<< * * self.pos = new_pos */ - __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_diff_w); + (__pyx_v_node_sum_right[__pyx_v_k]) = ((__pyx_v_node_sum_total[__pyx_v_k]) - (__pyx_v_node_sum_left[__pyx_v_k])); + } - /* "sklearn/tree/_criterion.pyx":943 - * self.weighted_n_right -= diff_w + /* "sklearn/tree/_criterion.pyx":844 + * node_sum_right[k] = node_sum_total[k] - node_sum_left[k] * * self.pos = new_pos # <<<<<<<<<<<<<< * @@ -6720,7 +5704,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_update(str */ __pyx_v_self->__pyx_base.pos = __pyx_v_new_pos; - /* "sklearn/tree/_criterion.pyx":882 + /* "sklearn/tree/_criterion.pyx":787 * self.pos = self.end * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -6731,7 +5715,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_update(str /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":945 +/* "sklearn/tree/_criterion.pyx":846 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -6747,7 +5731,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_node_imp return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":948 +/* "sklearn/tree/_criterion.pyx":849 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -6760,96 +5744,52 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_children_i /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":952 +/* "sklearn/tree/_criterion.pyx":853 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< * """Compute the node value of samples[start:end] into dest.""" - * cdef SIZE_t n_outputs = self.n_outputs + * */ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_node_value(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *__pyx_v_self, double *__pyx_v_dest) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_sum_total; - double __pyx_v_weighted_n_node_samples; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - double *__pyx_t_2; - double __pyx_t_3; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":954 - * cdef void node_value(self, double* dest) nogil: - * """Compute the node value of samples[start:end] into dest.""" - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* sum_total = self.sum_total - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":955 - * """Compute the node value of samples[start:end] into dest.""" - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef SIZE_t k = 0 - */ - __pyx_t_2 = __pyx_v_self->sum_total; - __pyx_v_sum_total = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":956 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_total = self.sum_total - * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< - * cdef SIZE_t k = 0 - * - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.weighted_n_node_samples; - __pyx_v_weighted_n_node_samples = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":957 - * cdef double* sum_total = self.sum_total - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * - * for k in range(n_outputs): - */ - __pyx_v_k = 0; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":959 - * cdef SIZE_t k = 0 + /* "sklearn/tree/_criterion.pyx":858 + * cdef SIZE_t k * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * dest[k] = sum_total[k] / weighted_n_node_samples + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * dest[k] = self.node_sum_total[k] / self.weighted_n_node_samples * */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_k = __pyx_t_4; + __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_k = __pyx_t_2; - /* "sklearn/tree/_criterion.pyx":960 + /* "sklearn/tree/_criterion.pyx":859 * - * for k in range(n_outputs): - * dest[k] = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): + * dest[k] = self.node_sum_total[k] / self.weighted_n_node_samples # <<<<<<<<<<<<<< * * */ - (__pyx_v_dest[__pyx_v_k]) = ((__pyx_v_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples); + (__pyx_v_dest[__pyx_v_k]) = ((__pyx_v_self->__pyx_base.node_sum_total[__pyx_v_k]) / __pyx_v_self->__pyx_base.weighted_n_node_samples); } - /* "sklearn/tree/_criterion.pyx":952 + /* "sklearn/tree/_criterion.pyx":853 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< * """Compute the node value of samples[start:end] into dest.""" - * cdef SIZE_t n_outputs = self.n_outputs + * */ /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":968 +/* "sklearn/tree/_criterion.pyx":867 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -6858,127 +5798,65 @@ static void __pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_node_value */ static double __pyx_f_7sklearn_4tree_10_criterion_3MSE_node_impurity(struct __pyx_obj_7sklearn_4tree_10_criterion_MSE *__pyx_v_self) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_sq_sum_total; - double *__pyx_v_sum_total; - double __pyx_v_weighted_n_node_samples; - double __pyx_v_mean_total_k; - double __pyx_v_total; + double *__pyx_v_node_sum_total; + double __pyx_v_impurity; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; double __pyx_r; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - double *__pyx_t_2; - double __pyx_t_3; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":971 - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* sum_total = self.sum_total - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; + double *__pyx_t_1; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":972 + /* "sklearn/tree/_criterion.pyx":871 * samples[start:end].""" - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< - * cdef double* sum_total = self.sum_total - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.sq_sum_total; - __pyx_v_sq_sum_total = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":973 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double mean_total_k = 0. - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.sum_total; - __pyx_v_sum_total = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":974 - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* sum_total = self.sum_total - * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< - * cdef double mean_total_k = 0. - * cdef double total = 0.0 - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; - __pyx_v_weighted_n_node_samples = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":975 - * cdef double* sum_total = self.sum_total - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double mean_total_k = 0. # <<<<<<<<<<<<<< - * cdef double total = 0.0 - * cdef SIZE_t k = 0 - */ - __pyx_v_mean_total_k = 0.; - - /* "sklearn/tree/_criterion.pyx":976 - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double mean_total_k = 0. - * cdef double total = 0.0 # <<<<<<<<<<<<<< - * cdef SIZE_t k = 0 * + * cdef double* node_sum_total = self.node_sum_total # <<<<<<<<<<<<<< + * cdef double impurity + * cdef SIZE_t k */ - __pyx_v_total = 0.0; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_total; + __pyx_v_node_sum_total = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":977 - * cdef double mean_total_k = 0. - * cdef double total = 0.0 - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":875 + * cdef SIZE_t k * - * for k in range(n_outputs): + * impurity = self.sq_sum_total / self.weighted_n_node_samples # <<<<<<<<<<<<<< + * for k in range(self.n_outputs): + * impurity -= (node_sum_total[k] / self.weighted_n_node_samples)**2.0 */ - __pyx_v_k = 0; + __pyx_v_impurity = (__pyx_v_self->__pyx_base.__pyx_base.sq_sum_total / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples); - /* "sklearn/tree/_criterion.pyx":979 - * cdef SIZE_t k = 0 + /* "sklearn/tree/_criterion.pyx":876 * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * mean_total_k = sum_total[k] / weighted_n_node_samples - * total += (sq_sum_total[k] / weighted_n_node_samples - - */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_k = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":980 + * impurity = self.sq_sum_total / self.weighted_n_node_samples + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * impurity -= (node_sum_total[k] / self.weighted_n_node_samples)**2.0 * - * for k in range(n_outputs): - * mean_total_k = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< - * total += (sq_sum_total[k] / weighted_n_node_samples - - * mean_total_k * mean_total_k) */ - __pyx_v_mean_total_k = ((__pyx_v_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples); + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":981 - * for k in range(n_outputs): - * mean_total_k = sum_total[k] / weighted_n_node_samples - * total += (sq_sum_total[k] / weighted_n_node_samples - # <<<<<<<<<<<<<< - * mean_total_k * mean_total_k) + /* "sklearn/tree/_criterion.pyx":877 + * impurity = self.sq_sum_total / self.weighted_n_node_samples + * for k in range(self.n_outputs): + * impurity -= (node_sum_total[k] / self.weighted_n_node_samples)**2.0 # <<<<<<<<<<<<<< * + * return impurity / self.n_outputs */ - __pyx_v_total = (__pyx_v_total + (((__pyx_v_sq_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples) - (__pyx_v_mean_total_k * __pyx_v_mean_total_k))); + __pyx_v_impurity = (__pyx_v_impurity - pow(((__pyx_v_node_sum_total[__pyx_v_k]) / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples), 2.0)); } - /* "sklearn/tree/_criterion.pyx":984 - * mean_total_k * mean_total_k) + /* "sklearn/tree/_criterion.pyx":879 + * impurity -= (node_sum_total[k] / self.weighted_n_node_samples)**2.0 * - * return total / n_outputs # <<<<<<<<<<<<<< + * return impurity / self.n_outputs # <<<<<<<<<<<<<< * * cdef double proxy_impurity_improvement(self) nogil: */ - __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); + __pyx_r = (__pyx_v_impurity / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":968 + /* "sklearn/tree/_criterion.pyx":867 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -6991,8 +5869,8 @@ static double __pyx_f_7sklearn_4tree_10_criterion_3MSE_node_impurity(struct __py return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":986 - * return total / n_outputs +/* "sklearn/tree/_criterion.pyx":881 + * return impurity / self.n_outputs * * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< * """Compute a proxy of the impurity reduction @@ -7000,139 +5878,96 @@ static double __pyx_f_7sklearn_4tree_10_criterion_3MSE_node_impurity(struct __py */ static double __pyx_f_7sklearn_4tree_10_criterion_3MSE_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_10_criterion_MSE *__pyx_v_self) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double __pyx_v_weighted_n_left; - double __pyx_v_weighted_n_right; - double *__pyx_v_sum_left; - double *__pyx_v_sum_right; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; double __pyx_v_proxy_impurity_left; double __pyx_v_proxy_impurity_right; double __pyx_r; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - double __pyx_t_2; - double *__pyx_t_3; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; + double *__pyx_t_1; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":997 - * impurity_improvement method once the best split has been found. + /* "sklearn/tree/_criterion.pyx":893 * """ - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< * - * cdef double weighted_n_left = self.weighted_n_left - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":999 - * cdef SIZE_t n_outputs = self.n_outputs - * - * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< - * cdef double weighted_n_right = self.weighted_n_right - * - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; - __pyx_v_weighted_n_left = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1000 - * - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right * - * cdef double* sum_left = self.sum_left */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_2; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1002 - * cdef double weighted_n_right = self.weighted_n_right - * - * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.sum_left; - __pyx_v_sum_left = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":1003 - * - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":894 * - * cdef SIZE_t k = 0 - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.sum_right; - __pyx_v_sum_right = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":1005 - * cdef double* sum_right = self.sum_right + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< * - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * cdef double proxy_impurity_left = 0. - * cdef double proxy_impurity_right = 0. + * cdef SIZE_t k */ - __pyx_v_k = 0; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1006 + /* "sklearn/tree/_criterion.pyx":897 * - * cdef SIZE_t k = 0 - * cdef double proxy_impurity_left = 0. # <<<<<<<<<<<<<< - * cdef double proxy_impurity_right = 0. + * cdef SIZE_t k + * cdef double proxy_impurity_left = 0.0 # <<<<<<<<<<<<<< + * cdef double proxy_impurity_right = 0.0 * */ - __pyx_v_proxy_impurity_left = 0.; + __pyx_v_proxy_impurity_left = 0.0; - /* "sklearn/tree/_criterion.pyx":1007 - * cdef SIZE_t k = 0 - * cdef double proxy_impurity_left = 0. - * cdef double proxy_impurity_right = 0. # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":898 + * cdef SIZE_t k + * cdef double proxy_impurity_left = 0.0 + * cdef double proxy_impurity_right = 0.0 # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ - __pyx_v_proxy_impurity_right = 0.; + __pyx_v_proxy_impurity_right = 0.0; - /* "sklearn/tree/_criterion.pyx":1009 - * cdef double proxy_impurity_right = 0. + /* "sklearn/tree/_criterion.pyx":900 + * cdef double proxy_impurity_right = 0.0 * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * proxy_impurity_left += sum_left[k] * sum_left[k] - * proxy_impurity_right += sum_right[k] * sum_right[k] + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * proxy_impurity_left += node_sum_left[k] ** 2.0 + * proxy_impurity_right += node_sum_right[k] ** 2.0 */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_k = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":1010 + /* "sklearn/tree/_criterion.pyx":901 * - * for k in range(n_outputs): - * proxy_impurity_left += sum_left[k] * sum_left[k] # <<<<<<<<<<<<<< - * proxy_impurity_right += sum_right[k] * sum_right[k] + * for k in range(self.n_outputs): + * proxy_impurity_left += node_sum_left[k] ** 2.0 # <<<<<<<<<<<<<< + * proxy_impurity_right += node_sum_right[k] ** 2.0 * */ - __pyx_v_proxy_impurity_left = (__pyx_v_proxy_impurity_left + ((__pyx_v_sum_left[__pyx_v_k]) * (__pyx_v_sum_left[__pyx_v_k]))); + __pyx_v_proxy_impurity_left = (__pyx_v_proxy_impurity_left + pow((__pyx_v_node_sum_left[__pyx_v_k]), 2.0)); - /* "sklearn/tree/_criterion.pyx":1011 - * for k in range(n_outputs): - * proxy_impurity_left += sum_left[k] * sum_left[k] - * proxy_impurity_right += sum_right[k] * sum_right[k] # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":902 + * for k in range(self.n_outputs): + * proxy_impurity_left += node_sum_left[k] ** 2.0 + * proxy_impurity_right += node_sum_right[k] ** 2.0 # <<<<<<<<<<<<<< * - * return (proxy_impurity_left / weighted_n_left + + * return (proxy_impurity_left / self.weighted_n_left + */ - __pyx_v_proxy_impurity_right = (__pyx_v_proxy_impurity_right + ((__pyx_v_sum_right[__pyx_v_k]) * (__pyx_v_sum_right[__pyx_v_k]))); + __pyx_v_proxy_impurity_right = (__pyx_v_proxy_impurity_right + pow((__pyx_v_node_sum_right[__pyx_v_k]), 2.0)); } - /* "sklearn/tree/_criterion.pyx":1013 - * proxy_impurity_right += sum_right[k] * sum_right[k] + /* "sklearn/tree/_criterion.pyx":904 + * proxy_impurity_right += node_sum_right[k] ** 2.0 * - * return (proxy_impurity_left / weighted_n_left + # <<<<<<<<<<<<<< - * proxy_impurity_right / weighted_n_right) + * return (proxy_impurity_left / self.weighted_n_left + # <<<<<<<<<<<<<< + * proxy_impurity_right / self.weighted_n_right) * */ - __pyx_r = ((__pyx_v_proxy_impurity_left / __pyx_v_weighted_n_left) + (__pyx_v_proxy_impurity_right / __pyx_v_weighted_n_right)); + __pyx_r = ((__pyx_v_proxy_impurity_left / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left) + (__pyx_v_proxy_impurity_right / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right)); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":986 - * return total / n_outputs + /* "sklearn/tree/_criterion.pyx":881 + * return impurity / self.n_outputs * * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< * """Compute a proxy of the impurity reduction @@ -7144,8 +5979,8 @@ static double __pyx_f_7sklearn_4tree_10_criterion_3MSE_proxy_impurity_improvemen return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":1016 - * proxy_impurity_right / weighted_n_right) +/* "sklearn/tree/_criterion.pyx":907 + * proxy_impurity_right / self.weighted_n_right) * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: @@ -7153,418 +5988,122 @@ static double __pyx_f_7sklearn_4tree_10_criterion_3MSE_proxy_impurity_improvemen */ static void __pyx_f_7sklearn_4tree_10_criterion_3MSE_children_impurity(struct __pyx_obj_7sklearn_4tree_10_criterion_MSE *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right) { - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_y; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_y_stride; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_v_sample_weight; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_v_samples; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_pos; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_start; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_sum_left; - double *__pyx_v_sum_right; - double *__pyx_v_sq_sum_tmp; - double *__pyx_v_sq_sum_total; - double __pyx_v_weighted_n_left; - double __pyx_v_weighted_n_right; - double __pyx_v_total_left; - double __pyx_v_total_right; - double __pyx_v_mean_left_k; - double __pyx_v_mean_right_k; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_i; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_p; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_w; - CYTHON_UNUSED __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_diff_w; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t __pyx_v_y_ik; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_bytes; - __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t *__pyx_t_1; + double *__pyx_t_1; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t *__pyx_t_3; - double *__pyx_t_4; - double __pyx_t_5; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_6; - int __pyx_t_7; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_8; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_9; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_10; - - /* "sklearn/tree/_criterion.pyx":1022 - * (samples[pos:end]).""" - * - * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< - * cdef SIZE_t y_stride = self.y_stride - * cdef DOUBLE_t* sample_weight = self.sample_weight - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.y; - __pyx_v_y = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":1023 - * - * cdef DOUBLE_t* y = self.y - * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< - * cdef DOUBLE_t* sample_weight = self.sample_weight - * - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.y_stride; - __pyx_v_y_stride = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1024 - * cdef DOUBLE_t* y = self.y - * cdef SIZE_t y_stride = self.y_stride - * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< - * - * cdef SIZE_t* samples = self.samples - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.sample_weight; - __pyx_v_sample_weight = __pyx_t_1; - - /* "sklearn/tree/_criterion.pyx":1026 - * cdef DOUBLE_t* sample_weight = self.sample_weight - * - * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< - * cdef SIZE_t pos = self.pos - * cdef SIZE_t start = self.start - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.samples; - __pyx_v_samples = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":1027 - * - * cdef SIZE_t* samples = self.samples - * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< - * cdef SIZE_t start = self.start - * - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.pos; - __pyx_v_pos = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1028 - * cdef SIZE_t* samples = self.samples - * cdef SIZE_t pos = self.pos - * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< - * - * cdef SIZE_t n_outputs = self.n_outputs - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; - __pyx_v_start = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1030 - * cdef SIZE_t start = self.start - * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * - * cdef double* sum_left = self.sum_left - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1032 - * cdef SIZE_t n_outputs = self.n_outputs - * - * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * cdef double* sq_sum_tmp = self.sq_sum_tmp - */ - __pyx_t_4 = __pyx_v_self->__pyx_base.sum_left; - __pyx_v_sum_left = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":1033 - * - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< - * cdef double* sq_sum_tmp = self.sq_sum_tmp - * cdef double* sq_sum_total = self.sq_sum_total - */ - __pyx_t_4 = __pyx_v_self->__pyx_base.sum_right; - __pyx_v_sum_right = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":1034 - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - * cdef double* sq_sum_tmp = self.sq_sum_tmp # <<<<<<<<<<<<<< - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double weighted_n_left = self.weighted_n_left - */ - __pyx_t_4 = __pyx_v_self->__pyx_base.sq_sum_tmp; - __pyx_v_sq_sum_tmp = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":1035 - * cdef double* sum_right = self.sum_right - * cdef double* sq_sum_tmp = self.sq_sum_tmp - * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right - */ - __pyx_t_4 = __pyx_v_self->__pyx_base.sq_sum_total; - __pyx_v_sq_sum_total = __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":1036 - * cdef double* sq_sum_tmp = self.sq_sum_tmp - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< - * cdef double weighted_n_right = self.weighted_n_right - * - */ - __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; - __pyx_v_weighted_n_left = __pyx_t_5; - - /* "sklearn/tree/_criterion.pyx":1037 - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< - * - * cdef double total_left = 0.0 - */ - __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_5; - - /* "sklearn/tree/_criterion.pyx":1039 - * cdef double weighted_n_right = self.weighted_n_right - * - * cdef double total_left = 0.0 # <<<<<<<<<<<<<< - * cdef double total_right = 0.0 - * cdef double mean_left_k = 0.0 - */ - __pyx_v_total_left = 0.0; - - /* "sklearn/tree/_criterion.pyx":1040 - * - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 # <<<<<<<<<<<<<< - * cdef double mean_left_k = 0.0 - * cdef double mean_right_k = 0.0 - */ - __pyx_v_total_right = 0.0; - - /* "sklearn/tree/_criterion.pyx":1041 - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 - * cdef double mean_left_k = 0.0 # <<<<<<<<<<<<<< - * cdef double mean_right_k = 0.0 - * - */ - __pyx_v_mean_left_k = 0.0; - - /* "sklearn/tree/_criterion.pyx":1042 - * cdef double total_right = 0.0 - * cdef double mean_left_k = 0.0 - * cdef double mean_right_k = 0.0 # <<<<<<<<<<<<<< - * - * cdef SIZE_t i = 0 - */ - __pyx_v_mean_right_k = 0.0; - - /* "sklearn/tree/_criterion.pyx":1044 - * cdef double mean_right_k = 0.0 - * - * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 - */ - __pyx_v_i = 0; - - /* "sklearn/tree/_criterion.pyx":1045 - * - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< - * cdef SIZE_t k = 0 - * cdef DOUBLE_t w = 1.0 - */ - __pyx_v_p = 0; - - /* "sklearn/tree/_criterion.pyx":1046 - * cdef SIZE_t i = 0 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t w = 1.0 - * cdef DOUBLE_t diff_w = 0.0 - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_criterion.pyx":1047 - * cdef SIZE_t p = 0 - * cdef SIZE_t k = 0 - * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t diff_w = 0.0 - * cdef DOUBLE_t y_ik - */ - __pyx_v_w = 1.0; - - /* "sklearn/tree/_criterion.pyx":1048 - * cdef SIZE_t k = 0 - * cdef DOUBLE_t w = 1.0 - * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t y_ik - * - */ - __pyx_v_diff_w = 0.0; - - /* "sklearn/tree/_criterion.pyx":1052 - * - * # Compute squared sum - * cdef SIZE_t n_bytes = n_outputs * sizeof(double) # <<<<<<<<<<<<<< - * memset(sq_sum_tmp, 0, n_bytes) - * - */ - __pyx_v_n_bytes = (__pyx_v_n_outputs * (sizeof(double))); + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; + long __pyx_t_4; - /* "sklearn/tree/_criterion.pyx":1053 - * # Compute squared sum - * cdef SIZE_t n_bytes = n_outputs * sizeof(double) - * memset(sq_sum_tmp, 0, n_bytes) # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":914 * - * for p in range(start, pos): - */ - memset(__pyx_v_sq_sum_tmp, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_criterion.pyx":1055 - * memset(sq_sum_tmp, 0, n_bytes) * - * for p in range(start, pos): # <<<<<<<<<<<<<< - * i = samples[p] + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right * */ - __pyx_t_2 = __pyx_v_pos; - for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { - __pyx_v_p = __pyx_t_6; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1056 + /* "sklearn/tree/_criterion.pyx":915 * - * for p in range(start, pos): - * i = samples[p] # <<<<<<<<<<<<<< - * - * if sample_weight != NULL: - */ - __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - - /* "sklearn/tree/_criterion.pyx":1058 - * i = samples[p] - * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< * + * cdef SIZE_t k */ - __pyx_t_7 = ((__pyx_v_sample_weight != NULL) != 0); - if (__pyx_t_7) { + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1059 - * - * if sample_weight != NULL: - * w = sample_weight[i] # <<<<<<<<<<<<<< - * - * for k in range(n_outputs): - */ - __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); - - /* "sklearn/tree/_criterion.pyx":1058 - * i = samples[p] - * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * w = sample_weight[i] + /* "sklearn/tree/_criterion.pyx":919 + * cdef SIZE_t k * - */ - } - - /* "sklearn/tree/_criterion.pyx":1061 - * w = sample_weight[i] + * impurity_left[0] = self.sq_sum_left / self.weighted_n_left # <<<<<<<<<<<<<< + * impurity_right[0] = self.sq_sum_right / self.weighted_n_right * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * y_ik = y[i * y_stride + k] - * sq_sum_tmp[k] += w * y_ik * y_ik */ - __pyx_t_8 = __pyx_v_n_outputs; - for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { - __pyx_v_k = __pyx_t_9; + (__pyx_v_impurity_left[0]) = (__pyx_v_self->__pyx_base.__pyx_base.sq_sum_left / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left); - /* "sklearn/tree/_criterion.pyx":1062 + /* "sklearn/tree/_criterion.pyx":920 * - * for k in range(n_outputs): - * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< - * sq_sum_tmp[k] += w * y_ik * y_ik + * impurity_left[0] = self.sq_sum_left / self.weighted_n_left + * impurity_right[0] = self.sq_sum_right / self.weighted_n_right # <<<<<<<<<<<<<< * + * for k in range(self.n_outputs): */ - __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]); + (__pyx_v_impurity_right[0]) = (__pyx_v_self->__pyx_base.__pyx_base.sq_sum_right / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right); - /* "sklearn/tree/_criterion.pyx":1063 - * for k in range(n_outputs): - * y_ik = y[i * y_stride + k] - * sq_sum_tmp[k] += w * y_ik * y_ik # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":922 + * impurity_right[0] = self.sq_sum_right / self.weighted_n_right * - * # Compute impurity + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * impurity_left[0] -= ((node_sum_left[k] / + * self.weighted_n_left) ** 2.0) */ - __pyx_t_10 = __pyx_v_k; - (__pyx_v_sq_sum_tmp[__pyx_t_10]) = ((__pyx_v_sq_sum_tmp[__pyx_t_10]) + ((__pyx_v_w * __pyx_v_y_ik) * __pyx_v_y_ik)); - } - } + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":1066 + /* "sklearn/tree/_criterion.pyx":923 * - * # Compute impurity - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * mean_left_k = sum_left[k] / weighted_n_left - * total_left += (sq_sum_tmp[k] / weighted_n_left - + * for k in range(self.n_outputs): + * impurity_left[0] -= ((node_sum_left[k] / # <<<<<<<<<<<<<< + * self.weighted_n_left) ** 2.0) + * impurity_right[0] -= ((node_sum_right[k] / */ - __pyx_t_2 = __pyx_v_n_outputs; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { - __pyx_v_k = __pyx_t_6; + __pyx_t_4 = 0; - /* "sklearn/tree/_criterion.pyx":1067 - * # Compute impurity - * for k in range(n_outputs): - * mean_left_k = sum_left[k] / weighted_n_left # <<<<<<<<<<<<<< - * total_left += (sq_sum_tmp[k] / weighted_n_left - - * mean_left_k * mean_left_k) + /* "sklearn/tree/_criterion.pyx":924 + * for k in range(self.n_outputs): + * impurity_left[0] -= ((node_sum_left[k] / + * self.weighted_n_left) ** 2.0) # <<<<<<<<<<<<<< + * impurity_right[0] -= ((node_sum_right[k] / + * self.weighted_n_right) ** 2.0) */ - __pyx_v_mean_left_k = ((__pyx_v_sum_left[__pyx_v_k]) / __pyx_v_weighted_n_left); + (__pyx_v_impurity_left[__pyx_t_4]) = ((__pyx_v_impurity_left[__pyx_t_4]) - pow(((__pyx_v_node_sum_left[__pyx_v_k]) / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left), 2.0)); - /* "sklearn/tree/_criterion.pyx":1068 - * for k in range(n_outputs): - * mean_left_k = sum_left[k] / weighted_n_left - * total_left += (sq_sum_tmp[k] / weighted_n_left - # <<<<<<<<<<<<<< - * mean_left_k * mean_left_k) + /* "sklearn/tree/_criterion.pyx":925 + * impurity_left[0] -= ((node_sum_left[k] / + * self.weighted_n_left) ** 2.0) + * impurity_right[0] -= ((node_sum_right[k] / # <<<<<<<<<<<<<< + * self.weighted_n_right) ** 2.0) * */ - __pyx_v_total_left = (__pyx_v_total_left + (((__pyx_v_sq_sum_tmp[__pyx_v_k]) / __pyx_v_weighted_n_left) - (__pyx_v_mean_left_k * __pyx_v_mean_left_k))); - - /* "sklearn/tree/_criterion.pyx":1071 - * mean_left_k * mean_left_k) - * - * mean_right_k = sum_right[k] / weighted_n_right # <<<<<<<<<<<<<< - * total_right += ((sq_sum_total[k] - sq_sum_tmp[k]) / weighted_n_right - - * mean_right_k * mean_right_k) - */ - __pyx_v_mean_right_k = ((__pyx_v_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_right); + __pyx_t_4 = 0; - /* "sklearn/tree/_criterion.pyx":1072 - * - * mean_right_k = sum_right[k] / weighted_n_right - * total_right += ((sq_sum_total[k] - sq_sum_tmp[k]) / weighted_n_right - # <<<<<<<<<<<<<< - * mean_right_k * mean_right_k) + /* "sklearn/tree/_criterion.pyx":926 + * self.weighted_n_left) ** 2.0) + * impurity_right[0] -= ((node_sum_right[k] / + * self.weighted_n_right) ** 2.0) # <<<<<<<<<<<<<< * + * impurity_left[0] /= self.n_outputs */ - __pyx_v_total_right = (__pyx_v_total_right + ((((__pyx_v_sq_sum_total[__pyx_v_k]) - (__pyx_v_sq_sum_tmp[__pyx_v_k])) / __pyx_v_weighted_n_right) - (__pyx_v_mean_right_k * __pyx_v_mean_right_k))); + (__pyx_v_impurity_right[__pyx_t_4]) = ((__pyx_v_impurity_right[__pyx_t_4]) - pow(((__pyx_v_node_sum_right[__pyx_v_k]) / __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right), 2.0)); } - /* "sklearn/tree/_criterion.pyx":1075 - * mean_right_k * mean_right_k) + /* "sklearn/tree/_criterion.pyx":928 + * self.weighted_n_right) ** 2.0) * - * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< - * impurity_right[0] = total_right / n_outputs + * impurity_left[0] /= self.n_outputs # <<<<<<<<<<<<<< + * impurity_right[0] /= self.n_outputs * */ - (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); + __pyx_t_4 = 0; + (__pyx_v_impurity_left[__pyx_t_4]) = ((__pyx_v_impurity_left[__pyx_t_4]) / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); - /* "sklearn/tree/_criterion.pyx":1076 + /* "sklearn/tree/_criterion.pyx":929 * - * impurity_left[0] = total_left / n_outputs - * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< + * impurity_left[0] /= self.n_outputs + * impurity_right[0] /= self.n_outputs # <<<<<<<<<<<<<< * * */ - (__pyx_v_impurity_right[0]) = (__pyx_v_total_right / __pyx_v_n_outputs); + __pyx_t_4 = 0; + (__pyx_v_impurity_right[__pyx_t_4]) = ((__pyx_v_impurity_right[__pyx_t_4]) / __pyx_v_self->__pyx_base.__pyx_base.n_outputs); - /* "sklearn/tree/_criterion.pyx":1016 - * proxy_impurity_right / weighted_n_right) + /* "sklearn/tree/_criterion.pyx":907 + * proxy_impurity_right / self.weighted_n_right) * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: @@ -7574,7 +6113,7 @@ static void __pyx_f_7sklearn_4tree_10_criterion_3MSE_children_impurity(struct __ /* function exit code */ } -/* "sklearn/tree/_criterion.pyx":1088 +/* "sklearn/tree/_criterion.pyx":941 * """ * * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< @@ -7583,157 +6122,114 @@ static void __pyx_f_7sklearn_4tree_10_criterion_3MSE_children_impurity(struct __ */ static double __pyx_f_7sklearn_4tree_10_criterion_11FriedmanMSE_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_10_criterion_FriedmanMSE *__pyx_v_self) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_sum_left; - double *__pyx_v_sum_right; - double __pyx_v_weighted_n_left; - double __pyx_v_weighted_n_right; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; double __pyx_v_total_sum_left; double __pyx_v_total_sum_right; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; double __pyx_v_diff; double __pyx_r; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - double *__pyx_t_2; - double __pyx_t_3; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; - - /* "sklearn/tree/_criterion.pyx":1099 - * impurity_improvement method once the best split has been found. - * """ - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; + double *__pyx_t_1; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":1100 + /* "sklearn/tree/_criterion.pyx":953 * """ - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * cdef double weighted_n_left = self.weighted_n_left - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_left; - __pyx_v_sum_left = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1101 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_right; - __pyx_v_sum_right = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1102 - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< - * cdef double weighted_n_right = self.weighted_n_right - * cdef double total_sum_left = 0.0 + * + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right + * */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left; - __pyx_v_weighted_n_left = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1103 - * cdef double* sum_right = self.sum_right - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":954 + * + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< + * * cdef double total_sum_left = 0.0 - * cdef double total_sum_right = 0.0 */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1104 - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right + /* "sklearn/tree/_criterion.pyx":956 + * cdef double* node_sum_right = self.node_sum_right + * * cdef double total_sum_left = 0.0 # <<<<<<<<<<<<<< * cdef double total_sum_right = 0.0 * */ __pyx_v_total_sum_left = 0.0; - /* "sklearn/tree/_criterion.pyx":1105 - * cdef double weighted_n_right = self.weighted_n_right + /* "sklearn/tree/_criterion.pyx":957 + * * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 # <<<<<<<<<<<<<< * - * cdef SIZE_t k = 0 + * cdef SIZE_t k */ __pyx_v_total_sum_right = 0.0; - /* "sklearn/tree/_criterion.pyx":1107 - * cdef double total_sum_right = 0.0 + /* "sklearn/tree/_criterion.pyx":960 * - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * cdef double diff = 0.0 - * - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_criterion.pyx":1108 - * - * cdef SIZE_t k = 0 + * cdef SIZE_t k * cdef double diff = 0.0 # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ __pyx_v_diff = 0.0; - /* "sklearn/tree/_criterion.pyx":1110 + /* "sklearn/tree/_criterion.pyx":962 * cdef double diff = 0.0 * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * total_sum_left += sum_left[k] - * total_sum_right += sum_right[k] + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * total_sum_left += node_sum_left[k] + * total_sum_right += node_sum_right[k] */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_k = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":1111 + /* "sklearn/tree/_criterion.pyx":963 * - * for k in range(n_outputs): - * total_sum_left += sum_left[k] # <<<<<<<<<<<<<< - * total_sum_right += sum_right[k] + * for k in range(self.n_outputs): + * total_sum_left += node_sum_left[k] # <<<<<<<<<<<<<< + * total_sum_right += node_sum_right[k] * */ - __pyx_v_total_sum_left = (__pyx_v_total_sum_left + (__pyx_v_sum_left[__pyx_v_k])); + __pyx_v_total_sum_left = (__pyx_v_total_sum_left + (__pyx_v_node_sum_left[__pyx_v_k])); - /* "sklearn/tree/_criterion.pyx":1112 - * for k in range(n_outputs): - * total_sum_left += sum_left[k] - * total_sum_right += sum_right[k] # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":964 + * for k in range(self.n_outputs): + * total_sum_left += node_sum_left[k] + * total_sum_right += node_sum_right[k] # <<<<<<<<<<<<<< * - * diff = (weighted_n_right * total_sum_left - + * diff = (self.weighted_n_right * total_sum_left - */ - __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_sum_right[__pyx_v_k])); + __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_node_sum_right[__pyx_v_k])); } - /* "sklearn/tree/_criterion.pyx":1114 - * total_sum_right += sum_right[k] + /* "sklearn/tree/_criterion.pyx":966 + * total_sum_right += node_sum_right[k] * - * diff = (weighted_n_right * total_sum_left - # <<<<<<<<<<<<<< - * weighted_n_left * total_sum_right) + * diff = (self.weighted_n_right * total_sum_left - # <<<<<<<<<<<<<< + * self.weighted_n_left * total_sum_right) * */ - __pyx_v_diff = ((__pyx_v_weighted_n_right * __pyx_v_total_sum_left) - (__pyx_v_weighted_n_left * __pyx_v_total_sum_right)); + __pyx_v_diff = ((__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right * __pyx_v_total_sum_left) - (__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left * __pyx_v_total_sum_right)); - /* "sklearn/tree/_criterion.pyx":1117 - * weighted_n_left * total_sum_right) + /* "sklearn/tree/_criterion.pyx":969 + * self.weighted_n_left * total_sum_right) * - * return diff * diff / (weighted_n_left * weighted_n_right) # <<<<<<<<<<<<<< + * return diff * diff / (self.weighted_n_left * self.weighted_n_right) # <<<<<<<<<<<<<< * * cdef double impurity_improvement(self, double impurity) nogil: */ - __pyx_r = ((__pyx_v_diff * __pyx_v_diff) / (__pyx_v_weighted_n_left * __pyx_v_weighted_n_right)); + __pyx_r = ((__pyx_v_diff * __pyx_v_diff) / (__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left * __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right)); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":1088 + /* "sklearn/tree/_criterion.pyx":941 * """ * * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< @@ -7746,181 +6242,127 @@ static double __pyx_f_7sklearn_4tree_10_criterion_11FriedmanMSE_proxy_impurity_i return __pyx_r; } -/* "sklearn/tree/_criterion.pyx":1119 - * return diff * diff / (weighted_n_left * weighted_n_right) +/* "sklearn/tree/_criterion.pyx":971 + * return diff * diff / (self.weighted_n_left * self.weighted_n_right) * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right */ static double __pyx_f_7sklearn_4tree_10_criterion_11FriedmanMSE_impurity_improvement(struct __pyx_obj_7sklearn_4tree_10_criterion_FriedmanMSE *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity) { - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_sum_left; - double *__pyx_v_sum_right; - double __pyx_v_weighted_n_left; - double __pyx_v_weighted_n_right; - double __pyx_v_weighted_n_node_samples; + double *__pyx_v_node_sum_left; + double *__pyx_v_node_sum_right; double __pyx_v_total_sum_left; double __pyx_v_total_sum_right; __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_v_k; double __pyx_v_diff; double __pyx_r; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_1; - double *__pyx_t_2; - double __pyx_t_3; - __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_4; + double *__pyx_t_1; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_2; + __pyx_t_7sklearn_4tree_10_criterion_SIZE_t __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":1120 + /* "sklearn/tree/_criterion.pyx":972 * * cdef double impurity_improvement(self, double impurity) nogil: - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right + * cdef double* node_sum_left = self.node_sum_left # <<<<<<<<<<<<<< + * cdef double* node_sum_right = self.node_sum_right + * */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.node_sum_left; + __pyx_v_node_sum_left = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1121 + /* "sklearn/tree/_criterion.pyx":973 * cdef double impurity_improvement(self, double impurity) nogil: - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * cdef double weighted_n_left = self.weighted_n_left - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_left; - __pyx_v_sum_left = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1122 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right - */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_right; - __pyx_v_sum_right = __pyx_t_2; - - /* "sklearn/tree/_criterion.pyx":1123 - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< - * cdef double weighted_n_right = self.weighted_n_right - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left; - __pyx_v_weighted_n_left = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":1124 - * cdef double* sum_right = self.sum_right - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double total_sum_left = 0.0 - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_3; - - /* "sklearn/tree/_criterion.pyx":1125 - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right - * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right # <<<<<<<<<<<<<< + * * cdef double total_sum_left = 0.0 - * cdef double total_sum_right = 0.0 */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_node_samples; - __pyx_v_weighted_n_node_samples = __pyx_t_3; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.node_sum_right; + __pyx_v_node_sum_right = __pyx_t_1; - /* "sklearn/tree/_criterion.pyx":1126 - * cdef double weighted_n_right = self.weighted_n_right - * cdef double weighted_n_node_samples = self.weighted_n_node_samples + /* "sklearn/tree/_criterion.pyx":975 + * cdef double* node_sum_right = self.node_sum_right + * * cdef double total_sum_left = 0.0 # <<<<<<<<<<<<<< * cdef double total_sum_right = 0.0 * */ __pyx_v_total_sum_left = 0.0; - /* "sklearn/tree/_criterion.pyx":1127 - * cdef double weighted_n_node_samples = self.weighted_n_node_samples + /* "sklearn/tree/_criterion.pyx":976 + * * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 # <<<<<<<<<<<<<< * - * cdef SIZE_t k = 0 + * cdef SIZE_t k */ __pyx_v_total_sum_right = 0.0; - /* "sklearn/tree/_criterion.pyx":1129 - * cdef double total_sum_right = 0.0 - * - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * cdef double diff = 0.0 - * - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_criterion.pyx":1130 + /* "sklearn/tree/_criterion.pyx":979 * - * cdef SIZE_t k = 0 + * cdef SIZE_t k * cdef double diff = 0.0 # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * for k in range(self.n_outputs): */ __pyx_v_diff = 0.0; - /* "sklearn/tree/_criterion.pyx":1132 + /* "sklearn/tree/_criterion.pyx":981 * cdef double diff = 0.0 * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * total_sum_left += sum_left[k] - * total_sum_right += sum_right[k] + * for k in range(self.n_outputs): # <<<<<<<<<<<<<< + * total_sum_left += node_sum_left[k] + * total_sum_right += node_sum_right[k] */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_k = __pyx_t_4; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_outputs; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_criterion.pyx":1133 + /* "sklearn/tree/_criterion.pyx":982 * - * for k in range(n_outputs): - * total_sum_left += sum_left[k] # <<<<<<<<<<<<<< - * total_sum_right += sum_right[k] + * for k in range(self.n_outputs): + * total_sum_left += node_sum_left[k] # <<<<<<<<<<<<<< + * total_sum_right += node_sum_right[k] * */ - __pyx_v_total_sum_left = (__pyx_v_total_sum_left + (__pyx_v_sum_left[__pyx_v_k])); + __pyx_v_total_sum_left = (__pyx_v_total_sum_left + (__pyx_v_node_sum_left[__pyx_v_k])); - /* "sklearn/tree/_criterion.pyx":1134 - * for k in range(n_outputs): - * total_sum_left += sum_left[k] - * total_sum_right += sum_right[k] # <<<<<<<<<<<<<< + /* "sklearn/tree/_criterion.pyx":983 + * for k in range(self.n_outputs): + * total_sum_left += node_sum_left[k] + * total_sum_right += node_sum_right[k] # <<<<<<<<<<<<<< * - * diff = (weighted_n_right * total_sum_left - + * diff = (self.weighted_n_right * total_sum_left - */ - __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_sum_right[__pyx_v_k])); + __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_node_sum_right[__pyx_v_k])); } - /* "sklearn/tree/_criterion.pyx":1137 + /* "sklearn/tree/_criterion.pyx":986 * - * diff = (weighted_n_right * total_sum_left - - * weighted_n_left * total_sum_right) / n_outputs # <<<<<<<<<<<<<< + * diff = (self.weighted_n_right * total_sum_left - + * self.weighted_n_left * total_sum_right) / self.n_outputs # <<<<<<<<<<<<<< * - * return (diff * diff / + * return (diff * diff / (self.weighted_n_left * self.weighted_n_right * */ - __pyx_v_diff = (((__pyx_v_weighted_n_right * __pyx_v_total_sum_left) - (__pyx_v_weighted_n_left * __pyx_v_total_sum_right)) / __pyx_v_n_outputs); + __pyx_v_diff = (((__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right * __pyx_v_total_sum_left) - (__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left * __pyx_v_total_sum_right)) / __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_outputs); - /* "sklearn/tree/_criterion.pyx":1139 - * weighted_n_left * total_sum_right) / n_outputs + /* "sklearn/tree/_criterion.pyx":988 + * self.weighted_n_left * total_sum_right) / self.n_outputs * - * return (diff * diff / # <<<<<<<<<<<<<< - * (weighted_n_left * weighted_n_right * weighted_n_node_samples)) + * return (diff * diff / (self.weighted_n_left * self.weighted_n_right * # <<<<<<<<<<<<<< + * self.weighted_n_node_samples)) */ - __pyx_r = ((__pyx_v_diff * __pyx_v_diff) / ((__pyx_v_weighted_n_left * __pyx_v_weighted_n_right) * __pyx_v_weighted_n_node_samples)); + __pyx_r = ((__pyx_v_diff * __pyx_v_diff) / ((__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left * __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right) * __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_node_samples)); goto __pyx_L0; - /* "sklearn/tree/_criterion.pyx":1119 - * return diff * diff / (weighted_n_left * weighted_n_right) + /* "sklearn/tree/_criterion.pyx":971 + * return diff * diff / (self.weighted_n_left * self.weighted_n_right) * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* sum_left = self.sum_left + * cdef double* node_sum_left = self.node_sum_left + * cdef double* node_sum_right = self.node_sum_right */ /* function exit code */ @@ -7928,7 +6370,7 @@ static double __pyx_f_7sklearn_4tree_10_criterion_11FriedmanMSE_impurity_improve return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -7978,7 +6420,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -7991,7 +6433,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -8000,7 +6442,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -8009,7 +6451,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -8018,7 +6460,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -8028,7 +6470,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -8036,30 +6478,22 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * copy_shape = 0 */ __pyx_v_copy_shape = 1; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ goto __pyx_L4; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - /*else*/ { __pyx_v_copy_shape = 0; } __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -8073,7 +6507,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -8083,17 +6517,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -8105,17 +6531,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -8129,7 +6547,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -8139,17 +6557,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -8161,17 +6571,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -8180,7 +6582,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -8189,7 +6591,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -8199,7 +6601,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -8208,7 +6610,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -8217,7 +6619,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -8228,7 +6630,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -8237,7 +6639,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -8246,28 +6648,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ goto __pyx_L11; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -8278,7 +6672,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -8287,7 +6681,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -8296,7 +6690,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -8305,28 +6699,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< * cdef dtype descr = self.descr - * cdef int offset + * cdef list stack */ __pyx_v_f = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack * cdef int offset - * */ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); __Pyx_INCREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -8335,7 +6729,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -8353,7 +6747,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -8365,25 +6759,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ goto __pyx_L14; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< * * if not hasfields: */ - /*else*/ { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_info->obj); @@ -8392,7 +6778,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -8402,7 +6788,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -8412,7 +6798,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -8432,7 +6818,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -8448,51 +6834,43 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - } + switch (__pyx_v_t) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" */ - switch (__pyx_v_t) { case NPY_BYTE: __pyx_v_f = __pyx_k_b; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -8503,7 +6881,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -8514,7 +6892,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -8525,7 +6903,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -8536,7 +6914,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -8547,7 +6925,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -8558,7 +6936,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -8569,7 +6947,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -8580,7 +6958,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -8591,7 +6969,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -8602,7 +6980,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -8613,7 +6991,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -8624,7 +7002,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -8635,7 +7013,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -8646,7 +7024,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -8657,7 +7035,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -8669,33 +7047,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -8704,7 +7082,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -8713,27 +7091,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_r = 0; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 */ - /*else*/ { __pyx_v_info->format = ((char *)malloc(255)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -8742,7 +7112,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -8751,17 +7121,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_7; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -8771,7 +7141,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -8803,7 +7173,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -8827,7 +7197,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -8837,7 +7207,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -8845,17 +7215,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * stdlib.free(info.strides) */ free(__pyx_v_info->format); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ + goto __pyx_L3; } + __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -8865,7 +7229,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -8873,17 +7237,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * */ free(__pyx_v_info->strides); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ + goto __pyx_L4; } + __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -8895,7 +7253,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -8912,7 +7270,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -8920,13 +7278,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -8945,7 +7303,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -8962,7 +7320,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -8970,13 +7328,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -8995,7 +7353,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -9012,7 +7370,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -9020,13 +7378,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -9045,7 +7403,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -9062,7 +7420,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -9070,13 +7428,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -9095,7 +7453,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -9112,7 +7470,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -9120,13 +7478,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -9145,7 +7503,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -9177,17 +7535,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":793 + * cdef int delta_offset + * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< * cdef bint little_endian = ((&endian_detector)[0] != 0) * cdef tuple fields */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * cdef tuple fields @@ -9195,7 +7553,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -9204,21 +7562,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -9227,15 +7585,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -9252,7 +7610,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -9260,60 +7618,52 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -9333,7 +7683,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -9349,39 +7699,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -9389,15 +7723,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -9406,7 +7740,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -9415,7 +7749,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -9426,7 +7760,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -9436,7 +7770,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -9446,19 +7780,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -9468,274 +7802,266 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9744,18 +8070,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9764,18 +8090,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -9784,49 +8110,49 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L15:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -9834,31 +8160,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * # Cython ignores struct boundary information ("T{...}"), */ __pyx_v_f = (__pyx_v_f + 1); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ goto __pyx_L13; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; } __pyx_L13:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -9868,7 +8186,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -9878,7 +8196,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -9903,7 +8221,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -9918,7 +8236,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -9929,7 +8247,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -9937,28 +8255,20 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a * Py_INCREF(base) # important to do this before decref below! */ __pyx_v_baseptr = NULL; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ goto __pyx_L3; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.base) */ - /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":975 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -9969,7 +8279,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -9978,7 +8288,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -9987,7 +8297,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -9999,7 +8309,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -10013,7 +8323,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -10023,7 +8333,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":981 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -10034,29 +8344,21 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983 * return None * else: * return arr.base # <<<<<<<<<<<<<< */ - /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); __pyx_r = ((PyObject *)__pyx_v_arr->base); goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -10092,9 +8394,23 @@ static void __pyx_tp_dealloc_7sklearn_4tree_10_criterion_Criterion(PyObject *o) if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_7sklearn_4tree_10_criterion_9Criterion_1__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } (*Py_TYPE(o)->tp_free)(o); } +static PyMethodDef __pyx_methods_7sklearn_4tree_10_criterion_Criterion[] = { + {"__getstate__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_9Criterion_3__getstate__, METH_NOARGS, 0}, + {"__setstate__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_9Criterion_5__setstate__, METH_O, 0}, + {0, 0, 0, 0} +}; + static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_Criterion = { PyVarObject_HEAD_INIT(0, 0) "sklearn.tree._criterion.Criterion", /*tp_name*/ @@ -10106,9 +8422,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_Criterion = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -10128,7 +8443,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_Criterion = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - 0, /*tp_methods*/ + __pyx_methods_7sklearn_4tree_10_criterion_Criterion, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -10185,8 +8500,6 @@ static void __pyx_tp_dealloc_7sklearn_4tree_10_criterion_ClassificationCriterion static PyMethodDef __pyx_methods_7sklearn_4tree_10_criterion_ClassificationCriterion[] = { {"__reduce__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_5__reduce__, METH_NOARGS, 0}, - {"__getstate__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_7__getstate__, METH_NOARGS, 0}, - {"__setstate__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_23ClassificationCriterion_9__setstate__, METH_O, 0}, {0, 0, 0, 0} }; @@ -10201,9 +8514,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_ClassificationCriteri 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -10269,9 +8581,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_Entropy = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -10337,9 +8648,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_Gini = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -10386,38 +8696,19 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_Gini = { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_RegressionCriterion __pyx_vtable_7sklearn_4tree_10_criterion_RegressionCriterion; static PyObject *__pyx_tp_new_7sklearn_4tree_10_criterion_RegressionCriterion(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *p; - PyObject *o = __pyx_tp_new_7sklearn_4tree_10_criterion_Criterion(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion*)__pyx_vtabptr_7sklearn_4tree_10_criterion_RegressionCriterion; - if (unlikely(__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_7sklearn_4tree_10_criterion_RegressionCriterion(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); + struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *p; + PyObject *o = __pyx_tp_new_7sklearn_4tree_10_criterion_Criterion(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion*)__pyx_vtabptr_7sklearn_4tree_10_criterion_RegressionCriterion; + if (unlikely(__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; } - __pyx_tp_dealloc_7sklearn_4tree_10_criterion_Criterion(o); + return o; } static PyMethodDef __pyx_methods_7sklearn_4tree_10_criterion_RegressionCriterion[] = { - {"__reduce__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_5__reduce__, METH_NOARGS, 0}, - {"__getstate__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_7__getstate__, METH_NOARGS, 0}, - {"__setstate__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_9__setstate__, METH_O, 0}, + {"__reduce__", (PyCFunction)__pyx_pw_7sklearn_4tree_10_criterion_19RegressionCriterion_3__reduce__, METH_NOARGS, 0}, {0, 0, 0, 0} }; @@ -10426,15 +8717,14 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion = "sklearn.tree._criterion.RegressionCriterion", /*tp_name*/ sizeof(struct __pyx_obj_7sklearn_4tree_10_criterion_RegressionCriterion), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_10_criterion_RegressionCriterion, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_4tree_10_criterion_Criterion, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -10494,15 +8784,14 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_MSE = { "sklearn.tree._criterion.MSE", /*tp_name*/ sizeof(struct __pyx_obj_7sklearn_4tree_10_criterion_MSE), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_10_criterion_RegressionCriterion, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_4tree_10_criterion_Criterion, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -10562,15 +8851,14 @@ static PyTypeObject __pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE = { "sklearn.tree._criterion.FriedmanMSE", /*tp_name*/ sizeof(struct __pyx_obj_7sklearn_4tree_10_criterion_FriedmanMSE), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_10_criterion_RegressionCriterion, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_4tree_10_criterion_Criterion, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -10660,10 +8948,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -10673,7 +8961,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -10684,7 +8972,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -10695,47 +8983,47 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __Pyx_RefNannyFinishContext(); @@ -10776,24 +9064,18 @@ PyMODINIT_FUNC PyInit__criterion(void) } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__criterion(void)", 0); - if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS @@ -10816,12 +9098,12 @@ PyMODINIT_FUNC PyInit__criterion(void) #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_sklearn__tree___criterion) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } #if PY_MAJOR_VERSION >= 3 { @@ -10832,9 +9114,9 @@ PyMODINIT_FUNC PyInit__criterion(void) } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ @@ -10864,30 +9146,30 @@ PyMODINIT_FUNC PyInit__criterion(void) __pyx_vtable_7sklearn_4tree_10_criterion_ClassificationCriterion.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_children_impurity; __pyx_vtable_7sklearn_4tree_10_criterion_ClassificationCriterion.__pyx_base.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *))__pyx_f_7sklearn_4tree_10_criterion_23ClassificationCriterion_node_value; __pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion.tp_base = __pyx_ptype_7sklearn_4tree_10_criterion_Criterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "ClassificationCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "ClassificationCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion = &__pyx_type_7sklearn_4tree_10_criterion_ClassificationCriterion; __pyx_vtabptr_7sklearn_4tree_10_criterion_Entropy = &__pyx_vtable_7sklearn_4tree_10_criterion_Entropy; __pyx_vtable_7sklearn_4tree_10_criterion_Entropy.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_10_criterion_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_10_criterion_Entropy.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *))__pyx_f_7sklearn_4tree_10_criterion_7Entropy_node_impurity; __pyx_vtable_7sklearn_4tree_10_criterion_Entropy.__pyx_base.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_10_criterion_7Entropy_children_impurity; __pyx_type_7sklearn_4tree_10_criterion_Entropy.tp_base = __pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_10_criterion_Entropy.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_Entropy.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Entropy", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_Entropy.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Entropy", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_10_criterion_Entropy = &__pyx_type_7sklearn_4tree_10_criterion_Entropy; __pyx_vtabptr_7sklearn_4tree_10_criterion_Gini = &__pyx_vtable_7sklearn_4tree_10_criterion_Gini; __pyx_vtable_7sklearn_4tree_10_criterion_Gini.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_10_criterion_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_10_criterion_Gini.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *))__pyx_f_7sklearn_4tree_10_criterion_4Gini_node_impurity; __pyx_vtable_7sklearn_4tree_10_criterion_Gini.__pyx_base.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_10_criterion_4Gini_children_impurity; __pyx_type_7sklearn_4tree_10_criterion_Gini.tp_base = __pyx_ptype_7sklearn_4tree_10_criterion_ClassificationCriterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_10_criterion_Gini.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_Gini.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Gini", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_Gini.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Gini", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_10_criterion_Gini = &__pyx_type_7sklearn_4tree_10_criterion_Gini; __pyx_vtabptr_7sklearn_4tree_10_criterion_RegressionCriterion = &__pyx_vtable_7sklearn_4tree_10_criterion_RegressionCriterion; __pyx_vtable_7sklearn_4tree_10_criterion_RegressionCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion; @@ -10899,10 +9181,10 @@ PyMODINIT_FUNC PyInit__criterion(void) __pyx_vtable_7sklearn_4tree_10_criterion_RegressionCriterion.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_children_impurity; __pyx_vtable_7sklearn_4tree_10_criterion_RegressionCriterion.__pyx_base.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *))__pyx_f_7sklearn_4tree_10_criterion_19RegressionCriterion_node_value; __pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion.tp_base = __pyx_ptype_7sklearn_4tree_10_criterion_Criterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "RegressionCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "RegressionCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion = &__pyx_type_7sklearn_4tree_10_criterion_RegressionCriterion; __pyx_vtabptr_7sklearn_4tree_10_criterion_MSE = &__pyx_vtable_7sklearn_4tree_10_criterion_MSE; __pyx_vtable_7sklearn_4tree_10_criterion_MSE.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_10_criterion_RegressionCriterion; @@ -10910,20 +9192,20 @@ PyMODINIT_FUNC PyInit__criterion(void) __pyx_vtable_7sklearn_4tree_10_criterion_MSE.__pyx_base.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_10_criterion_3MSE_children_impurity; __pyx_vtable_7sklearn_4tree_10_criterion_MSE.__pyx_base.__pyx_base.proxy_impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *))__pyx_f_7sklearn_4tree_10_criterion_3MSE_proxy_impurity_improvement; __pyx_type_7sklearn_4tree_10_criterion_MSE.tp_base = __pyx_ptype_7sklearn_4tree_10_criterion_RegressionCriterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_10_criterion_MSE.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_MSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "MSE", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_MSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "MSE", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_10_criterion_MSE = &__pyx_type_7sklearn_4tree_10_criterion_MSE; __pyx_vtabptr_7sklearn_4tree_10_criterion_FriedmanMSE = &__pyx_vtable_7sklearn_4tree_10_criterion_FriedmanMSE; __pyx_vtable_7sklearn_4tree_10_criterion_FriedmanMSE.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_10_criterion_MSE; __pyx_vtable_7sklearn_4tree_10_criterion_FriedmanMSE.__pyx_base.__pyx_base.__pyx_base.impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double))__pyx_f_7sklearn_4tree_10_criterion_11FriedmanMSE_impurity_improvement; __pyx_vtable_7sklearn_4tree_10_criterion_FriedmanMSE.__pyx_base.__pyx_base.__pyx_base.proxy_impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *))__pyx_f_7sklearn_4tree_10_criterion_11FriedmanMSE_proxy_impurity_improvement; __pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE.tp_base = __pyx_ptype_7sklearn_4tree_10_criterion_MSE; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "FriedmanMSE", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_10_criterion_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "FriedmanMSE", (PyObject *)&__pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_10_criterion_FriedmanMSE = &__pyx_type_7sklearn_4tree_10_criterion_FriedmanMSE; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -10937,7 +9219,7 @@ PyMODINIT_FUNC PyInit__criterion(void) __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_6_utils_Stack = __Pyx_ImportType("sklearn.tree._utils", "Stack", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_Stack), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_Stack)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_7sklearn_4tree_6_utils_Stack = (struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_6_utils_Stack->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_6_utils_Stack)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap = __Pyx_ImportType("sklearn.tree._utils", "PriorityHeap", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10952,9 +9234,6 @@ PyMODINIT_FUNC PyInit__criterion(void) if (__Pyx_ImportFunction(__pyx_t_1, "__pyx_fuse_2safe_realloc", (void (**)(void))&__pyx_fuse_2__pyx_f_7sklearn_4tree_6_utils_safe_realloc, "unsigned char *(unsigned char **, size_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /* "sklearn/tree/_criterion.pyx":23 * from libc.string cimport memset @@ -10987,7 +9266,7 @@ PyMODINIT_FUNC PyInit__criterion(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -12099,86 +10378,13 @@ static void* __Pyx_GetVtable(PyObject *dict) { return NULL; } -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { - mid = start + (end - start) / 2; + mid = (start + end) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { @@ -12331,6 +10537,79 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, Py_XDECREF(py_frame); } +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); @@ -12352,33 +10631,29 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -#if CYTHON_USE_PYLONG_INTERNALS + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \ + { \ + func_type value = func_value; \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + if (is_unsigned && unlikely(value < zero)) \ + goto raise_neg_overflow; \ + else \ + goto raise_overflow; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" + #endif #endif static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -12395,39 +10670,13 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0]) - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -12443,77 +10692,24 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { } #endif if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0]) - case -2: - if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(Py_intptr_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyLong_AsLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -12562,7 +10758,7 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(Py_intptr_t) < sizeof(long)) { @@ -12588,7 +10784,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { @@ -12854,7 +11050,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #endif static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { @@ -12880,7 +11076,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -12897,39 +11093,13 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -12945,77 +11115,24 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { } #endif if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) -(((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) -(((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) -(((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -13063,34 +11180,8 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { return (int) -1; } -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -13107,39 +11198,13 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -13155,77 +11220,24 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } #endif if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) -(((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) -(((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) -(((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -13460,7 +11472,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && @@ -13501,7 +11513,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ #endif } else #endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) +#if !CYTHON_COMPILING_IN_PYPY if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); @@ -13531,7 +11543,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { #else if (PyLong_Check(x)) #endif - return __Pyx_NewRef(x); + return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { @@ -13571,55 +11583,18 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); #endif if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - } - } + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif #endif return PyLong_AsSsize_t(b); } diff --git a/sklearn/tree/_criterion.pxd b/sklearn/tree/_criterion.pxd index 27b97ab044090..92f5f98deeed6 100644 --- a/sklearn/tree/_criterion.pxd +++ b/sklearn/tree/_criterion.pxd @@ -40,6 +40,13 @@ cdef class Criterion: cdef double weighted_n_left # Weighted number of samples in the left node cdef double weighted_n_right # Weighted number of samples in the right node + cdef double* sum_total # For classification criteria, the sum of the + # weighted count of each label. For regression, + # the sum of w*y. sum_total[i] is equal to + # sum_{i=start}^{end-1} w[samples[i]]*y[samples[i]]. + cdef double* sum_left # Same as above, but for the left side of the split + cdef double* sum_right # same as above, but for the right side of the split + # The criterion object is maintained such that left and right collected # statistics correspond to samples[start:pos] and samples[pos:end]. diff --git a/sklearn/tree/_criterion.pyx b/sklearn/tree/_criterion.pyx index 07227d1134519..ed039d02022ca 100644 --- a/sklearn/tree/_criterion.pyx +++ b/sklearn/tree/_criterion.pyx @@ -35,6 +35,19 @@ cdef class Criterion: different metrics. """ + def __dealloc__(self): + """Destructor.""" + + free(self.sum_total) + free(self.sum_left) + free(self.sum_right) + + def __getstate__(self): + return {} + + def __setstate__(self, d): + pass + cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, double weighted_n_samples, SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: @@ -185,18 +198,17 @@ cdef class Criterion: self.children_impurity(&impurity_left, &impurity_right) return ((self.weighted_n_node_samples / self.weighted_n_samples) * - (impurity - self.weighted_n_right / self.weighted_n_node_samples * impurity_right - - self.weighted_n_left / self.weighted_n_node_samples * impurity_left)) + (impurity - (self.weighted_n_right / + self.weighted_n_node_samples * impurity_right) + - (self.weighted_n_left / + self.weighted_n_node_samples * impurity_left))) cdef class ClassificationCriterion(Criterion): """Abstract criterion for classification.""" cdef SIZE_t* n_classes - cdef SIZE_t label_count_stride - cdef double* label_count_left - cdef double* label_count_right - cdef double* label_count_total + cdef SIZE_t sum_stride def __cinit__(self, SIZE_t n_outputs, np.ndarray[SIZE_t, ndim=1] n_classes): @@ -226,43 +238,40 @@ cdef class ClassificationCriterion(Criterion): self.weighted_n_right = 0.0 # Count labels for each output - self.label_count_left = NULL - self.label_count_right = NULL - self.label_count_total = NULL + self.sum_total = NULL + self.sum_left = NULL + self.sum_right = NULL self.n_classes = NULL safe_realloc(&self.n_classes, n_outputs) cdef SIZE_t k = 0 - cdef SIZE_t label_count_stride = 0 + cdef SIZE_t sum_stride = 0 # For each target, set the number of unique classes in that target, # and also compute the maximal stride of all targets for k in range(n_outputs): self.n_classes[k] = n_classes[k] - if n_classes[k] > label_count_stride: - label_count_stride = n_classes[k] + if n_classes[k] > sum_stride: + sum_stride = n_classes[k] - self.label_count_stride = label_count_stride + self.sum_stride = sum_stride - cdef SIZE_t n_elements = n_outputs * label_count_stride - self.label_count_left = calloc(n_elements, sizeof(double)) - self.label_count_right = calloc(n_elements, sizeof(double)) - self.label_count_total = calloc(n_elements, sizeof(double)) + cdef SIZE_t n_elements = n_outputs * sum_stride + self.sum_total = calloc(n_elements, sizeof(double)) + self.sum_left = calloc(n_elements, sizeof(double)) + self.sum_right = calloc(n_elements, sizeof(double)) - if (self.label_count_left == NULL or - self.label_count_right == NULL or - self.label_count_total == NULL): + if (self.sum_total == NULL or + self.sum_left == NULL or + self.sum_right == NULL): raise MemoryError() def __dealloc__(self): """Destructor.""" free(self.n_classes) - free(self.label_count_left) - free(self.label_count_right) - free(self.label_count_total) def __reduce__(self): return (ClassificationCriterion, @@ -270,12 +279,6 @@ cdef class ClassificationCriterion(Criterion): sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), self.__getstate__()) - def __getstate__(self): - return {} - - def __setstate__(self, d): - pass - cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, double weighted_n_samples, SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: @@ -309,24 +312,21 @@ cdef class ClassificationCriterion(Criterion): self.end = end self.n_node_samples = end - start self.weighted_n_samples = weighted_n_samples - cdef double weighted_n_node_samples = 0.0 + self.weighted_n_node_samples = 0.0 - cdef SIZE_t n_outputs = self.n_outputs cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_total = self.label_count_total + cdef double* sum_total = self.sum_total - cdef SIZE_t i = 0 - cdef SIZE_t p = 0 - cdef SIZE_t k = 0 - cdef SIZE_t c = 0 + cdef SIZE_t i + cdef SIZE_t p + cdef SIZE_t k + cdef SIZE_t c cdef DOUBLE_t w = 1.0 cdef SIZE_t offset = 0 - for k in range(n_outputs): - memset(label_count_total + offset, 0, - n_classes[k] * sizeof(double)) - offset += label_count_stride + for k in range(self.n_outputs): + memset(sum_total + offset, 0, n_classes[k] * sizeof(double)) + offset += self.sum_stride for p in range(start, end): i = samples[p] @@ -337,13 +337,11 @@ cdef class ClassificationCriterion(Criterion): w = sample_weight[i] # Count weighted class frequency for each target - for k in range(n_outputs): + for k in range(self.n_outputs): c = y[i * y_stride + k] - label_count_total[k * label_count_stride + c] += w + sum_total[k * self.sum_stride + c] += w - weighted_n_node_samples += w - - self.weighted_n_node_samples = weighted_n_node_samples + self.weighted_n_node_samples += w # Reset to pos=start self.reset() @@ -356,23 +354,20 @@ cdef class ClassificationCriterion(Criterion): self.weighted_n_left = 0.0 self.weighted_n_right = self.weighted_n_node_samples - cdef SIZE_t n_outputs = self.n_outputs - cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_total = self.label_count_total - cdef double* label_count_left = self.label_count_left - cdef double* label_count_right = self.label_count_right + cdef double* sum_total = self.sum_total + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right - cdef SIZE_t k = 0 + cdef SIZE_t* n_classes = self.n_classes + cdef SIZE_t k - for k in range(n_outputs): - memset(label_count_left, 0, n_classes[k] * sizeof(double)) - memcpy(label_count_right, label_count_total, - n_classes[k] * sizeof(double)) + for k in range(self.n_outputs): + memset(sum_left, 0, n_classes[k] * sizeof(double)) + memcpy(sum_right, sum_total, n_classes[k] * sizeof(double)) - label_count_total += label_count_stride - label_count_left += label_count_stride - label_count_right += label_count_stride + sum_total += self.sum_stride + sum_left += self.sum_stride + sum_right += self.sum_stride cdef void reverse_reset(self) nogil: """Reset the criterion at pos=end.""" @@ -381,23 +376,20 @@ cdef class ClassificationCriterion(Criterion): self.weighted_n_left = self.weighted_n_node_samples self.weighted_n_right = 0.0 - cdef SIZE_t n_outputs = self.n_outputs - cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_total = self.label_count_total - cdef double* label_count_left = self.label_count_left - cdef double* label_count_right = self.label_count_right + cdef double* sum_total = self.sum_total + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right - cdef SIZE_t k = 0 + cdef SIZE_t* n_classes = self.n_classes + cdef SIZE_t k - for k in range(n_outputs): - memset(label_count_right, 0, n_classes[k] * sizeof(double)) - memcpy(label_count_left, label_count_total, - n_classes[k] * sizeof(double)) + for k in range(self.n_outputs): + memset(sum_right, 0, n_classes[k] * sizeof(double)) + memcpy(sum_left, sum_total, n_classes[k] * sizeof(double)) - label_count_total += label_count_stride - label_count_left += label_count_stride - label_count_right += label_count_stride + sum_total += self.sum_stride + sum_left += self.sum_stride + sum_right += self.sum_stride cdef void update(self, SIZE_t new_pos) nogil: """Updated statistics by moving samples[pos:new_pos] to the left child. @@ -409,34 +401,30 @@ cdef class ClassificationCriterion(Criterion): child to the left child. """ cdef DOUBLE_t* y = self.y - cdef SIZE_t y_stride = self.y_stride - cdef DOUBLE_t* sample_weight = self.sample_weight - - cdef SIZE_t* samples = self.samples cdef SIZE_t pos = self.pos cdef SIZE_t end = self.end - cdef SIZE_t n_outputs = self.n_outputs + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right + cdef double* sum_total = self.sum_total + cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_left = self.label_count_left - cdef double* label_count_right = self.label_count_right - cdef double* label_count_total = self.label_count_total + cdef SIZE_t* samples = self.samples + cdef DOUBLE_t* sample_weight = self.sample_weight - cdef SIZE_t i = 0 - cdef SIZE_t p = 0 - cdef SIZE_t k = 0 - cdef SIZE_t c = 0 - cdef SIZE_t label_index = 0 + cdef SIZE_t i + cdef SIZE_t p + cdef SIZE_t k + cdef SIZE_t c + cdef SIZE_t label_index cdef DOUBLE_t w = 1.0 - cdef DOUBLE_t diff_w = 0.0 # Update statistics up to new_pos # # Given that - # label_count_left[x] + label_count_right[x] = label_count_total[x] - # and that label_count_total is known, we are going to update - # label_count_left from the direction that require the least amount + # sum_left[x] + sum_right[x] = sum_total[x] + # and that sum_total is known, we are going to update + # sum_left from the direction that require the least amount # of computations, i.e. from pos to new_pos or from end to new_po. if (new_pos - pos) <= (end - new_pos): @@ -446,12 +434,12 @@ cdef class ClassificationCriterion(Criterion): if sample_weight != NULL: w = sample_weight[i] - for k in range(n_outputs): - label_index = (k * label_count_stride + - y[i * y_stride + k]) - label_count_left[label_index] += w + for k in range(self.n_outputs): + label_index = (k * self.sum_stride + + y[i * self.y_stride + k]) + sum_left[label_index] += w - diff_w += w + self.weighted_n_left += w else: self.reverse_reset() @@ -462,26 +450,22 @@ cdef class ClassificationCriterion(Criterion): if sample_weight != NULL: w = sample_weight[i] - for k in range(n_outputs): - label_index = (k * label_count_stride + - y[i * y_stride + k]) - label_count_left[label_index] -= w - - diff_w -= w + for k in range(self.n_outputs): + label_index = (k * self.sum_stride + + y[i * self.y_stride + k]) + sum_left[label_index] -= w - self.weighted_n_left += diff_w + self.weighted_n_left -= w # Upate right part statistics - for k in range(n_outputs): + self.weighted_n_right = self.weighted_n_samples - self.weigted_n_left + for k in range(self.n_outputs): for c in range(n_classes[k]): - label_count_right[c] = (label_count_total[c] - - label_count_left[c]) + sum_right[c] = sum_total[c] - sum_left[c] - label_count_right += label_count_stride - label_count_left += label_count_stride - label_count_total += label_count_stride - - self.weighted_n_right -= diff_w + sum_right += self.sum_stride + sum_left += self.sum_stride + sum_total += self.sum_stride self.pos = new_pos @@ -501,16 +485,14 @@ cdef class ClassificationCriterion(Criterion): The memory address which we will save the node value into. """ - cdef SIZE_t n_outputs = self.n_outputs + cdef double* sum_total = self.sum_total cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_total = self.label_count_total cdef SIZE_t k - for k in range(n_outputs): - memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) - dest += label_count_stride - label_count_total += label_count_stride + for k in range(self.n_outputs): + memcpy(dest, sum_total, n_classes[k] * sizeof(double)) + dest += self.sum_stride + sum_total += self.sum_stride cdef class Entropy(ClassificationCriterion): @@ -533,32 +515,23 @@ cdef class Entropy(ClassificationCriterion): """Evaluate the impurity of the current node, i.e. the impurity of samples[start:end], using the cross-entropy criterion.""" - cdef double weighted_n_node_samples = self.weighted_n_node_samples - - cdef SIZE_t n_outputs = self.n_outputs cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_total = self.label_count_total - + cdef double* sum_total = self.sum_total cdef double entropy = 0.0 - cdef double total_entropy = 0.0 cdef double count_k cdef SIZE_t k cdef SIZE_t c - for k in range(n_outputs): - entropy = 0.0 - + for k in range(self.n_outputs): for c in range(n_classes[k]): - count_k = label_count_total[c] + count_k = sum_total[c] if count_k > 0.0: - count_k /= weighted_n_node_samples + count_k /= self.weighted_n_node_samples entropy -= count_k * log(count_k) - total_entropy += entropy - label_count_total += label_count_stride + sum_total += self.sum_stride - return total_entropy / n_outputs + return entropy / self.n_outputs cdef void children_impurity(self, double* impurity_left, double* impurity_right) nogil: @@ -575,46 +548,32 @@ cdef class Entropy(ClassificationCriterion): The memory address to save the impurity of the right node """ - cdef double weighted_n_node_samples = self.weighted_n_node_samples - cdef double weighted_n_left = self.weighted_n_left - cdef double weighted_n_right = self.weighted_n_right - - cdef SIZE_t n_outputs = self.n_outputs cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_left = self.label_count_left - cdef double* label_count_right = self.label_count_right - + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right cdef double entropy_left = 0.0 cdef double entropy_right = 0.0 - cdef double total_left = 0.0 - cdef double total_right = 0.0 cdef double count_k cdef SIZE_t k cdef SIZE_t c - for k in range(n_outputs): - entropy_left = 0.0 - entropy_right = 0.0 - + for k in range(self.n_outputs): for c in range(n_classes[k]): - count_k = label_count_left[c] + count_k = sum_left[c] if count_k > 0.0: - count_k /= weighted_n_left + count_k /= self.weighted_n_left entropy_left -= count_k * log(count_k) - count_k = label_count_right[c] + count_k = sum_right[c] if count_k > 0.0: - count_k /= weighted_n_right + count_k /= self.weighted_n_right entropy_right -= count_k * log(count_k) - total_left += entropy_left - total_right += entropy_right - label_count_left += label_count_stride - label_count_right += label_count_stride + sum_left += self.sum_stride + sum_right += self.sum_stride - impurity_left[0] = total_left / n_outputs - impurity_right[0] = total_right / n_outputs + impurity_left[0] = entropy_left / self.n_outputs + impurity_right[0] = entropy_right / self.n_outputs cdef class Gini(ClassificationCriterion): @@ -638,33 +597,28 @@ cdef class Gini(ClassificationCriterion): """Evaluate the impurity of the current node, i.e. the impurity of samples[start:end] using the Gini criterion.""" - cdef double weighted_n_node_samples = self.weighted_n_node_samples - cdef SIZE_t n_outputs = self.n_outputs cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_total = self.label_count_total - + cdef double* sum_total = self.sum_total cdef double gini = 0.0 - cdef double total = 0.0 + cdef double sq_count cdef double count_k cdef SIZE_t k cdef SIZE_t c - for k in range(n_outputs): - gini = 0.0 + for k in range(self.n_outputs): + sq_count = 0.0 for c in range(n_classes[k]): - count_k = label_count_total[c] - gini += count_k * count_k + count_k = sum_total[c] + sq_count += count_k * count_k - gini = 1.0 - gini / (weighted_n_node_samples * - weighted_n_node_samples) + gini += 1.0 - sq_count / (self.weighted_n_node_samples * + self.weighted_n_node_samples) - total += gini - label_count_total += label_count_stride + sum_total += self.sum_stride - return total / n_outputs + return gini / self.n_outputs cdef void children_impurity(self, double* impurity_left, double* impurity_right) nogil: @@ -681,49 +635,39 @@ cdef class Gini(ClassificationCriterion): The memory address to save the impurity of the right node to """ - cdef double weighted_n_node_samples = self.weighted_n_node_samples - cdef double weighted_n_left = self.weighted_n_left - cdef double weighted_n_right = self.weighted_n_right - - cdef SIZE_t n_outputs = self.n_outputs cdef SIZE_t* n_classes = self.n_classes - cdef SIZE_t label_count_stride = self.label_count_stride - cdef double* label_count_left = self.label_count_left - cdef double* label_count_right = self.label_count_right - + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right cdef double gini_left = 0.0 cdef double gini_right = 0.0 - cdef double total = 0.0 - cdef double total_left = 0.0 - cdef double total_right = 0.0 + cdef double sq_count_left + cdef double sq_count_right cdef double count_k cdef SIZE_t k cdef SIZE_t c - for k in range(n_outputs): - gini_left = 0.0 - gini_right = 0.0 + for k in range(self.n_outputs): + sq_count_left = 0.0 + sq_count_right = 0.0 for c in range(n_classes[k]): - count_k = label_count_left[c] - gini_left += count_k * count_k + count_k = sum_left[c] + sq_count_left += count_k * count_k - count_k = label_count_right[c] - gini_right += count_k * count_k + count_k = sum_right[c] + sq_count_right += count_k * count_k - gini_left = 1.0 - gini_left / (weighted_n_left * - weighted_n_left) + gini_left += 1.0 - sq_count_left / (self.weighted_n_left * + self.weighted_n_left) - gini_right = 1.0 - gini_right / (weighted_n_right * - weighted_n_right) + gini_right += 1.0 - sq_count_right / (self.weighted_n_right * + self.weighted_n_right) - total_left += gini_left - total_right += gini_right - label_count_left += label_count_stride - label_count_right += label_count_stride + sum_left += self.sum_stride + sum_right += self.sum_stride - impurity_left[0] = total_left / n_outputs - impurity_right[0] = total_right / n_outputs + impurity_left[0] = gini_left / self.n_outputs + impurity_right[0] = gini_right / self.n_outputs cdef class RegressionCriterion(Criterion): @@ -738,11 +682,7 @@ cdef class RegressionCriterion(Criterion): = (\sum_i^n y_i ** 2) - n_samples * y_bar ** 2 """ - cdef double* sq_sum_tmp - cdef double* sq_sum_total - cdef double* sum_left - cdef double* sum_right - cdef double* sum_total + cdef double sq_sum_total def __cinit__(self, SIZE_t n_outputs): """Initialize parameters for this criterion. @@ -769,45 +709,27 @@ cdef class RegressionCriterion(Criterion): self.weighted_n_left = 0.0 self.weighted_n_right = 0.0 + self.sq_sum_total = 0.0 + # Allocate accumulators. Make sure they are NULL, not uninitialized, # before an exception can be raised (which triggers __dealloc__). - self.sq_sum_tmp = NULL - self.sq_sum_total = NULL + self.sum_total = NULL self.sum_left = NULL self.sum_right = NULL - self.sum_total = NULL # Allocate memory for the accumulators - self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) - self.sq_sum_total = calloc(n_outputs, sizeof(double)) + self.sum_total = calloc(n_outputs, sizeof(double)) self.sum_left = calloc(n_outputs, sizeof(double)) self.sum_right = calloc(n_outputs, sizeof(double)) - self.sum_total = calloc(n_outputs, sizeof(double)) - if (self.sq_sum_tmp == NULL or - self.sq_sum_total == NULL or + if (self.sum_total == NULL or self.sum_left == NULL or - self.sum_right == NULL or - self.sum_total == NULL): + self.sum_right == NULL): raise MemoryError() - def __dealloc__(self): - """Destructor""" - free(self.sq_sum_tmp) - free(self.sq_sum_total) - free(self.sum_left) - free(self.sum_right) - free(self.sum_total) - def __reduce__(self): return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) - def __getstate__(self): - return {} - - def __setstate__(self, d): - pass - cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, double weighted_n_samples, SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: @@ -822,23 +744,17 @@ cdef class RegressionCriterion(Criterion): self.end = end self.n_node_samples = end - start self.weighted_n_samples = weighted_n_samples - cdef double weighted_n_node_samples = 0. + self.weighted_n_node_samples = 0. - # Initialize accumulators - cdef SIZE_t n_outputs = self.n_outputs - cdef double* sq_sum_total = self.sq_sum_total - cdef double* sum_total = self.sum_total - - cdef SIZE_t i = 0 - cdef SIZE_t p = 0 - cdef SIZE_t k = 0 - cdef DOUBLE_t y_ik = 0.0 - cdef DOUBLE_t w_y_ik = 0.0 + cdef SIZE_t i + cdef SIZE_t p + cdef SIZE_t k + cdef DOUBLE_t y_ik + cdef DOUBLE_t w_y_ik cdef DOUBLE_t w = 1.0 - cdef SIZE_t n_bytes = n_outputs * sizeof(double) - memset(sq_sum_total, 0, n_bytes) - memset(sum_total, 0, n_bytes) + self.sq_sum_total = 0.0 + memset(self.sum_total, 0, self.n_outputs * sizeof(double)) for p in range(start, end): i = samples[p] @@ -846,15 +762,13 @@ cdef class RegressionCriterion(Criterion): if sample_weight != NULL: w = sample_weight[i] - for k in range(n_outputs): + for k in range(self.n_outputs): y_ik = y[i * y_stride + k] w_y_ik = w * y_ik - sum_total[k] += w_y_ik - sq_sum_total[k] += w_y_ik * y_ik + self.sum_total[k] += w_y_ik + self.sq_sum_total += w_y_ik * y_ik - weighted_n_node_samples += w - - self.weighted_n_node_samples = weighted_n_node_samples + self.weighted_n_node_samples += w # Reset to pos=start self.reset() @@ -882,31 +796,28 @@ cdef class RegressionCriterion(Criterion): cdef void update(self, SIZE_t new_pos) nogil: """Updated statistics by moving samples[pos:new_pos] to the left.""" - cdef DOUBLE_t* y = self.y - cdef SIZE_t y_stride = self.y_stride - cdef DOUBLE_t* sample_weight = self.sample_weight - - cdef SIZE_t* samples = self.samples - cdef SIZE_t pos = self.pos - cdef SIZE_t end = self.end - - cdef SIZE_t n_outputs = self.n_outputs cdef double* sum_left = self.sum_left cdef double* sum_right = self.sum_right cdef double* sum_total = self.sum_total - cdef SIZE_t i = 0 - cdef SIZE_t p = 0 - cdef SIZE_t k = 0 + cdef double* sample_weight = self.sample_weight + cdef SIZE_t* samples = self.samples + + cdef DOUBLE_t* y = self.y + cdef SIZE_t pos = self.pos + cdef SIZE_t end = self.end + cdef SIZE_t i + cdef SIZE_t p + cdef SIZE_t k cdef DOUBLE_t w = 1.0 - cdef DOUBLE_t diff_w = 0.0 + cdef DOUBLE_t y_ik # Update statistics up to new_pos # # Given that # sum_left[x] + sum_right[x] = sum_total[x] # and that sum_total is known, we are going to update - # label_count_left from the direction that require the least amount + # sum_left from the direction that require the least amount # of computations, i.e. from pos to new_pos or from end to new_po. if (new_pos - pos) <= (end - new_pos): @@ -916,10 +827,11 @@ cdef class RegressionCriterion(Criterion): if sample_weight != NULL: w = sample_weight[i] - for k in range(n_outputs): - sum_left[k] += w * y[i * y_stride + k] + for k in range(self.n_outputs): + y_ik = y[i * self.y_stride + k] + sum_left[k] += w * y_ik - diff_w += w + self.weighted_n_left += w else: self.reverse_reset() @@ -929,17 +841,17 @@ cdef class RegressionCriterion(Criterion): if sample_weight != NULL: w = sample_weight[i] - for k in range(n_outputs): - sum_left[k] -= w * y[i * y_stride + k] + for k in range(self.n_outputs): + y_ik = y[i * self.y_stride + k] + sum_left[k] -= w * y_ik - diff_w -= w + self.weighted_n_left -= w - for k in range(n_outputs): + self.weighted_n_right = (self.weighted_n_node_samples - + self.weighted_n_left) + for k in range(self.n_outputs): sum_right[k] = sum_total[k] - sum_left[k] - self.weighted_n_left += diff_w - self.weighted_n_right -= diff_w - self.pos = new_pos cdef double node_impurity(self) nogil: @@ -951,13 +863,11 @@ cdef class RegressionCriterion(Criterion): cdef void node_value(self, double* dest) nogil: """Compute the node value of samples[start:end] into dest.""" - cdef SIZE_t n_outputs = self.n_outputs - cdef double* sum_total = self.sum_total - cdef double weighted_n_node_samples = self.weighted_n_node_samples - cdef SIZE_t k = 0 - for k in range(n_outputs): - dest[k] = sum_total[k] / weighted_n_node_samples + cdef SIZE_t k + + for k in range(self.n_outputs): + dest[k] = self.sum_total[k] / self.weighted_n_node_samples cdef class MSE(RegressionCriterion): @@ -968,20 +878,16 @@ cdef class MSE(RegressionCriterion): cdef double node_impurity(self) nogil: """Evaluate the impurity of the current node, i.e. the impurity of samples[start:end].""" - cdef SIZE_t n_outputs = self.n_outputs - cdef double* sq_sum_total = self.sq_sum_total + cdef double* sum_total = self.sum_total - cdef double weighted_n_node_samples = self.weighted_n_node_samples - cdef double mean_total_k = 0. - cdef double total = 0.0 - cdef SIZE_t k = 0 + cdef double impurity + cdef SIZE_t k - for k in range(n_outputs): - mean_total_k = sum_total[k] / weighted_n_node_samples - total += (sq_sum_total[k] / weighted_n_node_samples - - mean_total_k * mean_total_k) + impurity = self.sq_sum_total / self.weighted_n_node_samples + for k in range(self.n_outputs): + impurity -= (sum_total[k] / self.weighted_n_node_samples)**2.0 - return total / n_outputs + return impurity / self.n_outputs cdef double proxy_impurity_improvement(self) nogil: """Compute a proxy of the impurity reduction @@ -994,24 +900,20 @@ cdef class MSE(RegressionCriterion): The absolute impurity improvement is only computed by the impurity_improvement method once the best split has been found. """ - cdef SIZE_t n_outputs = self.n_outputs - - cdef double weighted_n_left = self.weighted_n_left - cdef double weighted_n_right = self.weighted_n_right cdef double* sum_left = self.sum_left cdef double* sum_right = self.sum_right - cdef SIZE_t k = 0 - cdef double proxy_impurity_left = 0. - cdef double proxy_impurity_right = 0. + cdef SIZE_t k + cdef double proxy_impurity_left = 0.0 + cdef double proxy_impurity_right = 0.0 - for k in range(n_outputs): + for k in range(self.n_outputs): proxy_impurity_left += sum_left[k] * sum_left[k] proxy_impurity_right += sum_right[k] * sum_right[k] - return (proxy_impurity_left / weighted_n_left + - proxy_impurity_right / weighted_n_right) + return (proxy_impurity_left / self.weighted_n_left + + proxy_impurity_right / self.weighted_n_right) cdef void children_impurity(self, double* impurity_left, double* impurity_right) nogil: @@ -1019,39 +921,25 @@ cdef class MSE(RegressionCriterion): left child (samples[start:pos]) and the impurity the right child (samples[pos:end]).""" + cdef DOUBLE_t* y = self.y - cdef SIZE_t y_stride = self.y_stride cdef DOUBLE_t* sample_weight = self.sample_weight - cdef SIZE_t* samples = self.samples cdef SIZE_t pos = self.pos cdef SIZE_t start = self.start - cdef SIZE_t n_outputs = self.n_outputs - cdef double* sum_left = self.sum_left cdef double* sum_right = self.sum_right - cdef double* sq_sum_tmp = self.sq_sum_tmp - cdef double* sq_sum_total = self.sq_sum_total - cdef double weighted_n_left = self.weighted_n_left - cdef double weighted_n_right = self.weighted_n_right - - cdef double total_left = 0.0 - cdef double total_right = 0.0 - cdef double mean_left_k = 0.0 - cdef double mean_right_k = 0.0 - - cdef SIZE_t i = 0 - cdef SIZE_t p = 0 - cdef SIZE_t k = 0 + + cdef double sq_sum_left = 0.0 + cdef double sq_sum_right + + cdef SIZE_t i + cdef SIZE_t p + cdef SIZE_t k cdef DOUBLE_t w = 1.0 - cdef DOUBLE_t diff_w = 0.0 cdef DOUBLE_t y_ik - # Compute squared sum - cdef SIZE_t n_bytes = n_outputs * sizeof(double) - memset(sq_sum_tmp, 0, n_bytes) - for p in range(start, pos): i = samples[p] @@ -1060,20 +948,19 @@ cdef class MSE(RegressionCriterion): for k in range(n_outputs): y_ik = y[i * y_stride + k] - sq_sum_tmp[k] += w * y_ik * y_ik + sq_sum_left += w * y_ik * y_ik - # Compute impurity - for k in range(n_outputs): - mean_left_k = sum_left[k] / weighted_n_left - total_left += (sq_sum_tmp[k] / weighted_n_left - - mean_left_k * mean_left_k) + sq_sum_right = self.sq_sum_total - sq_sum_left + + impurity_left[0] = self.sq_sum_left / self.weighted_n_left + impurity_right[0] = self.sq_sum_right / self.weighted_n_right - mean_right_k = sum_right[k] / weighted_n_right - total_right += ((sq_sum_total[k] - sq_sum_tmp[k]) / weighted_n_right - - mean_right_k * mean_right_k) + for k in range(self.n_outputs): + impurity_left[0] -= sum_left[k] / weighted_n_left + impurity_right[0] -= sum_right[k] / weighted_n_right - impurity_left[0] = total_left / n_outputs - impurity_right[0] = total_right / n_outputs + impurity_left[0] /= self.n_outputs + impurity_right[0] /= self.n_outputs cdef class FriedmanMSE(MSE): @@ -1096,45 +983,42 @@ cdef class FriedmanMSE(MSE): The absolute impurity improvement is only computed by the impurity_improvement method once the best split has been found. """ - cdef SIZE_t n_outputs = self.n_outputs + cdef double* sum_left = self.sum_left cdef double* sum_right = self.sum_right - cdef double weighted_n_left = self.weighted_n_left - cdef double weighted_n_right = self.weighted_n_right + cdef double total_sum_left = 0.0 cdef double total_sum_right = 0.0 - cdef SIZE_t k = 0 + cdef SIZE_t k cdef double diff = 0.0 - for k in range(n_outputs): + for k in range(self.n_outputs): total_sum_left += sum_left[k] total_sum_right += sum_right[k] - diff = (weighted_n_right * total_sum_left - - weighted_n_left * total_sum_right) + diff = (self.weighted_n_right * total_sum_left - + self.weighted_n_left * total_sum_right) - return diff * diff / (weighted_n_left * weighted_n_right) + return diff * diff / (self.weighted_n_left * self.weighted_n_right) cdef double impurity_improvement(self, double impurity) nogil: - cdef SIZE_t n_outputs = self.n_outputs cdef double* sum_left = self.sum_left cdef double* sum_right = self.sum_right - cdef double weighted_n_left = self.weighted_n_left - cdef double weighted_n_right = self.weighted_n_right - cdef double weighted_n_node_samples = self.weighted_n_node_samples + cdef double total_sum_left = 0.0 cdef double total_sum_right = 0.0 - cdef SIZE_t k = 0 + cdef SIZE_t k cdef double diff = 0.0 - for k in range(n_outputs): + for k in range(self.n_outputs): total_sum_left += sum_left[k] total_sum_right += sum_right[k] - diff = (weighted_n_right * total_sum_left - - weighted_n_left * total_sum_right) / n_outputs + diff = (self.weighted_n_right * total_sum_left - + self.weighted_n_left * total_sum_right) / self.n_outputs - return (diff * diff / - (weighted_n_left * weighted_n_right * weighted_n_node_samples)) \ No newline at end of file + return (diff * diff / (self.weighted_n_left * self.weighted_n_right * + self.weighted_n_node_samples)) + \ No newline at end of file diff --git a/sklearn/tree/_splitter.c b/sklearn/tree/_splitter.c index a22868f38aa8d..da3bbbef40e65 100644 --- a/sklearn/tree/_splitter.c +++ b/sklearn/tree/_splitter.c @@ -1,13 +1,25 @@ -/* Generated by Cython 0.23 */ +/* Generated by Cython 0.22.1 */ #define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_23" +#define CYTHON_ABI "0_22_1" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -42,9 +54,6 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 -#define CYTHON_USE_PYLONG_INTERNALS 1 -#endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif @@ -52,12 +61,12 @@ #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif @@ -75,7 +84,7 @@ #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -94,10 +103,12 @@ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) + #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) + #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) @@ -165,32 +176,6 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) - #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ @@ -202,20 +187,46 @@ typedef struct { #define CYTHON_INLINE #endif #endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif #endif -#include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif +#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(T& ref) : ptr(&ref) { } + T *operator->() { return ptr; } + operator T&() { return *ptr; } + private: + T *ptr; +}; +#endif #if PY_MAJOR_VERSION >= 3 @@ -234,6 +245,10 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #endif +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include #define __PYX_HAVE__sklearn__tree___splitter #define __PYX_HAVE_API__sklearn__tree___splitter #include "string.h" @@ -277,34 +292,16 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) @@ -339,9 +336,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); @@ -513,7 +509,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -522,7 +518,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -531,7 +527,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -540,7 +536,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":729 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -549,7 +545,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -558,7 +554,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -567,7 +563,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -576,7 +572,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":736 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -585,7 +581,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -594,7 +590,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":741 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -603,7 +599,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -612,7 +608,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -621,7 +617,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -630,7 +626,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -639,7 +635,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -648,7 +644,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -657,7 +653,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -666,7 +662,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -675,7 +671,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -684,7 +680,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -693,7 +689,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -702,7 +698,7 @@ typedef npy_double __pyx_t_5numpy_double_t; */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* "_criterion.pxd":15 +/* "sklearn/tree/_criterion.pxd":15 * cimport numpy as np * * ctypedef np.npy_float32 DTYPE_t # Type of X # <<<<<<<<<<<<<< @@ -711,7 +707,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; */ typedef npy_float32 __pyx_t_7sklearn_4tree_10_criterion_DTYPE_t; -/* "_criterion.pxd":16 +/* "sklearn/tree/_criterion.pxd":16 * * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight # <<<<<<<<<<<<<< @@ -720,7 +716,7 @@ typedef npy_float32 __pyx_t_7sklearn_4tree_10_criterion_DTYPE_t; */ typedef npy_float64 __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t; -/* "_criterion.pxd":17 +/* "sklearn/tree/_criterion.pxd":17 * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters # <<<<<<<<<<<<<< @@ -729,7 +725,7 @@ typedef npy_float64 __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t; */ typedef npy_intp __pyx_t_7sklearn_4tree_10_criterion_SIZE_t; -/* "_criterion.pxd":18 +/* "sklearn/tree/_criterion.pxd":18 * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer # <<<<<<<<<<<<<< @@ -738,7 +734,7 @@ typedef npy_intp __pyx_t_7sklearn_4tree_10_criterion_SIZE_t; */ typedef npy_int32 __pyx_t_7sklearn_4tree_10_criterion_INT32_t; -/* "_criterion.pxd":19 +/* "sklearn/tree/_criterion.pxd":19 * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer # <<<<<<<<<<<<<< @@ -747,7 +743,7 @@ typedef npy_int32 __pyx_t_7sklearn_4tree_10_criterion_INT32_t; */ typedef npy_uint32 __pyx_t_7sklearn_4tree_10_criterion_UINT32_t; -/* "_utils.pxd":13 +/* "sklearn/tree/_utils.pxd":13 * cimport numpy as np * * ctypedef np.npy_float32 DTYPE_t # Type of X # <<<<<<<<<<<<<< @@ -756,7 +752,7 @@ typedef npy_uint32 __pyx_t_7sklearn_4tree_10_criterion_UINT32_t; */ typedef npy_float32 __pyx_t_7sklearn_4tree_6_utils_DTYPE_t; -/* "_utils.pxd":14 +/* "sklearn/tree/_utils.pxd":14 * * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight # <<<<<<<<<<<<<< @@ -765,7 +761,7 @@ typedef npy_float32 __pyx_t_7sklearn_4tree_6_utils_DTYPE_t; */ typedef npy_float64 __pyx_t_7sklearn_4tree_6_utils_DOUBLE_t; -/* "_utils.pxd":15 +/* "sklearn/tree/_utils.pxd":15 * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters # <<<<<<<<<<<<<< @@ -774,7 +770,7 @@ typedef npy_float64 __pyx_t_7sklearn_4tree_6_utils_DOUBLE_t; */ typedef npy_intp __pyx_t_7sklearn_4tree_6_utils_SIZE_t; -/* "_utils.pxd":16 +/* "sklearn/tree/_utils.pxd":16 * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer # <<<<<<<<<<<<<< @@ -783,7 +779,7 @@ typedef npy_intp __pyx_t_7sklearn_4tree_6_utils_SIZE_t; */ typedef npy_int32 __pyx_t_7sklearn_4tree_6_utils_INT32_t; -/* "_utils.pxd":17 +/* "sklearn/tree/_utils.pxd":17 * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer # <<<<<<<<<<<<<< @@ -791,14 +787,6 @@ typedef npy_int32 __pyx_t_7sklearn_4tree_6_utils_INT32_t; * cdef enum: */ typedef npy_uint32 __pyx_t_7sklearn_4tree_6_utils_UINT32_t; - -/* "sklearn/tree/_splitter.pxd":17 - * from ._criterion cimport Criterion - * - * ctypedef np.npy_float32 DTYPE_t # Type of X # <<<<<<<<<<<<<< - * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight - * ctypedef np.npy_intp SIZE_t # Type for indices and counters - */ typedef npy_float32 __pyx_t_7sklearn_4tree_9_splitter_DTYPE_t; /* "sklearn/tree/_splitter.pxd":18 @@ -870,7 +858,7 @@ struct __pyx_obj_7sklearn_4tree_9_splitter_BaseSparseSplitter; struct __pyx_obj_7sklearn_4tree_9_splitter_BestSparseSplitter; struct __pyx_obj_7sklearn_4tree_9_splitter_RandomSparseSplitter; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -879,7 +867,7 @@ struct __pyx_obj_7sklearn_4tree_9_splitter_RandomSparseSplitter; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -888,7 +876,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -897,7 +885,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -908,7 +896,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_t_7sklearn_4tree_6_utils_StackRecord; struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord; -/* "_utils.pxd":19 +/* "sklearn/tree/_utils.pxd":19 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef enum: # <<<<<<<<<<<<<< @@ -919,7 +907,7 @@ enum { __pyx_e_7sklearn_4tree_6_utils_RAND_R_MAX = 0x7FFFFFFF }; -/* "_utils.pxd":58 +/* "sklearn/tree/_utils.pxd":58 * * # A record on the stack for depth-first tree growing * cdef struct StackRecord: # <<<<<<<<<<<<<< @@ -936,7 +924,7 @@ struct __pyx_t_7sklearn_4tree_6_utils_StackRecord { __pyx_t_7sklearn_4tree_6_utils_SIZE_t n_constant_features; }; -/* "_utils.pxd":84 +/* "sklearn/tree/_utils.pxd":84 * * # A record on the frontier for best-first tree growing * cdef struct PriorityHeapRecord: # <<<<<<<<<<<<<< @@ -973,7 +961,7 @@ struct __pyx_t_7sklearn_4tree_9_splitter_SplitRecord { double impurity_right; }; -/* "_criterion.pxd":21 +/* "sklearn/tree/_criterion.pxd":21 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef class Criterion: # <<<<<<<<<<<<<< @@ -996,10 +984,16 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion { double weighted_n_node_samples; double weighted_n_left; double weighted_n_right; + double *node_sum; + double *node_sum_left; + double *node_sum_right; + double yw_sq_sum; + double yw_sq_sum_left; + double yw_sq_sum_right; }; -/* "_utils.pxd":67 +/* "sklearn/tree/_utils.pxd":67 * SIZE_t n_constant_features * * cdef class Stack: # <<<<<<<<<<<<<< @@ -1015,7 +1009,7 @@ struct __pyx_obj_7sklearn_4tree_6_utils_Stack { }; -/* "_utils.pxd":96 +/* "sklearn/tree/_utils.pxd":96 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -1162,7 +1156,7 @@ struct __pyx_obj_7sklearn_4tree_9_splitter_RandomSparseSplitter { -/* "_criterion.pxd":21 +/* "sklearn/tree/_criterion.pxd":21 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef class Criterion: # <<<<<<<<<<<<<< @@ -1184,7 +1178,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion { static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *__pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion; -/* "_utils.pxd":67 +/* "sklearn/tree/_utils.pxd":67 * SIZE_t n_constant_features * * cdef class Stack: # <<<<<<<<<<<<<< @@ -1200,7 +1194,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack { static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7sklearn_4tree_6_utils_Stack; -/* "_utils.pxd":96 +/* "sklearn/tree/_utils.pxd":96 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -1352,19 +1346,19 @@ static struct __pyx_vtabstruct_7sklearn_4tree_9_splitter_RandomSparseSplitter *_ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ } #else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif - #define __Pyx_RefNannyFinishContext()\ + #define __Pyx_RefNannyFinishContext() \ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) @@ -1387,13 +1381,13 @@ static struct __pyx_vtabstruct_7sklearn_4tree_9_splitter_RandomSparseSplitter *_ #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) @@ -1420,8 +1414,8 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, @@ -1437,20 +1431,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); @@ -1509,8 +1503,6 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable); static void* __Pyx_GetVtable(PyObject *dict); -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { @@ -1530,6 +1522,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + typedef struct { Py_ssize_t shape, strides, suboffsets; } __Pyx_Buf_DimInfo; @@ -1669,8 +1663,6 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); @@ -1709,21 +1701,19 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( /* Module declarations from 'cpython.buffer' */ +/* Module declarations from 'cpython.ref' */ + /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ +/* Module declarations from 'cpython.object' */ + /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'numpy' */ @@ -1783,6 +1773,39 @@ int __pyx_module_is_main_sklearn__tree___splitter = 0; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; +static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, double __pyx_v_min_weight_leaf, PyObject *__pyx_v_random_state); /* proto */ +static void __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_4__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_6__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_9criterion___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_9criterion_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_9criterion_4__del__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_12max_features___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_12max_features_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_16min_samples_leaf___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_16min_samples_leaf_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_15min_weight_leaf___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_15min_weight_leaf_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_17BaseDenseSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_BaseDenseSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_12BestSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_BestSplitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_14RandomSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_RandomSplitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_19PresortBestSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_PresortBestSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ +static void __pyx_pf_7sklearn_4tree_9_splitter_19PresortBestSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_9_splitter_PresortBestSplitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_19PresortBestSplitter_4__reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_PresortBestSplitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_9_splitter_18BaseSparseSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_BaseSparseSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ +static void __pyx_pf_7sklearn_4tree_9_splitter_18BaseSparseSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_9_splitter_BaseSparseSplitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_18BestSparseSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_BestSparseSplitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_20RandomSparseSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_RandomSparseSplitter *__pyx_v_self); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_Splitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BaseDenseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BaseSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BestSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_RandomSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static char __pyx_k_B[] = "B"; static char __pyx_k_H[] = "H"; static char __pyx_k_I[] = "I"; @@ -1874,39 +1897,6 @@ static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_strides; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, double __pyx_v_min_weight_leaf, PyObject *__pyx_v_random_state); /* proto */ -static void __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_4__getstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_6__setstate__(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_d); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_9criterion___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_9criterion_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_9criterion_4__del__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_12max_features___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_12max_features_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_16min_samples_leaf___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_16min_samples_leaf_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_8Splitter_15min_weight_leaf___get__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_8Splitter_15min_weight_leaf_2__set__(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_17BaseDenseSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_BaseDenseSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_12BestSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_BestSplitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_14RandomSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_RandomSplitter *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_19PresortBestSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_PresortBestSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ -static void __pyx_pf_7sklearn_4tree_9_splitter_19PresortBestSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_9_splitter_PresortBestSplitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_19PresortBestSplitter_4__reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_PresortBestSplitter *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_9_splitter_18BaseSparseSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_9_splitter_BaseSparseSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ -static void __pyx_pf_7sklearn_4tree_9_splitter_18BaseSparseSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_9_splitter_BaseSparseSplitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_18BestSparseSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_BestSparseSplitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_20RandomSparseSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_9_splitter_RandomSparseSplitter *__pyx_v_self); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_Splitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BaseDenseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BaseSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_BestSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_9_splitter_RandomSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -2580,15 +2570,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_8Splitter_init(struct __pyx_obj_7s * if sample_weight != NULL: */ __pyx_v_j = (__pyx_v_j + 1); - - /* "sklearn/tree/_splitter.pyx":154 - * for i in range(n_samples): - * # Only work with positively weighted samples - * if sample_weight == NULL or sample_weight[i] != 0.0: # <<<<<<<<<<<<<< - * samples[j] = i - * j += 1 - */ + goto __pyx_L5; } + __pyx_L5:; /* "sklearn/tree/_splitter.pyx":158 * j += 1 @@ -2608,25 +2592,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_8Splitter_init(struct __pyx_obj_7s * weighted_n_samples += 1.0 */ __pyx_v_weighted_n_samples = (__pyx_v_weighted_n_samples + (__pyx_v_sample_weight[__pyx_v_i])); - - /* "sklearn/tree/_splitter.pyx":158 - * j += 1 - * - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * weighted_n_samples += sample_weight[i] - * else: - */ goto __pyx_L8; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":161 + /* "sklearn/tree/_splitter.pyx":161 * weighted_n_samples += sample_weight[i] * else: * weighted_n_samples += 1.0 # <<<<<<<<<<<<<< * * # Number of samples is number of positively weighted samples */ - /*else*/ { __pyx_v_weighted_n_samples = (__pyx_v_weighted_n_samples + 1.0); } __pyx_L8:; @@ -3682,9 +3658,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_12BestSplitter___reduce__(st */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_BestSplitter)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_BestSplitter)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_BestSplitter)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_BestSplitter))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_BestSplitter))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_BestSplitter))); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); @@ -4086,25 +4062,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * else: */ __pyx_v_n_drawn_constants = (__pyx_v_n_drawn_constants + 1); - - /* "sklearn/tree/_splitter.pyx":342 - * random_state) - * - * if f_j < n_known_constants: # <<<<<<<<<<<<<< - * # f_j in the interval [n_drawn_constants, n_known_constants[ - * tmp = features[f_j] - */ goto __pyx_L8; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":352 + /* "sklearn/tree/_splitter.pyx":352 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< * # f_j in the interval [n_total_constants, f_i[ * */ - /*else*/ { __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); /* "sklearn/tree/_splitter.pyx":355 @@ -4192,25 +4160,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * else: */ __pyx_v_n_total_constants = (__pyx_v_n_total_constants + 1); - - /* "sklearn/tree/_splitter.pyx":367 - * sort(Xf + start, samples + start, end - start) - * - * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< - * features[f_j] = features[n_total_constants] - * features[n_total_constants] = current.feature - */ goto __pyx_L11; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":375 + /* "sklearn/tree/_splitter.pyx":375 * * else: * f_i -= 1 # <<<<<<<<<<<<<< * features[f_i], features[f_j] = features[f_j], features[f_i] * */ - /*else*/ { __pyx_v_f_i = (__pyx_v_f_i - 1); /* "sklearn/tree/_splitter.pyx":376 @@ -4343,14 +4303,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ __pyx_t_6 = (((__pyx_v_end - __pyx_v_current.pos) < __pyx_v_min_samples_leaf) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L20_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":397 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ if (__pyx_t_5) { /* "sklearn/tree/_splitter.pyx":399 @@ -4361,14 +4313,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * self.criterion.update(current.pos) */ goto __pyx_L12_continue; - - /* "sklearn/tree/_splitter.pyx":397 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":401 @@ -4404,14 +4348,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ __pyx_t_6 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_right < __pyx_v_min_weight_leaf) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L23_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":404 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ if (__pyx_t_5) { /* "sklearn/tree/_splitter.pyx":406 @@ -4422,14 +4358,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L12_continue; - - /* "sklearn/tree/_splitter.pyx":404 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":408 @@ -4487,15 +4415,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * best = current # copy */ __pyx_v_current.threshold = (__pyx_v_Xf[(__pyx_v_p - 1)]); - - /* "sklearn/tree/_splitter.pyx":414 - * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 - * - * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< - * current.threshold = Xf[p - 1] - * - */ + goto __pyx_L26; } + __pyx_L26:; /* "sklearn/tree/_splitter.pyx":417 * current.threshold = Xf[p - 1] @@ -4505,24 +4427,12 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * # Reorganize into samples[start:best.pos] + samples[best.pos:end] */ __pyx_v_best = __pyx_v_current; - - /* "sklearn/tree/_splitter.pyx":410 - * current_proxy_improvement = self.criterion.proxy_impurity_improvement() - * - * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< - * best_proxy_improvement = current_proxy_improvement - * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 - */ + goto __pyx_L25; } - - /* "sklearn/tree/_splitter.pyx":393 - * # X[samples[p - 1], current.feature]) - * - * if p < end: # <<<<<<<<<<<<<< - * current.pos = p - * - */ + __pyx_L25:; + goto __pyx_L18; } + __pyx_L18:; __pyx_L12_continue:; } } @@ -4578,14 +4488,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * */ __pyx_t_5 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); - - /* "sklearn/tree/_splitter.pyx":425 - * - * while p < partition_end: - * if X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< - * X_fx_stride * best.feature] <= best.threshold: - * p += 1 - */ if (__pyx_t_5) { /* "sklearn/tree/_splitter.pyx":427 @@ -4596,25 +4498,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * else: */ __pyx_v_p = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":425 - * - * while p < partition_end: - * if X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< - * X_fx_stride * best.feature] <= best.threshold: - * p += 1 - */ goto __pyx_L30; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":430 + /* "sklearn/tree/_splitter.pyx":430 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< * * tmp = samples[partition_end] */ - /*else*/ { __pyx_v_partition_end = (__pyx_v_partition_end - 1); /* "sklearn/tree/_splitter.pyx":432 @@ -4682,15 +4576,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_12BestSplitter_node_split(struct _ * */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_best.impurity_left), (&__pyx_v_best.impurity_right)); - - /* "sklearn/tree/_splitter.pyx":420 - * - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: # <<<<<<<<<<<<<< - * partition_end = end - * p = start - */ + goto __pyx_L27; } + __pyx_L27:; /* "sklearn/tree/_splitter.pyx":445 * # element in features[:n_known_constants] must be preserved for sibling @@ -4883,14 +4771,6 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_9_splitter_DTYPE_t __pyx_f_7sklearn_ */ __pyx_r = __pyx_v_b; goto __pyx_L0; - - /* "sklearn/tree/_splitter.pyx":475 - * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] - * if a < b: - * if b < c: # <<<<<<<<<<<<<< - * return b - * elif a < c: - */ } /* "sklearn/tree/_splitter.pyx":477 @@ -4912,35 +4792,19 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_9_splitter_DTYPE_t __pyx_f_7sklearn_ */ __pyx_r = __pyx_v_c; goto __pyx_L0; - - /* "sklearn/tree/_splitter.pyx":477 - * if b < c: - * return b - * elif a < c: # <<<<<<<<<<<<<< - * return c - * else: - */ } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":480 + /* "sklearn/tree/_splitter.pyx":480 * return c * else: * return a # <<<<<<<<<<<<<< * elif b < c: * if a < c: */ - /*else*/ { __pyx_r = __pyx_v_a; goto __pyx_L0; } - - /* "sklearn/tree/_splitter.pyx":474 - * # Engineering a sort function. SP&E. Requires 8/3 comparisons on average. - * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] - * if a < b: # <<<<<<<<<<<<<< - * if b < c: - * return b - */ } /* "sklearn/tree/_splitter.pyx":481 @@ -4972,45 +4836,29 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_9_splitter_DTYPE_t __pyx_f_7sklearn_ */ __pyx_r = __pyx_v_a; goto __pyx_L0; - - /* "sklearn/tree/_splitter.pyx":482 - * return a - * elif b < c: - * if a < c: # <<<<<<<<<<<<<< - * return a - * else: - */ } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":485 + /* "sklearn/tree/_splitter.pyx":485 * return a * else: * return c # <<<<<<<<<<<<<< * else: * return b */ - /*else*/ { __pyx_r = __pyx_v_c; goto __pyx_L0; } - - /* "sklearn/tree/_splitter.pyx":481 - * else: - * return a - * elif b < c: # <<<<<<<<<<<<<< - * if a < c: - * return a - */ } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":487 + /* "sklearn/tree/_splitter.pyx":487 * return c * else: * return b # <<<<<<<<<<<<<< * * */ - /*else*/ { __pyx_r = __pyx_v_b; goto __pyx_L0; } @@ -5081,14 +4929,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_introsort(__pyx_t_7sklearn_4tree_9 * */ goto __pyx_L0; - - /* "sklearn/tree/_splitter.pyx":497 - * - * while n > 1: - * if maxd <= 0: # max depth limit exceeded ("gone quadratic") # <<<<<<<<<<<<<< - * heapsort(Xf, samples, n) - * return - */ } /* "sklearn/tree/_splitter.pyx":500 @@ -5175,14 +5015,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_introsort(__pyx_t_7sklearn_4tree_9 * r -= 1 */ __pyx_v_l = (__pyx_v_l + 1); - - /* "sklearn/tree/_splitter.pyx":508 - * r = n - * while i < r: - * if Xf[i] < pivot: # <<<<<<<<<<<<<< - * swap(Xf, samples, i, l) - * i += 1 - */ goto __pyx_L8; } @@ -5213,25 +5045,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_introsort(__pyx_t_7sklearn_4tree_9 * i += 1 */ __pyx_f_7sklearn_4tree_9_splitter_swap(__pyx_v_Xf, __pyx_v_samples, __pyx_v_i, __pyx_v_r); - - /* "sklearn/tree/_splitter.pyx":512 - * i += 1 - * l += 1 - * elif Xf[i] > pivot: # <<<<<<<<<<<<<< - * r -= 1 - * swap(Xf, samples, i, r) - */ goto __pyx_L8; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":516 + /* "sklearn/tree/_splitter.pyx":516 * swap(Xf, samples, i, r) * else: * i += 1 # <<<<<<<<<<<<<< * * introsort(Xf, samples, l, maxd) */ - /*else*/ { __pyx_v_i = (__pyx_v_i + 1); } __pyx_L8:; @@ -5363,15 +5187,9 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_sift_down(__pyx_t_7s * maxind = child + 1 */ __pyx_v_maxind = __pyx_v_child; - - /* "sklearn/tree/_splitter.pyx":535 - * # find max of root, left child, right child - * maxind = root - * if child < end and Xf[maxind] < Xf[child]: # <<<<<<<<<<<<<< - * maxind = child - * if child + 1 < end and Xf[maxind] < Xf[child + 1]: - */ + goto __pyx_L5; } + __pyx_L5:; /* "sklearn/tree/_splitter.pyx":537 * if child < end and Xf[maxind] < Xf[child]: @@ -5399,15 +5217,9 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_sift_down(__pyx_t_7s * if maxind == root: */ __pyx_v_maxind = (__pyx_v_child + 1); - - /* "sklearn/tree/_splitter.pyx":537 - * if child < end and Xf[maxind] < Xf[child]: - * maxind = child - * if child + 1 < end and Xf[maxind] < Xf[child + 1]: # <<<<<<<<<<<<<< - * maxind = child + 1 - * - */ + goto __pyx_L8; } + __pyx_L8:; /* "sklearn/tree/_splitter.pyx":540 * maxind = child + 1 @@ -5427,24 +5239,16 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_sift_down(__pyx_t_7s * swap(Xf, samples, root, maxind) */ goto __pyx_L4_break; - - /* "sklearn/tree/_splitter.pyx":540 - * maxind = child + 1 - * - * if maxind == root: # <<<<<<<<<<<<<< - * break - * else: - */ } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":543 + /* "sklearn/tree/_splitter.pyx":543 * break * else: * swap(Xf, samples, root, maxind) # <<<<<<<<<<<<<< * root = maxind * */ - /*else*/ { __pyx_f_7sklearn_4tree_9_splitter_swap(__pyx_v_Xf, __pyx_v_samples, __pyx_v_root, __pyx_v_maxind); /* "sklearn/tree/_splitter.pyx":544 @@ -5537,14 +5341,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_heapsort(__pyx_t_7sklearn_4tree_9_ * */ goto __pyx_L4_break; - - /* "sklearn/tree/_splitter.pyx":555 - * while True: - * sift_down(Xf, samples, start, end) - * if start == 0: # <<<<<<<<<<<<<< - * break - * start -= 1 - */ } /* "sklearn/tree/_splitter.pyx":557 @@ -5751,9 +5547,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_14RandomSplitter___reduce__( */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSplitter)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSplitter)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSplitter)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSplitter))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSplitter))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSplitter))); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); @@ -6158,25 +5954,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * else: */ __pyx_v_n_drawn_constants = (__pyx_v_n_drawn_constants + 1); - - /* "sklearn/tree/_splitter.pyx":649 - * random_state) - * - * if f_j < n_known_constants: # <<<<<<<<<<<<<< - * # f_j in the interval [n_drawn_constants, n_known_constants[ - * tmp = features[f_j] - */ goto __pyx_L8; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":659 + /* "sklearn/tree/_splitter.pyx":659 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< * # f_j in the interval [n_total_constants, f_i[ * */ - /*else*/ { __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); /* "sklearn/tree/_splitter.pyx":662 @@ -6262,14 +6050,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * max_feature_value = current_feature_value */ __pyx_v_min_feature_value = __pyx_v_current_feature_value; - - /* "sklearn/tree/_splitter.pyx":675 - * Xf[p] = current_feature_value - * - * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< - * min_feature_value = current_feature_value - * elif current_feature_value > max_feature_value: - */ goto __pyx_L11; } @@ -6291,14 +6071,7 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: */ __pyx_v_max_feature_value = __pyx_v_current_feature_value; - - /* "sklearn/tree/_splitter.pyx":677 - * if current_feature_value < min_feature_value: - * min_feature_value = current_feature_value - * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< - * max_feature_value = current_feature_value - * - */ + goto __pyx_L11; } __pyx_L11:; } @@ -6349,25 +6122,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * else: */ __pyx_v_n_total_constants = (__pyx_v_n_total_constants + 1); - - /* "sklearn/tree/_splitter.pyx":680 - * max_feature_value = current_feature_value - * - * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< - * features[f_j] = features[n_total_constants] - * features[n_total_constants] = current.feature - */ goto __pyx_L12; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":688 + /* "sklearn/tree/_splitter.pyx":688 * * else: * f_i -= 1 # <<<<<<<<<<<<<< * features[f_i], features[f_j] = features[f_j], features[f_i] * */ - /*else*/ { __pyx_v_f_i = (__pyx_v_f_i - 1); /* "sklearn/tree/_splitter.pyx":689 @@ -6409,15 +6174,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * # Partition */ __pyx_v_current.threshold = __pyx_v_min_feature_value; - - /* "sklearn/tree/_splitter.pyx":696 - * random_state) - * - * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< - * current.threshold = min_feature_value - * - */ + goto __pyx_L13; } + __pyx_L13:; /* "sklearn/tree/_splitter.pyx":700 * @@ -6475,25 +6234,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * partition_end -= 1 */ __pyx_v_p = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":704 - * while p < partition_end: - * current_feature_value = Xf[p] - * if current_feature_value <= current.threshold: # <<<<<<<<<<<<<< - * p += 1 - * else: - */ goto __pyx_L16; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":707 + /* "sklearn/tree/_splitter.pyx":707 * p += 1 * else: * partition_end -= 1 # <<<<<<<<<<<<<< * * Xf[p] = Xf[partition_end] */ - /*else*/ { __pyx_v_partition_end = (__pyx_v_partition_end - 1); /* "sklearn/tree/_splitter.pyx":709 @@ -6577,14 +6328,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct __pyx_t_6 = (((__pyx_v_end - __pyx_v_current.pos) < __pyx_v_min_samples_leaf) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L18_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":719 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ if (__pyx_t_5) { /* "sklearn/tree/_splitter.pyx":721 @@ -6595,14 +6338,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * # Evaluate split */ goto __pyx_L3_continue; - - /* "sklearn/tree/_splitter.pyx":719 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":724 @@ -6647,14 +6382,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_right < __pyx_v_min_weight_leaf) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L21_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":728 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ if (__pyx_t_5) { /* "sklearn/tree/_splitter.pyx":730 @@ -6665,14 +6392,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L3_continue; - - /* "sklearn/tree/_splitter.pyx":728 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":732 @@ -6711,15 +6430,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * # Reorganize into samples[start:best.pos] + samples[best.pos:end] */ __pyx_v_best = __pyx_v_current; - - /* "sklearn/tree/_splitter.pyx":734 - * current_proxy_improvement = self.criterion.proxy_impurity_improvement() - * - * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< - * best_proxy_improvement = current_proxy_improvement - * best = current # copy - */ + goto __pyx_L23; } + __pyx_L23:; } __pyx_L12:; } @@ -6784,14 +6497,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * */ __pyx_t_5 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); - - /* "sklearn/tree/_splitter.pyx":745 - * - * while p < partition_end: - * if X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< - * X_fx_stride * best.feature] <= best.threshold: - * p += 1 - */ if (__pyx_t_5) { /* "sklearn/tree/_splitter.pyx":747 @@ -6802,25 +6507,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * else: */ __pyx_v_p = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":745 - * - * while p < partition_end: - * if X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< - * X_fx_stride * best.feature] <= best.threshold: - * p += 1 - */ goto __pyx_L28; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":750 + /* "sklearn/tree/_splitter.pyx":750 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< * * tmp = samples[partition_end] */ - /*else*/ { __pyx_v_partition_end = (__pyx_v_partition_end - 1); /* "sklearn/tree/_splitter.pyx":752 @@ -6852,15 +6549,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct } __pyx_L28:; } - - /* "sklearn/tree/_splitter.pyx":740 - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: - * if current.feature != best.feature: # <<<<<<<<<<<<<< - * partition_end = end - * p = start - */ + goto __pyx_L25; } + __pyx_L25:; /* "sklearn/tree/_splitter.pyx":757 * @@ -6897,15 +6588,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_14RandomSplitter_node_split(struct * */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_best.impurity_left), (&__pyx_v_best.impurity_right)); - - /* "sklearn/tree/_splitter.pyx":739 - * - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: # <<<<<<<<<<<<<< - * if current.feature != best.feature: - * partition_end = end - */ + goto __pyx_L24; } + __pyx_L24:; /* "sklearn/tree/_splitter.pyx":766 * # element in features[:n_known_constants] must be preserved for sibling @@ -7288,9 +6973,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_19PresortBestSplitter_4__red */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_PresortBestSplitter)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_PresortBestSplitter)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_PresortBestSplitter)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_PresortBestSplitter))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_PresortBestSplitter))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_PresortBestSplitter))); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); @@ -7446,6 +7131,8 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_init(struct __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); /* "sklearn/tree/_splitter.pyx":824 * self.X_old = self.X @@ -7454,14 +7141,12 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_init(struct * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / */ - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "sklearn/tree/_splitter.pyx":823 @@ -7547,15 +7232,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_init(struct * cdef void node_split(self, double impurity, SplitRecord* split, */ memset(__pyx_v_sample_mask, 0, __pyx_v_self->n_total_samples); - - /* "sklearn/tree/_splitter.pyx":821 - * - * # Pre-sort X - * if self.X_old != self.X: # <<<<<<<<<<<<<< - * self.X_old = self.X - * self.X_argsorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_splitter.pyx":809 * self.random_state), self.__getstate__()) @@ -8024,25 +7703,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * else: */ __pyx_v_n_drawn_constants = (__pyx_v_n_drawn_constants + 1); - - /* "sklearn/tree/_splitter.pyx":913 - * random_state) - * - * if f_j < n_known_constants: # <<<<<<<<<<<<<< - * # f_j is in [n_drawn_constants, n_known_constants[ - * tmp = features[f_j] - */ goto __pyx_L10; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":923 + /* "sklearn/tree/_splitter.pyx":923 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< * # f_j in the interval [n_total_constants, f_i[ * */ - /*else*/ { __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); /* "sklearn/tree/_splitter.pyx":926 @@ -8119,15 +7790,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * # Evaluate all splits */ __pyx_v_p = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":933 - * for i in range(n_total_samples): - * j = X_argsorted[X_argsorted_stride * current.feature + i] - * if sample_mask[j] == 1: # <<<<<<<<<<<<<< - * samples[p] = j - * Xf[p] = X[X_sample_stride * j + - */ + goto __pyx_L13; } + __pyx_L13:; } /* "sklearn/tree/_splitter.pyx":940 @@ -8176,25 +7841,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * else: */ __pyx_v_n_total_constants = (__pyx_v_n_total_constants + 1); - - /* "sklearn/tree/_splitter.pyx":940 - * - * # Evaluate all splits - * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< - * features[f_j] = features[n_total_constants] - * features[n_total_constants] = current.feature - */ goto __pyx_L14; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":948 + /* "sklearn/tree/_splitter.pyx":948 * * else: * f_i -= 1 # <<<<<<<<<<<<<< * features[f_i], features[f_j] = features[f_j], features[f_i] * */ - /*else*/ { __pyx_v_f_i = (__pyx_v_f_i - 1); /* "sklearn/tree/_splitter.pyx":949 @@ -8327,14 +7984,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s __pyx_t_9 = (((__pyx_v_end - __pyx_v_current.pos) < __pyx_v_min_samples_leaf) != 0); __pyx_t_8 = __pyx_t_9; __pyx_L23_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":969 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ if (__pyx_t_8) { /* "sklearn/tree/_splitter.pyx":971 @@ -8345,14 +7994,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * self.criterion.update(current.pos) */ goto __pyx_L15_continue; - - /* "sklearn/tree/_splitter.pyx":969 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":973 @@ -8388,32 +8029,16 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s __pyx_t_9 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_right < __pyx_v_min_weight_leaf) != 0); __pyx_t_8 = __pyx_t_9; __pyx_L26_bool_binop_done:; + if (__pyx_t_8) { - /* "sklearn/tree/_splitter.pyx":976 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ - if (__pyx_t_8) { - - /* "sklearn/tree/_splitter.pyx":978 - * if ((self.criterion.weighted_n_left < min_weight_leaf) or + /* "sklearn/tree/_splitter.pyx":978 + * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< * * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L15_continue; - - /* "sklearn/tree/_splitter.pyx":976 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":980 @@ -8471,15 +8096,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * best = current # copy */ __pyx_v_current.threshold = (__pyx_v_Xf[(__pyx_v_p - 1)]); - - /* "sklearn/tree/_splitter.pyx":986 - * - * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 - * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< - * current.threshold = Xf[p - 1] - * - */ + goto __pyx_L29; } + __pyx_L29:; /* "sklearn/tree/_splitter.pyx":989 * current.threshold = Xf[p - 1] @@ -8489,24 +8108,12 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * # Reorganize into samples[start:best.pos] + samples[best.pos:end] */ __pyx_v_best = __pyx_v_current; - - /* "sklearn/tree/_splitter.pyx":982 - * current_proxy_improvement = self.criterion.proxy_impurity_improvement() - * - * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< - * best_proxy_improvement = current_proxy_improvement - * - */ + goto __pyx_L28; } - - /* "sklearn/tree/_splitter.pyx":965 - * # X[samples[p - 1], current.feature]) - * - * if p < end: # <<<<<<<<<<<<<< - * current.pos = p - * - */ + __pyx_L28:; + goto __pyx_L21; } + __pyx_L21:; __pyx_L15_continue:; } } @@ -8562,14 +8169,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * */ __pyx_t_8 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); - - /* "sklearn/tree/_splitter.pyx":997 - * - * while p < partition_end: - * if X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< - * X_fx_stride * best.feature] <= best.threshold: - * p += 1 - */ if (__pyx_t_8) { /* "sklearn/tree/_splitter.pyx":999 @@ -8580,25 +8179,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * else: */ __pyx_v_p = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":997 - * - * while p < partition_end: - * if X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< - * X_fx_stride * best.feature] <= best.threshold: - * p += 1 - */ goto __pyx_L33; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1002 + /* "sklearn/tree/_splitter.pyx":1002 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< * * tmp = samples[partition_end] */ - /*else*/ { __pyx_v_partition_end = (__pyx_v_partition_end - 1); /* "sklearn/tree/_splitter.pyx":1004 @@ -8666,15 +8257,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_19PresortBestSplitter_node_split(s * */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_best.impurity_left), (&__pyx_v_best.impurity_right)); - - /* "sklearn/tree/_splitter.pyx":992 - * - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: # <<<<<<<<<<<<<< - * partition_end = end - * p = start - */ + goto __pyx_L30; } + __pyx_L30:; /* "sklearn/tree/_splitter.pyx":1015 * @@ -9068,14 +8653,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BaseSparseSplitter_init(struct _ __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_splitter.pyx":1071 - * Splitter.init(self, X, y, sample_weight) - * - * if not isinstance(X, csc_matrix): # <<<<<<<<<<<<<< - * raise ValueError("X should be in csc format") - * - */ } /* "sklearn/tree/_splitter.pyx":1074 @@ -9402,14 +8979,6 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_f_7sklearn_4 * p = start_positive */ __pyx_v_partition_end = __pyx_v_end_negative; - - /* "sklearn/tree/_splitter.pyx":1113 - * cdef SIZE_t* index_to_samples = self.index_to_samples - * - * if threshold < 0.: # <<<<<<<<<<<<<< - * p = self.start - * partition_end = end_negative - */ goto __pyx_L3; } @@ -9441,25 +9010,17 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_f_7sklearn_4 */ __pyx_t_4 = __pyx_v_self->__pyx_base.end; __pyx_v_partition_end = __pyx_t_4; - - /* "sklearn/tree/_splitter.pyx":1116 - * p = self.start - * partition_end = end_negative - * elif threshold > 0.: # <<<<<<<<<<<<<< - * p = start_positive - * partition_end = self.end - */ goto __pyx_L3; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1121 + /* "sklearn/tree/_splitter.pyx":1121 * else: * # Data are already split * return zero_pos # <<<<<<<<<<<<<< * * while p < partition_end: */ - /*else*/ { __pyx_r = __pyx_v_zero_pos; goto __pyx_L0; } @@ -9503,25 +9064,17 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_9_splitter_SIZE_t __pyx_f_7sklearn_4 * else: */ __pyx_v_p = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":1126 - * value = Xf[p] - * - * if value <= threshold: # <<<<<<<<<<<<<< - * p += 1 - * - */ goto __pyx_L6; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1130 + /* "sklearn/tree/_splitter.pyx":1130 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< * * Xf[p] = Xf[partition_end] */ - /*else*/ { __pyx_v_partition_end = (__pyx_v_partition_end - 1); /* "sklearn/tree/_splitter.pyx":1132 @@ -9636,14 +9189,6 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_18BaseSparseSplitter * indptr_start, indptr_end, */ __pyx_t_1 = ((((((1 - (__pyx_v_is_samples_sorted[0])) * __pyx_v_n_samples) * __pyx_f_7sklearn_4tree_6_utils_log(__pyx_v_n_samples)) + (__pyx_v_n_samples * __pyx_f_7sklearn_4tree_6_utils_log(__pyx_v_n_indices))) < (__pyx_v_7sklearn_4tree_9_splitter_EXTRACT_NNZ_SWITCH * __pyx_v_n_indices)) != 0); - - /* "sklearn/tree/_splitter.pyx":1180 - * # search and O(n_indices) is the running time of index_to_samples - * # approach. - * if ((1 - is_samples_sorted[0]) * n_samples * log(n_samples) + # <<<<<<<<<<<<<< - * n_samples * log(n_indices) < EXTRACT_NNZ_SWITCH * n_indices): - * extract_nnz_binary_search(self.X_indices, self.X_data, - */ if (__pyx_t_1) { /* "sklearn/tree/_splitter.pyx":1182 @@ -9654,32 +9199,16 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_18BaseSparseSplitter * self.samples, self.start, self.end, */ __pyx_f_7sklearn_4tree_9_splitter_extract_nnz_binary_search(__pyx_v_self->X_indices, __pyx_v_self->X_data, __pyx_v_indptr_start, __pyx_v_indptr_end, __pyx_v_self->__pyx_base.samples, __pyx_v_self->__pyx_base.start, __pyx_v_self->__pyx_base.end, __pyx_v_self->index_to_samples, __pyx_v_self->__pyx_base.feature_values, __pyx_v_end_negative, __pyx_v_start_positive, __pyx_v_self->sorted_samples, __pyx_v_is_samples_sorted); - - /* "sklearn/tree/_splitter.pyx":1180 - * # search and O(n_indices) is the running time of index_to_samples - * # approach. - * if ((1 - is_samples_sorted[0]) * n_samples * log(n_samples) + # <<<<<<<<<<<<<< - * n_samples * log(n_indices) < EXTRACT_NNZ_SWITCH * n_indices): - * extract_nnz_binary_search(self.X_indices, self.X_data, - */ goto __pyx_L3; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1193 + /* "sklearn/tree/_splitter.pyx":1193 * # index_to_samples is a mapping from X_indices to samples * else: * extract_nnz_index_to_samples(self.X_indices, self.X_data, # <<<<<<<<<<<<<< * indptr_start, indptr_end, * self.samples, self.start, self.end, - */ - /*else*/ { - - /* "sklearn/tree/_splitter.pyx":1198 - * self.index_to_samples, - * self.feature_values, - * end_negative, start_positive) # <<<<<<<<<<<<<< - * - * */ __pyx_f_7sklearn_4tree_9_splitter_extract_nnz_index_to_samples(__pyx_v_self->X_indices, __pyx_v_self->X_data, __pyx_v_indptr_start, __pyx_v_indptr_end, __pyx_v_self->__pyx_base.samples, __pyx_v_self->__pyx_base.start, __pyx_v_self->__pyx_base.end, __pyx_v_self->index_to_samples, __pyx_v_self->__pyx_base.feature_values, __pyx_v_end_negative, __pyx_v_start_positive); } @@ -9807,14 +9336,6 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_binary_search(__pyx_ * if sorted_array[pivot] < value: */ goto __pyx_L4_break; - - /* "sklearn/tree/_splitter.pyx":1219 - * pivot = start + (end - start) / 2 - * - * if sorted_array[pivot] == value: # <<<<<<<<<<<<<< - * index[0] = pivot - * start = pivot + 1 - */ } /* "sklearn/tree/_splitter.pyx":1224 @@ -9835,25 +9356,17 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_binary_search(__pyx_ * end = pivot */ __pyx_v_start = (__pyx_v_pivot + 1); - - /* "sklearn/tree/_splitter.pyx":1224 - * break - * - * if sorted_array[pivot] < value: # <<<<<<<<<<<<<< - * start = pivot + 1 - * else: - */ goto __pyx_L6; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1227 + /* "sklearn/tree/_splitter.pyx":1227 * start = pivot + 1 * else: * end = pivot # <<<<<<<<<<<<<< * new_start[0] = start * */ - /*else*/ { __pyx_v_end = __pyx_v_pivot; } __pyx_L6:; @@ -9986,14 +9499,6 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_extract_nnz_index_to * */ __pyx_f_7sklearn_4tree_9_splitter_sparse_swap(__pyx_v_index_to_samples, __pyx_v_samples, __pyx_v_index, __pyx_v_start_positive_); - - /* "sklearn/tree/_splitter.pyx":1253 - * for k in range(indptr_start, indptr_end): - * if start <= index_to_samples[X_indices[k]] < end: - * if X_data[k] > 0: # <<<<<<<<<<<<<< - * start_positive_ -= 1 - * Xf[start_positive_] = X_data[k] - */ goto __pyx_L6; } @@ -10042,25 +9547,12 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_extract_nnz_index_to * # Returned values */ __pyx_v_end_negative_ = (__pyx_v_end_negative_ + 1); - - /* "sklearn/tree/_splitter.pyx":1260 - * - * - * elif X_data[k] < 0: # <<<<<<<<<<<<<< - * Xf[end_negative_] = X_data[k] - * index = index_to_samples[X_indices[k]] - */ + goto __pyx_L6; } __pyx_L6:; - - /* "sklearn/tree/_splitter.pyx":1252 - * - * for k in range(indptr_start, indptr_end): - * if start <= index_to_samples[X_indices[k]] < end: # <<<<<<<<<<<<<< - * if X_data[k] > 0: - * start_positive_ -= 1 - */ + goto __pyx_L5; } + __pyx_L5:; } /* "sklearn/tree/_splitter.pyx":1267 @@ -10155,15 +9647,9 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_extract_nnz_binary_s * while (indptr_start < indptr_end and */ (__pyx_v_is_samples_sorted[0]) = 1; - - /* "sklearn/tree/_splitter.pyx":1294 - * cdef SIZE_t n_samples - * - * if not is_samples_sorted[0]: # <<<<<<<<<<<<<< - * n_samples = end - start - * memcpy(sorted_samples + start, samples + start, - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_splitter.pyx":1302 * is_samples_sorted[0] = 1 @@ -10349,14 +9835,6 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_extract_nnz_binary_s * */ __pyx_f_7sklearn_4tree_9_splitter_sparse_swap(__pyx_v_index_to_samples, __pyx_v_samples, __pyx_v_index, __pyx_v_start_positive_); - - /* "sklearn/tree/_splitter.pyx":1324 - * # If k != -1, we have found a non zero value - * - * if X_data[k] > 0: # <<<<<<<<<<<<<< - * start_positive_ -= 1 - * Xf[start_positive_] = X_data[k] - */ goto __pyx_L17; } @@ -10405,25 +9883,12 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_9_splitter_extract_nnz_binary_s * */ __pyx_v_end_negative_ = (__pyx_v_end_negative_ + 1); - - /* "sklearn/tree/_splitter.pyx":1331 - * - * - * elif X_data[k] < 0: # <<<<<<<<<<<<<< - * Xf[end_negative_] = X_data[k] - * index = index_to_samples[X_indices[k]] - */ + goto __pyx_L17; } __pyx_L17:; - - /* "sklearn/tree/_splitter.pyx":1321 - * sorted_samples[p], &k, &indptr_start) - * - * if k != -1: # <<<<<<<<<<<<<< - * # If k != -1, we have found a non zero value - * - */ + goto __pyx_L16; } + __pyx_L16:; /* "sklearn/tree/_splitter.pyx":1336 * sparse_swap(index_to_samples, samples, index, end_negative_) @@ -10651,9 +10116,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_18BestSparseSplitter___reduc */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_BestSparseSplitter)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_BestSparseSplitter)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_BestSparseSplitter)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_BestSparseSplitter))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_BestSparseSplitter))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_BestSparseSplitter))); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); @@ -11091,25 +10556,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * else: */ __pyx_v_n_drawn_constants = (__pyx_v_n_drawn_constants + 1); - - /* "sklearn/tree/_splitter.pyx":1446 - * random_state) - * - * if f_j < n_known_constants: # <<<<<<<<<<<<<< - * # f_j in the interval [n_drawn_constants, n_known_constants[ - * tmp = features[f_j] - */ goto __pyx_L8; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1456 + /* "sklearn/tree/_splitter.pyx":1456 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< * # f_j in the interval [n_total_constants, f_i[ * */ - /*else*/ { __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); /* "sklearn/tree/_splitter.pyx":1459 @@ -11245,24 +10702,12 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: */ __pyx_v_end_negative = (__pyx_v_end_negative + 1); - - /* "sklearn/tree/_splitter.pyx":1480 - * Xf[start_positive] = 0. - * - * if end_negative != start_positive: # <<<<<<<<<<<<<< - * Xf[end_negative] = 0. - * end_negative += 1 - */ + goto __pyx_L14; } - - /* "sklearn/tree/_splitter.pyx":1476 - * - * # Add one or two zeros in Xf, if there is any - * if end_negative < start_positive: # <<<<<<<<<<<<<< - * start_positive -= 1 - * Xf[start_positive] = 0. - */ + __pyx_L14:; + goto __pyx_L13; } + __pyx_L13:; /* "sklearn/tree/_splitter.pyx":1484 * end_negative += 1 @@ -11310,25 +10755,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * else: */ __pyx_v_n_total_constants = (__pyx_v_n_total_constants + 1); - - /* "sklearn/tree/_splitter.pyx":1484 - * end_negative += 1 - * - * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< - * features[f_j] = features[n_total_constants] - * features[n_total_constants] = current.feature - */ goto __pyx_L15; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1492 + /* "sklearn/tree/_splitter.pyx":1492 * * else: * f_i -= 1 # <<<<<<<<<<<<<< * features[f_i], features[f_j] = features[f_j], features[f_i] * */ - /*else*/ { __pyx_v_f_i = (__pyx_v_f_i - 1); /* "sklearn/tree/_splitter.pyx":1493 @@ -11390,25 +10827,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * p_next = start_positive */ __pyx_v_p_next = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":1500 - * - * while p < end: - * if p + 1 != end_negative: # <<<<<<<<<<<<<< - * p_next = p + 1 - * else: - */ goto __pyx_L18; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1503 + /* "sklearn/tree/_splitter.pyx":1503 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< * * while (p_next < end and */ - /*else*/ { __pyx_v_p_next = __pyx_v_start_positive; } __pyx_L18:; @@ -11467,25 +10896,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * p_next = start_positive */ __pyx_v_p_next = (__pyx_v_p + 1); - - /* "sklearn/tree/_splitter.pyx":1508 - * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): - * p = p_next - * if p + 1 != end_negative: # <<<<<<<<<<<<<< - * p_next = p + 1 - * else: - */ goto __pyx_L23; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1511 + /* "sklearn/tree/_splitter.pyx":1511 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< * * */ - /*else*/ { __pyx_v_p_next = __pyx_v_start_positive; } __pyx_L23:; @@ -11552,14 +10973,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st __pyx_t_7 = (((__pyx_v_end - __pyx_v_current.pos) < __pyx_v_min_samples_leaf) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L26_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":1526 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ if (__pyx_t_6) { /* "sklearn/tree/_splitter.pyx":1528 @@ -11570,14 +10983,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * self.criterion.update(current.pos) */ goto __pyx_L16_continue; - - /* "sklearn/tree/_splitter.pyx":1526 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":1530 @@ -11613,14 +11018,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st __pyx_t_7 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_right < __pyx_v_min_weight_leaf) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L29_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":1533 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ if (__pyx_t_6) { /* "sklearn/tree/_splitter.pyx":1535 @@ -11631,14 +11028,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L16_continue; - - /* "sklearn/tree/_splitter.pyx":1533 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":1537 @@ -11696,42 +11085,24 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * best = current */ __pyx_v_current.threshold = (__pyx_v_Xf[__pyx_v_p_prev]); + goto __pyx_L32; + } + __pyx_L32:; - /* "sklearn/tree/_splitter.pyx":1543 - * - * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 - * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< - * current.threshold = Xf[p_prev] - * - */ - } - - /* "sklearn/tree/_splitter.pyx":1546 - * current.threshold = Xf[p_prev] + /* "sklearn/tree/_splitter.pyx":1546 + * current.threshold = Xf[p_prev] * * best = current # <<<<<<<<<<<<<< * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] */ __pyx_v_best = __pyx_v_current; - - /* "sklearn/tree/_splitter.pyx":1539 - * current_proxy_improvement = self.criterion.proxy_impurity_improvement() - * - * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< - * best_proxy_improvement = current_proxy_improvement - * - */ + goto __pyx_L31; } - - /* "sklearn/tree/_splitter.pyx":1522 - * - * - * if p < end: # <<<<<<<<<<<<<< - * current.pos = p - * - */ + __pyx_L31:; + goto __pyx_L24; } + __pyx_L24:; __pyx_L16_continue:; } } @@ -11803,15 +11174,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_18BestSparseSplitter_node_split(st * */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_best.impurity_left), (&__pyx_v_best.impurity_right)); - - /* "sklearn/tree/_splitter.pyx":1549 - * - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: # <<<<<<<<<<<<<< - * self.extract_nnz(best.feature, &end_negative, &start_positive, - * &is_samples_sorted) - */ + goto __pyx_L33; } + __pyx_L33:; /* "sklearn/tree/_splitter.pyx":1565 * # element in features[:n_known_constants] must be preserved for sibling @@ -11994,9 +11359,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_9_splitter_20RandomSparseSplitter___red */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSparseSplitter)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSparseSplitter)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSparseSplitter)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSparseSplitter))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSparseSplitter))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_9_splitter_RandomSparseSplitter))); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); @@ -12435,25 +11800,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * else: */ __pyx_v_n_drawn_constants = (__pyx_v_n_drawn_constants + 1); - - /* "sklearn/tree/_splitter.pyx":1675 - * random_state) - * - * if f_j < n_known_constants: # <<<<<<<<<<<<<< - * # f_j in the interval [n_drawn_constants, n_known_constants[ - * tmp = features[f_j] - */ goto __pyx_L8; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1685 + /* "sklearn/tree/_splitter.pyx":1685 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< * # f_j in the interval [n_total_constants, f_i[ * */ - /*else*/ { __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); /* "sklearn/tree/_splitter.pyx":1688 @@ -12529,24 +11886,12 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * # Find min, max in Xf[start:end_negative] */ __pyx_v_end_negative = (__pyx_v_end_negative + 1); - - /* "sklearn/tree/_splitter.pyx":1699 - * Xf[start_positive] = 0. - * - * if end_negative != start_positive: # <<<<<<<<<<<<<< - * Xf[end_negative] = 0. - * end_negative += 1 - */ + goto __pyx_L10; } - - /* "sklearn/tree/_splitter.pyx":1695 - * - * # Add one or two zeros in Xf, if there is any - * if end_negative < start_positive: # <<<<<<<<<<<<<< - * start_positive -= 1 - * Xf[start_positive] = 0. - */ + __pyx_L10:; + goto __pyx_L9; } + __pyx_L9:; /* "sklearn/tree/_splitter.pyx":1704 * @@ -12604,14 +11949,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * max_feature_value = current_feature_value */ __pyx_v_min_feature_value = __pyx_v_current_feature_value; - - /* "sklearn/tree/_splitter.pyx":1710 - * current_feature_value = Xf[p] - * - * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< - * min_feature_value = current_feature_value - * elif current_feature_value > max_feature_value: - */ goto __pyx_L13; } @@ -12633,14 +11970,7 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * # Update min, max given Xf[start_positive:end] */ __pyx_v_max_feature_value = __pyx_v_current_feature_value; - - /* "sklearn/tree/_splitter.pyx":1712 - * if current_feature_value < min_feature_value: - * min_feature_value = current_feature_value - * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< - * max_feature_value = current_feature_value - * - */ + goto __pyx_L13; } __pyx_L13:; } @@ -12683,14 +12013,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * max_feature_value = current_feature_value */ __pyx_v_min_feature_value = __pyx_v_current_feature_value; - - /* "sklearn/tree/_splitter.pyx":1719 - * current_feature_value = Xf[p] - * - * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< - * min_feature_value = current_feature_value - * elif current_feature_value > max_feature_value: - */ goto __pyx_L16; } @@ -12712,14 +12034,7 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: */ __pyx_v_max_feature_value = __pyx_v_current_feature_value; - - /* "sklearn/tree/_splitter.pyx":1721 - * if current_feature_value < min_feature_value: - * min_feature_value = current_feature_value - * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< - * max_feature_value = current_feature_value - * - */ + goto __pyx_L16; } __pyx_L16:; } @@ -12770,25 +12085,17 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * else: */ __pyx_v_n_total_constants = (__pyx_v_n_total_constants + 1); - - /* "sklearn/tree/_splitter.pyx":1724 - * max_feature_value = current_feature_value - * - * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< - * features[f_j] = features[n_total_constants] - * features[n_total_constants] = current.feature - */ goto __pyx_L17; } + /*else*/ { - /* "sklearn/tree/_splitter.pyx":1732 + /* "sklearn/tree/_splitter.pyx":1732 * * else: * f_i -= 1 # <<<<<<<<<<<<<< * features[f_i], features[f_j] = features[f_j], features[f_i] * */ - /*else*/ { __pyx_v_f_i = (__pyx_v_f_i - 1); /* "sklearn/tree/_splitter.pyx":1733 @@ -12830,15 +12137,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * # Partition */ __pyx_v_current.threshold = __pyx_v_min_feature_value; - - /* "sklearn/tree/_splitter.pyx":1740 - * random_state) - * - * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< - * current.threshold = min_feature_value - * - */ + goto __pyx_L18; } + __pyx_L18:; /* "sklearn/tree/_splitter.pyx":1744 * @@ -12873,14 +12174,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( __pyx_t_7 = (((__pyx_v_end - __pyx_v_current.pos) < __pyx_v_min_samples_leaf) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L20_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":1751 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ if (__pyx_t_6) { /* "sklearn/tree/_splitter.pyx":1753 @@ -12891,14 +12184,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * # Evaluate split */ goto __pyx_L3_continue; - - /* "sklearn/tree/_splitter.pyx":1751 - * - * # Reject if min_samples_leaf is not guaranteed - * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< - * ((end - current.pos) < min_samples_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":1756 @@ -12943,14 +12228,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( __pyx_t_7 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_right < __pyx_v_min_weight_leaf) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L23_bool_binop_done:; - - /* "sklearn/tree/_splitter.pyx":1760 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ if (__pyx_t_6) { /* "sklearn/tree/_splitter.pyx":1762 @@ -12961,14 +12238,6 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L3_continue; - - /* "sklearn/tree/_splitter.pyx":1760 - * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue - */ } /* "sklearn/tree/_splitter.pyx":1764 @@ -13025,15 +12294,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * # Reorganize into samples[start:best.pos] + samples[best.pos:end] */ __pyx_v_best = __pyx_v_current; - - /* "sklearn/tree/_splitter.pyx":1766 - * current_proxy_improvement = self.criterion.proxy_impurity_improvement() - * - * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< - * best_proxy_improvement = current_proxy_improvement - * current.improvement = self.criterion.impurity_improvement(impurity) - */ + goto __pyx_L25; } + __pyx_L25:; } __pyx_L17:; } @@ -13078,15 +12341,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * */ __pyx_f_7sklearn_4tree_9_splitter_18BaseSparseSplitter__partition(((struct __pyx_obj_7sklearn_4tree_9_splitter_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.threshold, __pyx_v_end_negative, __pyx_v_start_positive, __pyx_v_best.pos); - - /* "sklearn/tree/_splitter.pyx":1776 - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: - * if current.feature != best.feature: # <<<<<<<<<<<<<< - * self.extract_nnz(best.feature, &end_negative, &start_positive, - * &is_samples_sorted) - */ + goto __pyx_L27; } + __pyx_L27:; /* "sklearn/tree/_splitter.pyx":1783 * best.pos) @@ -13123,15 +12380,9 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( * */ ((struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_best.impurity_left), (&__pyx_v_best.impurity_right)); - - /* "sklearn/tree/_splitter.pyx":1775 - * - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: # <<<<<<<<<<<<<< - * if current.feature != best.feature: - * self.extract_nnz(best.feature, &end_negative, &start_positive, - */ + goto __pyx_L26; } + __pyx_L26:; /* "sklearn/tree/_splitter.pyx":1792 * # element in features[:n_known_constants] must be preserved for sibling @@ -13177,7 +12428,7 @@ static void __pyx_f_7sklearn_4tree_9_splitter_20RandomSparseSplitter_node_split( /* function exit code */ } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -13227,7 +12478,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -13240,7 +12491,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -13249,7 +12500,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -13258,7 +12509,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -13267,7 +12518,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -13277,7 +12528,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -13285,30 +12536,22 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * copy_shape = 0 */ __pyx_v_copy_shape = 1; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ goto __pyx_L4; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - /*else*/ { __pyx_v_copy_shape = 0; } __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -13322,7 +12565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -13332,17 +12575,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -13354,17 +12589,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -13378,7 +12605,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -13388,17 +12615,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -13410,17 +12629,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -13429,7 +12640,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -13438,7 +12649,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -13448,7 +12659,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -13457,7 +12668,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -13466,7 +12677,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -13477,7 +12688,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -13486,7 +12697,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -13495,28 +12706,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ goto __pyx_L11; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -13527,7 +12730,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -13536,7 +12739,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -13545,7 +12748,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -13554,28 +12757,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< * cdef dtype descr = self.descr - * cdef int offset + * cdef list stack */ __pyx_v_f = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack * cdef int offset - * */ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); __Pyx_INCREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -13584,7 +12787,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -13602,7 +12805,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -13614,25 +12817,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ goto __pyx_L14; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< * * if not hasfields: */ - /*else*/ { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_info->obj); @@ -13641,7 +12836,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -13651,7 +12846,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -13661,7 +12856,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -13681,7 +12876,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -13697,51 +12892,43 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - } + switch (__pyx_v_t) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" */ - switch (__pyx_v_t) { case NPY_BYTE: __pyx_v_f = __pyx_k_b; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -13752,7 +12939,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -13763,7 +12950,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -13774,7 +12961,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -13785,7 +12972,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -13796,7 +12983,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -13807,7 +12994,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -13818,7 +13005,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -13829,7 +13016,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -13840,7 +13027,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -13851,7 +13038,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -13862,7 +13049,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -13873,7 +13060,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -13884,7 +13071,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -13895,7 +13082,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -13906,7 +13093,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -13918,33 +13105,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -13953,7 +13140,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -13962,27 +13149,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_r = 0; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 */ - /*else*/ { __pyx_v_info->format = ((char *)malloc(255)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -13991,7 +13170,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -14000,17 +13179,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_7; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -14020,7 +13199,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -14052,7 +13231,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -14076,7 +13255,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -14086,7 +13265,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -14094,17 +13273,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * stdlib.free(info.strides) */ free(__pyx_v_info->format); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ + goto __pyx_L3; } + __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -14114,7 +13287,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -14122,17 +13295,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * */ free(__pyx_v_info->strides); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ + goto __pyx_L4; } + __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -14144,7 +13311,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -14161,7 +13328,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -14169,13 +13336,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -14194,7 +13361,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -14211,7 +13378,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -14219,13 +13386,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -14244,7 +13411,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -14261,7 +13428,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -14269,13 +13436,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -14294,7 +13461,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -14311,7 +13478,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -14319,13 +13486,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -14344,7 +13511,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -14361,7 +13528,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -14369,13 +13536,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -14394,7 +13561,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -14426,17 +13593,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":793 + * cdef int delta_offset + * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< * cdef bint little_endian = ((&endian_detector)[0] != 0) * cdef tuple fields */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * cdef tuple fields @@ -14444,7 +13611,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -14453,21 +13620,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -14476,15 +13643,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -14501,7 +13668,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -14509,60 +13676,52 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -14582,7 +13741,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -14598,39 +13757,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -14638,15 +13781,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -14655,7 +13798,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -14664,7 +13807,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -14675,7 +13818,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -14685,7 +13828,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -14695,19 +13838,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -14717,274 +13860,266 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -14993,18 +14128,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -15013,18 +14148,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -15033,49 +14168,49 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L15:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -15083,31 +14218,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * # Cython ignores struct boundary information ("T{...}"), */ __pyx_v_f = (__pyx_v_f + 1); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ goto __pyx_L13; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; } __pyx_L13:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -15117,7 +14244,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -15127,7 +14254,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -15152,7 +14279,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -15167,7 +14294,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -15178,7 +14305,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -15186,28 +14313,20 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a * Py_INCREF(base) # important to do this before decref below! */ __pyx_v_baseptr = NULL; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ goto __pyx_L3; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.base) */ - /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":975 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -15218,7 +14337,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -15227,7 +14346,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -15236,7 +14355,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -15248,7 +14367,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -15262,7 +14381,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -15272,7 +14391,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":981 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -15283,29 +14402,21 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983 * return None * else: * return arr.base # <<<<<<<<<<<<<< */ - /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); __pyx_r = ((PyObject *)__pyx_v_arr->base); goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -15465,9 +14576,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_Splitter = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -15540,9 +14650,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_BaseDenseSplitter = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -15613,9 +14722,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_BestSplitter = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -15686,9 +14794,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_RandomSplitter = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -15804,9 +14911,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_PresortBestSplitter = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -15898,9 +15004,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_BaseSparseSplitter = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -15971,9 +15076,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_BestSparseSplitter = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -16044,9 +15148,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_9_splitter_RandomSparseSplitter = 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -16156,7 +15259,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -16177,7 +15280,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -16188,7 +15291,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -16199,47 +15302,47 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __Pyx_RefNannyFinishContext(); @@ -16283,24 +15386,18 @@ PyMODINIT_FUNC PyInit__splitter(void) } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__splitter(void)", 0); - if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS @@ -16323,12 +15420,12 @@ PyMODINIT_FUNC PyInit__splitter(void) #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_sklearn__tree___splitter) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } #if PY_MAJOR_VERSION >= 3 { @@ -16339,9 +15436,9 @@ PyMODINIT_FUNC PyInit__splitter(void) } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ @@ -16435,7 +15532,7 @@ PyMODINIT_FUNC PyInit__splitter(void) __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_10_criterion_Criterion = __Pyx_ImportType("sklearn.tree._criterion", "Criterion", sizeof(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_10_criterion_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion = (struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_10_criterion_Criterion->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_6_utils_Stack = __Pyx_ImportType("sklearn.tree._utils", "Stack", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_Stack), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_Stack)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16453,9 +15550,6 @@ PyMODINIT_FUNC PyInit__splitter(void) if (__Pyx_ImportFunction(__pyx_t_1, "__pyx_fuse_2safe_realloc", (void (**)(void))&__pyx_fuse_2__pyx_f_7sklearn_4tree_6_utils_safe_realloc, "unsigned char *(unsigned char **, size_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /* "sklearn/tree/_splitter.pyx":26 * from libc.string cimport memset @@ -16543,7 +15637,7 @@ PyMODINIT_FUNC PyInit__splitter(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -17754,79 +16848,6 @@ static void* __Pyx_GetVtable(PyObject *dict) { return NULL; } -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -17846,7 +16867,7 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return count; } while (start < end) { - mid = start + (end - start) / 2; + mid = (start + end) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { @@ -17999,6 +17020,79 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, Py_XDECREF(py_frame); } +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); @@ -18020,33 +17114,29 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \ + { \ + func_type value = func_value; \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + if (is_unsigned && unlikely(value < zero)) \ + goto raise_neg_overflow; \ + else \ + goto raise_overflow; \ + } \ + } \ + return (target_type) value; \ } -#if CYTHON_USE_PYLONG_INTERNALS +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" + #endif #endif static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -18063,39 +17153,13 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0]) - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -18111,77 +17175,24 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { } #endif if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0]) - case -2: - if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(Py_intptr_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyLong_AsLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -18230,7 +17241,7 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { @@ -18256,7 +17267,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { } static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { - const npy_uint32 neg_one = (npy_uint32) -1, const_zero = (npy_uint32) 0; + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -18273,39 +17284,13 @@ static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (npy_uint32) 0; - case 1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, digits[0]) - case 2: - if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) >= 2 * PyLong_SHIFT) { - return (npy_uint32) (((((npy_uint32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) >= 3 * PyLong_SHIFT) { - return (npy_uint32) (((((((npy_uint32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) >= 4 * PyLong_SHIFT) { - return (npy_uint32) (((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -18321,77 +17306,24 @@ static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { } #endif if (sizeof(npy_uint32) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(npy_uint32) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (npy_uint32) 0; - case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, +digits[0]) - case -2: - if (8 * sizeof(npy_uint32) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) { - return (npy_uint32) -(((((npy_uint32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) { - return (npy_uint32) (((((npy_uint32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) { - return (npy_uint32) -(((((((npy_uint32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) { - return (npy_uint32) (((((((npy_uint32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint32) -(((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) { - return (npy_uint32) (((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(npy_uint32) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong(x)) } else if (sizeof(npy_uint32) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(npy_uint32, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -18440,7 +17372,7 @@ static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { @@ -18466,7 +17398,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(Py_intptr_t) < sizeof(long)) { @@ -18492,7 +17424,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(npy_int32) < sizeof(long)) { @@ -18518,7 +17450,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { } static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -18535,39 +17467,13 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (npy_int32) 0; - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) - case 2: - if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { - return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { - return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { - return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -18583,77 +17489,24 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { } #endif if (sizeof(npy_int32) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (npy_int32) 0; - case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) - case -2: - if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) -(((((npy_int32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) -(((((((npy_int32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) -(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(npy_int32) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong(x)) } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -18942,7 +17795,7 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -18959,39 +17812,13 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -19007,77 +17834,24 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { } #endif if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) -(((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) -(((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) -(((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -19125,34 +17899,8 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { return (int) -1; } -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -19169,39 +17917,13 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -19217,77 +17939,24 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } #endif if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) -(((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) -(((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) -(((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -19522,7 +18191,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && @@ -19563,7 +18232,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ #endif } else #endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) +#if !CYTHON_COMPILING_IN_PYPY if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); @@ -19593,7 +18262,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { #else if (PyLong_Check(x)) #endif - return __Pyx_NewRef(x); + return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { @@ -19633,55 +18302,18 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); #endif if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - } - } + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif #endif return PyLong_AsSsize_t(b); } diff --git a/sklearn/tree/_tree.c b/sklearn/tree/_tree.c index 3287f7de08bb5..a5b5d627d19b5 100644 --- a/sklearn/tree/_tree.c +++ b/sklearn/tree/_tree.c @@ -1,13 +1,25 @@ -/* Generated by Cython 0.23 */ +/* Generated by Cython 0.22.1 */ #define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_23" +#define CYTHON_ABI "0_22_1" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -42,9 +54,6 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 -#define CYTHON_USE_PYLONG_INTERNALS 1 -#endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif @@ -52,12 +61,12 @@ #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif @@ -75,7 +84,7 @@ #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -94,10 +103,12 @@ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) + #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) + #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) @@ -165,32 +176,6 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) - #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ @@ -202,20 +187,46 @@ typedef struct { #define CYTHON_INLINE #endif #endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif #endif -#include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif +#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(T& ref) : ptr(&ref) { } + T *operator->() { return ptr; } + operator T&() { return *ptr; } + private: + T *ptr; +}; +#endif #if PY_MAJOR_VERSION >= 3 @@ -234,6 +245,10 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #endif +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include #define __PYX_HAVE__sklearn__tree___tree #define __PYX_HAVE_API__sklearn__tree___tree #include "string.h" @@ -278,34 +293,16 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) @@ -340,9 +337,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); @@ -475,10 +471,10 @@ static const char *__pyx_f[] = { "sklearn/tree/_tree.pxd", "__init__.pxd", "type.pxd", - "bool.pxd", - "complex.pxd", "sklearn/tree/_criterion.pxd", "sklearn/tree/_splitter.pxd", + "bool.pxd", + "complex.pxd", "sklearn/tree/_utils.pxd", }; #define IS_UNSIGNED(type) (((type) -1) > 0) @@ -517,7 +513,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -526,7 +522,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -535,7 +531,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -544,7 +540,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":729 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -553,7 +549,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -562,7 +558,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -571,7 +567,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -580,7 +576,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":736 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -589,7 +585,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -598,7 +594,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":741 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -607,7 +603,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -616,7 +612,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -625,7 +621,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -634,7 +630,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -643,7 +639,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -652,7 +648,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -661,7 +657,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -670,7 +666,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -679,7 +675,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -688,7 +684,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -697,7 +693,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -706,7 +702,7 @@ typedef npy_double __pyx_t_5numpy_double_t; */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* "_criterion.pxd":15 +/* "sklearn/tree/_criterion.pxd":15 * cimport numpy as np * * ctypedef np.npy_float32 DTYPE_t # Type of X # <<<<<<<<<<<<<< @@ -715,7 +711,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; */ typedef npy_float32 __pyx_t_7sklearn_4tree_10_criterion_DTYPE_t; -/* "_criterion.pxd":16 +/* "sklearn/tree/_criterion.pxd":16 * * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight # <<<<<<<<<<<<<< @@ -724,7 +720,7 @@ typedef npy_float32 __pyx_t_7sklearn_4tree_10_criterion_DTYPE_t; */ typedef npy_float64 __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t; -/* "_criterion.pxd":17 +/* "sklearn/tree/_criterion.pxd":17 * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters # <<<<<<<<<<<<<< @@ -733,7 +729,7 @@ typedef npy_float64 __pyx_t_7sklearn_4tree_10_criterion_DOUBLE_t; */ typedef npy_intp __pyx_t_7sklearn_4tree_10_criterion_SIZE_t; -/* "_criterion.pxd":18 +/* "sklearn/tree/_criterion.pxd":18 * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer # <<<<<<<<<<<<<< @@ -742,7 +738,7 @@ typedef npy_intp __pyx_t_7sklearn_4tree_10_criterion_SIZE_t; */ typedef npy_int32 __pyx_t_7sklearn_4tree_10_criterion_INT32_t; -/* "_criterion.pxd":19 +/* "sklearn/tree/_criterion.pxd":19 * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer # <<<<<<<<<<<<<< @@ -751,7 +747,7 @@ typedef npy_int32 __pyx_t_7sklearn_4tree_10_criterion_INT32_t; */ typedef npy_uint32 __pyx_t_7sklearn_4tree_10_criterion_UINT32_t; -/* "_splitter.pxd":17 +/* "sklearn/tree/_splitter.pxd":17 * from ._criterion cimport Criterion * * ctypedef np.npy_float32 DTYPE_t # Type of X # <<<<<<<<<<<<<< @@ -760,7 +756,7 @@ typedef npy_uint32 __pyx_t_7sklearn_4tree_10_criterion_UINT32_t; */ typedef npy_float32 __pyx_t_7sklearn_4tree_9_splitter_DTYPE_t; -/* "_splitter.pxd":18 +/* "sklearn/tree/_splitter.pxd":18 * * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight # <<<<<<<<<<<<<< @@ -769,7 +765,7 @@ typedef npy_float32 __pyx_t_7sklearn_4tree_9_splitter_DTYPE_t; */ typedef npy_float64 __pyx_t_7sklearn_4tree_9_splitter_DOUBLE_t; -/* "_splitter.pxd":19 +/* "sklearn/tree/_splitter.pxd":19 * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters # <<<<<<<<<<<<<< @@ -778,7 +774,7 @@ typedef npy_float64 __pyx_t_7sklearn_4tree_9_splitter_DOUBLE_t; */ typedef npy_intp __pyx_t_7sklearn_4tree_9_splitter_SIZE_t; -/* "_splitter.pxd":20 +/* "sklearn/tree/_splitter.pxd":20 * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer # <<<<<<<<<<<<<< @@ -787,7 +783,7 @@ typedef npy_intp __pyx_t_7sklearn_4tree_9_splitter_SIZE_t; */ typedef npy_int32 __pyx_t_7sklearn_4tree_9_splitter_INT32_t; -/* "_splitter.pxd":21 +/* "sklearn/tree/_splitter.pxd":21 * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer # <<<<<<<<<<<<<< @@ -796,7 +792,7 @@ typedef npy_int32 __pyx_t_7sklearn_4tree_9_splitter_INT32_t; */ typedef npy_uint32 __pyx_t_7sklearn_4tree_9_splitter_UINT32_t; -/* "_utils.pxd":13 +/* "sklearn/tree/_utils.pxd":13 * cimport numpy as np * * ctypedef np.npy_float32 DTYPE_t # Type of X # <<<<<<<<<<<<<< @@ -805,7 +801,7 @@ typedef npy_uint32 __pyx_t_7sklearn_4tree_9_splitter_UINT32_t; */ typedef npy_float32 __pyx_t_7sklearn_4tree_6_utils_DTYPE_t; -/* "_utils.pxd":14 +/* "sklearn/tree/_utils.pxd":14 * * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight # <<<<<<<<<<<<<< @@ -814,7 +810,7 @@ typedef npy_float32 __pyx_t_7sklearn_4tree_6_utils_DTYPE_t; */ typedef npy_float64 __pyx_t_7sklearn_4tree_6_utils_DOUBLE_t; -/* "_utils.pxd":15 +/* "sklearn/tree/_utils.pxd":15 * ctypedef np.npy_float32 DTYPE_t # Type of X * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters # <<<<<<<<<<<<<< @@ -823,7 +819,7 @@ typedef npy_float64 __pyx_t_7sklearn_4tree_6_utils_DOUBLE_t; */ typedef npy_intp __pyx_t_7sklearn_4tree_6_utils_SIZE_t; -/* "_utils.pxd":16 +/* "sklearn/tree/_utils.pxd":16 * ctypedef np.npy_float64 DOUBLE_t # Type of y, sample_weight * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer # <<<<<<<<<<<<<< @@ -832,7 +828,7 @@ typedef npy_intp __pyx_t_7sklearn_4tree_6_utils_SIZE_t; */ typedef npy_int32 __pyx_t_7sklearn_4tree_6_utils_INT32_t; -/* "_utils.pxd":17 +/* "sklearn/tree/_utils.pxd":17 * ctypedef np.npy_intp SIZE_t # Type for indices and counters * ctypedef np.npy_int32 INT32_t # Signed 32 bit integer * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer # <<<<<<<<<<<<<< @@ -916,7 +912,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder; struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -925,7 +921,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -934,7 +930,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -943,7 +939,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -953,7 +949,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_t_7sklearn_4tree_9_splitter_SplitRecord; -/* "_splitter.pxd":23 +/* "sklearn/tree/_splitter.pxd":23 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef struct SplitRecord: # <<<<<<<<<<<<<< @@ -971,7 +967,7 @@ struct __pyx_t_7sklearn_4tree_9_splitter_SplitRecord { struct __pyx_t_7sklearn_4tree_6_utils_StackRecord; struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord; -/* "_utils.pxd":19 +/* "sklearn/tree/_utils.pxd":19 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef enum: # <<<<<<<<<<<<<< @@ -982,7 +978,7 @@ enum { __pyx_e_7sklearn_4tree_6_utils_RAND_R_MAX = 0x7FFFFFFF }; -/* "_utils.pxd":58 +/* "sklearn/tree/_utils.pxd":58 * * # A record on the stack for depth-first tree growing * cdef struct StackRecord: # <<<<<<<<<<<<<< @@ -999,7 +995,7 @@ struct __pyx_t_7sklearn_4tree_6_utils_StackRecord { __pyx_t_7sklearn_4tree_6_utils_SIZE_t n_constant_features; }; -/* "_utils.pxd":84 +/* "sklearn/tree/_utils.pxd":84 * * # A record on the frontier for best-first tree growing * cdef struct PriorityHeapRecord: # <<<<<<<<<<<<<< @@ -1102,7 +1098,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build { PyArrayObject *sample_weight; }; -/* "_criterion.pxd":21 +/* "sklearn/tree/_criterion.pxd":21 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef class Criterion: # <<<<<<<<<<<<<< @@ -1125,10 +1121,16 @@ struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion { double weighted_n_node_samples; double weighted_n_left; double weighted_n_right; + double *node_value; + double *node_value_left; + double *node_value_right; + double yw_sq_sum; + double yw_sq_sum_left; + double yw_sq_sum_right; }; -/* "_splitter.pxd":34 +/* "sklearn/tree/_splitter.pxd":34 * double impurity_right # Impurity of the right split. * * cdef class Splitter: # <<<<<<<<<<<<<< @@ -1159,7 +1161,7 @@ struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter { }; -/* "_utils.pxd":67 +/* "sklearn/tree/_utils.pxd":67 * SIZE_t n_constant_features * * cdef class Stack: # <<<<<<<<<<<<<< @@ -1175,7 +1177,7 @@ struct __pyx_obj_7sklearn_4tree_6_utils_Stack { }; -/* "_utils.pxd":96 +/* "sklearn/tree/_utils.pxd":96 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -1258,7 +1260,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder { -/* "_criterion.pxd":21 +/* "sklearn/tree/_criterion.pxd":21 * ctypedef np.npy_uint32 UINT32_t # Unsigned 32 bit integer * * cdef class Criterion: # <<<<<<<<<<<<<< @@ -1273,14 +1275,13 @@ struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion { void (*update)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, __pyx_t_7sklearn_4tree_10_criterion_SIZE_t); double (*node_impurity)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *); void (*children_impurity)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *, double *); - void (*node_value)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double *); double (*impurity_improvement)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *, double); double (*proxy_impurity_improvement)(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion *); }; static struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion *__pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion; -/* "_splitter.pxd":34 +/* "sklearn/tree/_splitter.pxd":34 * double impurity_right # Impurity of the right split. * * cdef class Splitter: # <<<<<<<<<<<<<< @@ -1298,7 +1299,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_9_splitter_Splitter { static struct __pyx_vtabstruct_7sklearn_4tree_9_splitter_Splitter *__pyx_vtabptr_7sklearn_4tree_9_splitter_Splitter; -/* "_utils.pxd":67 +/* "sklearn/tree/_utils.pxd":67 * SIZE_t n_constant_features * * cdef class Stack: # <<<<<<<<<<<<<< @@ -1314,7 +1315,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack { static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7sklearn_4tree_6_utils_Stack; -/* "_utils.pxd":96 +/* "sklearn/tree/_utils.pxd":96 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -1417,19 +1418,19 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ } #else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif - #define __Pyx_RefNannyFinishContext()\ + #define __Pyx_RefNannyFinishContext() \ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) @@ -1452,13 +1453,13 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) @@ -1491,8 +1492,8 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, @@ -1554,25 +1555,25 @@ static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* o static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); @@ -1608,8 +1609,6 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable); static void* __Pyx_GetVtable(PyObject *dict); -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { @@ -1629,6 +1628,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + typedef struct { Py_ssize_t shape, strides, suboffsets; } __Pyx_Buf_DimInfo; @@ -1658,7 +1659,7 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); -static CYTHON_INLINE long __Pyx_pow_long(long, long); +static CYTHON_INLINE long __Pyx_pow_long(long, long); /* proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); @@ -1772,8 +1773,6 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do #endif #endif -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); @@ -1812,15 +1811,37 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru /* Module declarations from 'cpython.buffer' */ +/* Module declarations from 'cpython.ref' */ + /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ +/* Module declarations from 'cpython.object' */ + /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'sklearn.tree._criterion' */ +static PyTypeObject *__pyx_ptype_7sklearn_4tree_10_criterion_Criterion = 0; + +/* Module declarations from 'sklearn.tree._splitter' */ +static PyTypeObject *__pyx_ptype_7sklearn_4tree_9_splitter_Splitter = 0; + /* Module declarations from 'cpython.version' */ /* Module declarations from 'cpython.exc' */ @@ -1889,28 +1910,6 @@ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; /* Module declarations from 'cpython' */ -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - -/* Module declarations from 'libc.stdlib' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from 'sklearn.tree._criterion' */ -static PyTypeObject *__pyx_ptype_7sklearn_4tree_10_criterion_Criterion = 0; - -/* Module declarations from 'sklearn.tree._splitter' */ -static PyTypeObject *__pyx_ptype_7sklearn_4tree_9_splitter_Splitter = 0; - /* Module declarations from 'sklearn.tree._utils' */ static PyTypeObject *__pyx_ptype_7sklearn_4tree_6_utils_Stack = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap = 0; @@ -1946,6 +1945,46 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_sample_weight); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_splitter, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, double __pyx_v_min_weight_leaf, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_depth); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_sample_weight); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_splitter, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, PyObject *__pyx_v_min_weight_leaf, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_depth, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_leaf_nodes); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_sample_weight); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, int __pyx_v_n_features, PyArrayObject *__pyx_v_n_classes, int __pyx_v_n_outputs); /* proto */ +static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_X); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_X); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importances(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_normalize); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Tree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_DepthFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static char __pyx_k_B[] = "B"; static char __pyx_k_C[] = "C"; static char __pyx_k_H[] = "H"; @@ -2155,46 +2194,6 @@ static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_weighted_n_node_samples; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_zeros; -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_sample_weight); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_splitter, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, double __pyx_v_min_weight_leaf, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_depth); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_sample_weight); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter *__pyx_v_splitter, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, PyObject *__pyx_v_min_weight_leaf, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_depth, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_leaf_nodes); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_sample_weight); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, int __pyx_v_n_features, PyArrayObject *__pyx_v_n_classes, int __pyx_v_n_outputs); /* proto */ -static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_X); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_X); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importances(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_normalize); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity___get__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Tree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_DepthFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_neg_1; @@ -2648,15 +2647,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_X, __pyx_n_s_data, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "sklearn/tree/_tree.pyx":104 - * X.sort_indices() - * - * if X.data.dtype != DTYPE: # <<<<<<<<<<<<<< - * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) - * - */ + goto __pyx_L4; } + __pyx_L4:; /* "sklearn/tree/_tree.pyx":107 * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) @@ -2716,23 +2709,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":107 - * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) - * - * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: # <<<<<<<<<<<<<< - * raise ValueError("No support for np.int64 index based " - * "sparse matrices") - */ } - - /* "sklearn/tree/_tree.pyx":100 - * np.ndarray sample_weight): - * """Check input dtype, layout and format""" - * if issparse(X): # <<<<<<<<<<<<<< - * X = X.tocsc() - * X.sort_indices() - */ goto __pyx_L3; } @@ -2784,14 +2761,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_1); __pyx_t_1 = 0; - - /* "sklearn/tree/_tree.pyx":111 - * "sparse matrices") - * - * elif X.dtype != DTYPE: # <<<<<<<<<<<<<< - * # since we have to copy we will make it fortran for efficiency - * X = np.asfortranarray(X, dtype=DTYPE) - */ + goto __pyx_L3; } __pyx_L3:; @@ -2859,15 +2829,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - - /* "sklearn/tree/_tree.pyx":115 - * X = np.asfortranarray(X, dtype=DTYPE) - * - * if y.dtype != DOUBLE or not y.flags.contiguous: # <<<<<<<<<<<<<< - * y = np.ascontiguousarray(y, dtype=DOUBLE) - * - */ + goto __pyx_L8; } + __pyx_L8:; /* "sklearn/tree/_tree.pyx":118 * y = np.ascontiguousarray(y, dtype=DOUBLE) @@ -2923,14 +2887,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __pyx_t_7 = ((!__pyx_t_6) != 0); __pyx_t_5 = __pyx_t_7; __pyx_L12_bool_binop_done:; - - /* "sklearn/tree/_tree.pyx":118 - * y = np.ascontiguousarray(y, dtype=DOUBLE) - * - * if (sample_weight is not None and # <<<<<<<<<<<<<< - * (sample_weight.dtype != DOUBLE or - * not sample_weight.flags.contiguous)): - */ if (__pyx_t_5) { /* "sklearn/tree/_tree.pyx":121 @@ -2965,15 +2921,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "sklearn/tree/_tree.pyx":118 - * y = np.ascontiguousarray(y, dtype=DOUBLE) - * - * if (sample_weight is not None and # <<<<<<<<<<<<<< - * (sample_weight.dtype != DOUBLE or - * not sample_weight.flags.contiguous)): - */ + goto __pyx_L11; } + __pyx_L11:; /* "sklearn/tree/_tree.pyx":124 * order="C") @@ -3426,15 +3376,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * # Initial capacity */ __pyx_v_sample_weight_ptr = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_sample_weight->data); - - /* "sklearn/tree/_tree.pyx":148 - * - * cdef DOUBLE_t* sample_weight_ptr = NULL - * if sample_weight is not None: # <<<<<<<<<<<<<< - * sample_weight_ptr = sample_weight.data - * - */ + goto __pyx_L5; } + __pyx_L5:; /* "sklearn/tree/_tree.pyx":154 * cdef int init_capacity @@ -3454,25 +3398,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * init_capacity = 2047 */ __pyx_v_init_capacity = (__Pyx_pow_long(2, (__pyx_v_tree->max_depth + 1)) - 1); - - /* "sklearn/tree/_tree.pyx":154 - * cdef int init_capacity - * - * if tree.max_depth <= 10: # <<<<<<<<<<<<<< - * init_capacity = (2 ** (tree.max_depth + 1)) - 1 - * else: - */ goto __pyx_L6; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":157 + /* "sklearn/tree/_tree.pyx":157 * init_capacity = (2 ** (tree.max_depth + 1)) - 1 * else: * init_capacity = 2047 # <<<<<<<<<<<<<< * * tree._resize(init_capacity) */ - /*else*/ { __pyx_v_init_capacity = 2047; } __pyx_L6:; @@ -3617,7 +3553,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sklearn_4tree_6_utils_Stack), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_Stack)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_stack = ((struct __pyx_obj_7sklearn_4tree_6_utils_Stack *)__pyx_t_1); @@ -3650,14 +3586,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * with nogil: */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":195 - * # push root node onto stack - * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) - * if rc == -1: # <<<<<<<<<<<<<< - * # got return code -1 - out-of-memory - * raise MemoryError() - */ } /* "sklearn/tree/_tree.pyx":199 @@ -3863,15 +3791,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) */ __pyx_v_first = 0; - - /* "sklearn/tree/_tree.pyx":219 - * (weighted_n_node_samples < min_weight_leaf)) - * - * if first: # <<<<<<<<<<<<<< - * impurity = splitter.node_impurity() - * first = 0 - */ - } + goto __pyx_L17; + } + __pyx_L17:; /* "sklearn/tree/_tree.pyx":223 * first = 0 @@ -3927,15 +3849,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_t_8; __pyx_L21_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - - /* "sklearn/tree/_tree.pyx":225 - * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) - * - * if not is_leaf: # <<<<<<<<<<<<<< - * splitter.node_split(impurity, &split, &n_constant_features) - * is_leaf = is_leaf or (split.pos >= end) - */ + goto __pyx_L20; } + __pyx_L20:; /* "sklearn/tree/_tree.pyx":229 * is_leaf = is_leaf or (split.pos >= end) @@ -3973,14 +3889,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * # Store value for all nodes, to facilitate tree/model */ goto __pyx_L12_break; - - /* "sklearn/tree/_tree.pyx":233 - * weighted_n_node_samples) - * - * if node_id == (-1): # <<<<<<<<<<<<<< - * rc = -1 - * break - */ } /* "sklearn/tree/_tree.pyx":239 @@ -4029,14 +3937,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * # Push left child on stack */ goto __pyx_L12_break; - - /* "sklearn/tree/_tree.pyx":245 - * rc = stack.push(split.pos, end, depth + 1, node_id, 0, - * split.impurity_right, n_constant_features) - * if rc == -1: # <<<<<<<<<<<<<< - * break - * - */ } /* "sklearn/tree/_tree.pyx":249 @@ -4066,24 +3966,10 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * if depth > max_depth_seen: */ goto __pyx_L12_break; - - /* "sklearn/tree/_tree.pyx":251 - * rc = stack.push(start, split.pos, depth + 1, node_id, 1, - * split.impurity_left, n_constant_features) - * if rc == -1: # <<<<<<<<<<<<<< - * break - * - */ } - - /* "sklearn/tree/_tree.pyx":241 - * splitter.node_value(tree.value + node_id * tree.value_stride) - * - * if not is_leaf: # <<<<<<<<<<<<<< - * # Push right child on stack - * rc = stack.push(split.pos, end, depth + 1, node_id, 0, - */ + goto __pyx_L24; } + __pyx_L24:; /* "sklearn/tree/_tree.pyx":254 * break @@ -4103,15 +3989,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * if rc >= 0: */ __pyx_v_max_depth_seen = __pyx_v_depth; - - /* "sklearn/tree/_tree.pyx":254 - * break - * - * if depth > max_depth_seen: # <<<<<<<<<<<<<< - * max_depth_seen = depth - * - */ + goto __pyx_L27; } + __pyx_L27:; } __pyx_L12_break:; @@ -4136,15 +4016,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_15.capacity = __pyx_v_tree->node_count; __pyx_t_14 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize_c(__pyx_v_tree, &__pyx_t_15); __pyx_v_rc = __pyx_t_14; - - /* "sklearn/tree/_tree.pyx":257 - * max_depth_seen = depth - * - * if rc >= 0: # <<<<<<<<<<<<<< - * rc = tree._resize_c(tree.node_count) - * - */ + goto __pyx_L28; } + __pyx_L28:; /* "sklearn/tree/_tree.pyx":260 * rc = tree._resize_c(tree.node_count) @@ -4164,15 +4038,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * raise MemoryError() */ __pyx_v_tree->max_depth = __pyx_v_max_depth_seen; - - /* "sklearn/tree/_tree.pyx":260 - * rc = tree._resize_c(tree.node_count) - * - * if rc >= 0: # <<<<<<<<<<<<<< - * tree.max_depth = max_depth_seen - * if rc == -1: - */ + goto __pyx_L29; } + __pyx_L29:; } /* "sklearn/tree/_tree.pyx":199 @@ -4211,14 +4079,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":262 - * if rc >= 0: - * tree.max_depth = max_depth_seen - * if rc == -1: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ } /* "sklearn/tree/_tree.pyx":140 @@ -4843,15 +4703,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * # Parameters */ __pyx_v_sample_weight_ptr = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_sample_weight->data); - - /* "sklearn/tree/_tree.pyx":305 - * - * cdef DOUBLE_t* sample_weight_ptr = NULL - * if sample_weight is not None: # <<<<<<<<<<<<<< - * sample_weight_ptr = sample_weight.data - * - */ + goto __pyx_L5; } + __pyx_L5:; /* "sklearn/tree/_tree.pyx":309 * @@ -4928,7 +4782,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_frontier = ((struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_t_1); @@ -5030,15 +4884,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * raise MemoryError() */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree__add_to_frontier((&__pyx_v_split_node_left), __pyx_v_frontier); - - /* "sklearn/tree/_tree.pyx":339 - * INFINITY, IS_FIRST, IS_LEFT, NULL, 0, - * &split_node_left) - * if rc >= 0: # <<<<<<<<<<<<<< - * rc = _add_to_frontier(&split_node_left, frontier) - * if rc == -1: - */ + goto __pyx_L9; } + __pyx_L9:; } /* "sklearn/tree/_tree.pyx":334 @@ -5077,14 +4925,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * with nogil: */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":341 - * if rc >= 0: - * rc = _add_to_frontier(&split_node_left, frontier) - * if rc == -1: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ } /* "sklearn/tree/_tree.pyx":344 @@ -5193,25 +5033,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * else: */ __pyx_v_node->threshold = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; - - /* "sklearn/tree/_tree.pyx":351 - * is_leaf = (record.is_leaf or max_split_nodes <= 0) - * - * if is_leaf: # <<<<<<<<<<<<<< - * # Node is not expandable; set node as leaf - * node.left_child = _TREE_LEAF - */ goto __pyx_L18; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":362 + /* "sklearn/tree/_tree.pyx":362 * * # Decrement number of split nodes available * max_split_nodes -= 1 # <<<<<<<<<<<<<< * * # Compute left split node */ - /*else*/ { __pyx_v_max_split_nodes = (__pyx_v_max_split_nodes - 1); /* "sklearn/tree/_tree.pyx":365 @@ -5241,14 +5073,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * # tree.nodes may have changed */ goto __pyx_L15_break; - - /* "sklearn/tree/_tree.pyx":371 - * record.depth + 1, - * &split_node_left) - * if rc == -1: # <<<<<<<<<<<<<< - * break - * - */ } /* "sklearn/tree/_tree.pyx":375 @@ -5287,14 +5111,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * # Add nodes to queue */ goto __pyx_L15_break; - - /* "sklearn/tree/_tree.pyx":384 - * record.depth + 1, - * &split_node_right) - * if rc == -1: # <<<<<<<<<<<<<< - * break - * - */ } /* "sklearn/tree/_tree.pyx":388 @@ -5324,14 +5140,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * rc = _add_to_frontier(&split_node_right, frontier) */ goto __pyx_L15_break; - - /* "sklearn/tree/_tree.pyx":389 - * # Add nodes to queue - * rc = _add_to_frontier(&split_node_left, frontier) - * if rc == -1: # <<<<<<<<<<<<<< - * break - * - */ } /* "sklearn/tree/_tree.pyx":392 @@ -5361,14 +5169,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * if record.depth > max_depth_seen: */ goto __pyx_L15_break; - - /* "sklearn/tree/_tree.pyx":393 - * - * rc = _add_to_frontier(&split_node_right, frontier) - * if rc == -1: # <<<<<<<<<<<<<< - * break - * - */ } } __pyx_L18:; @@ -5392,15 +5192,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_t_13 = __pyx_v_record.depth; __pyx_v_max_depth_seen = __pyx_t_13; - - /* "sklearn/tree/_tree.pyx":396 - * break - * - * if record.depth > max_depth_seen: # <<<<<<<<<<<<<< - * max_depth_seen = record.depth - * - */ + goto __pyx_L23; } + __pyx_L23:; } __pyx_L15_break:; @@ -5425,15 +5219,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_15.capacity = __pyx_v_tree->node_count; __pyx_t_14 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize_c(__pyx_v_tree, &__pyx_t_15); __pyx_v_rc = __pyx_t_14; - - /* "sklearn/tree/_tree.pyx":399 - * max_depth_seen = record.depth - * - * if rc >= 0: # <<<<<<<<<<<<<< - * rc = tree._resize_c(tree.node_count) - * - */ + goto __pyx_L24; } + __pyx_L24:; /* "sklearn/tree/_tree.pyx":402 * rc = tree._resize_c(tree.node_count) @@ -5453,15 +5241,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * if rc == -1: */ __pyx_v_tree->max_depth = __pyx_v_max_depth_seen; - - /* "sklearn/tree/_tree.pyx":402 - * rc = tree._resize_c(tree.node_count) - * - * if rc >= 0: # <<<<<<<<<<<<<< - * tree.max_depth = max_depth_seen - * - */ + goto __pyx_L25; } + __pyx_L25:; } /* "sklearn/tree/_tree.pyx":344 @@ -5500,14 +5282,6 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":405 - * tree.max_depth = max_depth_seen - * - * if rc == -1: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ } /* "sklearn/tree/_tree.pyx":297 @@ -5744,15 +5518,9 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a * n_node_samples = end - start */ __pyx_v_impurity = ((struct __pyx_vtabstruct_7sklearn_4tree_9_splitter_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_impurity(__pyx_v_splitter); - - /* "sklearn/tree/_tree.pyx":426 - * splitter.node_reset(start, end, &weighted_n_node_samples) - * - * if is_first: # <<<<<<<<<<<<<< - * impurity = splitter.node_impurity() - * - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_tree.pyx":429 * impurity = splitter.node_impurity() @@ -5867,15 +5635,9 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = __pyx_t_3; __pyx_L10_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":436 - * (impurity <= MIN_IMPURITY_SPLIT)) - * - * if not is_leaf: # <<<<<<<<<<<<<< - * splitter.node_split(impurity, &split, &n_constant_features) - * is_leaf = is_leaf or (split.pos >= end) - */ + goto __pyx_L9; } + __pyx_L9:; /* "sklearn/tree/_tree.pyx":441 * @@ -5934,14 +5696,6 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_r = -1; goto __pyx_L0; - - /* "sklearn/tree/_tree.pyx":446 - * split.feature, split.threshold, impurity, n_node_samples, - * weighted_n_node_samples) - * if node_id == (-1): # <<<<<<<<<<<<<< - * return -1 - * - */ } /* "sklearn/tree/_tree.pyx":450 @@ -6056,25 +5810,17 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_t_1 = __pyx_v_split.impurity_right; __pyx_v_res->impurity_right = __pyx_t_1; - - /* "sklearn/tree/_tree.pyx":458 - * res.impurity = impurity - * - * if not is_leaf: # <<<<<<<<<<<<<< - * # is split node - * res.pos = split.pos - */ goto __pyx_L13; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":468 + /* "sklearn/tree/_tree.pyx":468 * else: * # is leaf => 0 improvement * res.pos = end # <<<<<<<<<<<<<< * res.is_leaf = 1 * res.improvement = 0.0 */ - /*else*/ { __pyx_v_res->pos = __pyx_v_end; /* "sklearn/tree/_tree.pyx":469 @@ -6886,7 +6632,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle PyObject *__pyx_t_4 = NULL; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_5; int __pyx_t_6; - Py_ssize_t __pyx_t_7; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7267,9 +7013,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_7sklearn_4tree_5_tree_Tree)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7sklearn_4tree_5_tree_Tree)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7sklearn_4tree_5_tree_Tree)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); @@ -7479,7 +7225,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx * raise ValueError('You have loaded Tree version which ' * 'cannot be imported') */ - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_nodes, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_nodes, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { @@ -7495,14 +7241,6 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":624 - * self.node_count = d["node_count"] - * - * if 'nodes' not in d: # <<<<<<<<<<<<<< - * raise ValueError('You have loaded Tree version which ' - * 'cannot be imported') - */ } /* "sklearn/tree/_tree.pyx":628 @@ -7698,14 +7436,6 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L5_bool_binop_done:; - - /* "sklearn/tree/_tree.pyx":633 - * value_shape = (node_ndarray.shape[0], self.n_outputs, - * self.max_n_classes) - * if (node_ndarray.ndim != 1 or # <<<<<<<<<<<<<< - * node_ndarray.dtype != NODE_DTYPE or - * not node_ndarray.flags.c_contiguous or - */ if (__pyx_t_4) { /* "sklearn/tree/_tree.pyx":639 @@ -7720,14 +7450,6 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":633 - * value_shape = (node_ndarray.shape[0], self.n_outputs, - * self.max_n_classes) - * if (node_ndarray.ndim != 1 or # <<<<<<<<<<<<<< - * node_ndarray.dtype != NODE_DTYPE or - * not node_ndarray.flags.c_contiguous or - */ } /* "sklearn/tree/_tree.pyx":641 @@ -7782,14 +7504,6 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":642 - * - * self.capacity = node_ndarray.shape[0] - * if self._resize_c(self.capacity) != 0: # <<<<<<<<<<<<<< - * raise MemoryError("resizing tree to %d" % self.capacity) - * nodes = memcpy(self.nodes, ( node_ndarray).data, - */ } /* "sklearn/tree/_tree.pyx":644 @@ -7876,14 +7590,6 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":652 - * """Resize all inner arrays to `capacity`, if `capacity` == -1, then - * double the size of the inner arrays.""" - * if self._resize_c(capacity) != 0: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ } /* "sklearn/tree/_tree.pyx":649 @@ -7949,14 +7655,6 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_r = 0; goto __pyx_L0; - - /* "sklearn/tree/_tree.pyx":659 - * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: - * """Guts of _resize. Returns 0 for success, -1 for error.""" - * if capacity == self.capacity and self.nodes != NULL: # <<<<<<<<<<<<<< - * return 0 - * - */ } /* "sklearn/tree/_tree.pyx":662 @@ -7987,37 +7685,23 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea * capacity = 2 * self.capacity */ __pyx_v_capacity = 3; - - /* "sklearn/tree/_tree.pyx":663 - * - * if capacity == (-1): - * if self.capacity == 0: # <<<<<<<<<<<<<< - * capacity = 3 # default initial value - * else: - */ goto __pyx_L7; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":666 + /* "sklearn/tree/_tree.pyx":666 * capacity = 3 # default initial value * else: * capacity = 2 * self.capacity # <<<<<<<<<<<<<< * * # XXX no safe_realloc here because we need to grab the GIL */ - /*else*/ { __pyx_v_capacity = (2 * __pyx_v_self->capacity); } __pyx_L7:; - - /* "sklearn/tree/_tree.pyx":662 - * return 0 - * - * if capacity == (-1): # <<<<<<<<<<<<<< - * if self.capacity == 0: - * capacity = 3 # default initial value - */ + goto __pyx_L6; } + __pyx_L6:; /* "sklearn/tree/_tree.pyx":669 * @@ -8047,15 +7731,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_r = -1; goto __pyx_L0; - - /* "sklearn/tree/_tree.pyx":670 - * # XXX no safe_realloc here because we need to grab the GIL - * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) - * if ptr == NULL: # <<<<<<<<<<<<<< - * return -1 - * self.nodes = ptr - */ - } + } /* "sklearn/tree/_tree.pyx":672 * if ptr == NULL: @@ -8094,14 +7770,6 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_r = -1; goto __pyx_L0; - - /* "sklearn/tree/_tree.pyx":675 - * ptr = realloc(self.value, - * capacity * self.value_stride * sizeof(double)) - * if ptr == NULL: # <<<<<<<<<<<<<< - * return -1 - * self.value = ptr - */ } /* "sklearn/tree/_tree.pyx":677 @@ -8131,15 +7799,9 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea * sizeof(double)) */ memset(((void *)(__pyx_v_self->value + (__pyx_v_self->capacity * __pyx_v_self->value_stride))), 0, (((__pyx_v_capacity - __pyx_v_self->capacity) * __pyx_v_self->value_stride) * (sizeof(double)))); - - /* "sklearn/tree/_tree.pyx":680 - * - * # value memory is initialised to 0 to enable classifier argmax - * if capacity > self.capacity: # <<<<<<<<<<<<<< - * memset((self.value + self.capacity * self.value_stride), 0, - * (capacity - self.capacity) * self.value_stride * - */ + goto __pyx_L10; } + __pyx_L10:; /* "sklearn/tree/_tree.pyx":686 * @@ -8159,15 +7821,9 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea * self.capacity = capacity */ __pyx_v_self->node_count = __pyx_v_capacity; - - /* "sklearn/tree/_tree.pyx":686 - * - * # if capacity smaller than node_count, adjust the counter - * if capacity < self.node_count: # <<<<<<<<<<<<<< - * self.node_count = capacity - * - */ + goto __pyx_L11; } + __pyx_L11:; /* "sklearn/tree/_tree.pyx":689 * self.node_count = capacity @@ -8255,24 +7911,10 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_r = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1); goto __pyx_L0; - - /* "sklearn/tree/_tree.pyx":704 - * - * if node_id >= self.capacity: - * if self._resize_c() != 0: # <<<<<<<<<<<<<< - * return (-1) - * - */ } - - /* "sklearn/tree/_tree.pyx":703 - * cdef SIZE_t node_id = self.node_count - * - * if node_id >= self.capacity: # <<<<<<<<<<<<<< - * if self._resize_c() != 0: - * return (-1) - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_tree.pyx":707 * return (-1) @@ -8338,37 +7980,23 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ * self.nodes[parent].right_child = node_id */ (__pyx_v_self->nodes[__pyx_v_parent]).left_child = __pyx_v_node_id; - - /* "sklearn/tree/_tree.pyx":713 - * - * if parent != _TREE_UNDEFINED: - * if is_left: # <<<<<<<<<<<<<< - * self.nodes[parent].left_child = node_id - * else: - */ goto __pyx_L6; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":716 + /* "sklearn/tree/_tree.pyx":716 * self.nodes[parent].left_child = node_id * else: * self.nodes[parent].right_child = node_id # <<<<<<<<<<<<<< * * if is_leaf: */ - /*else*/ { (__pyx_v_self->nodes[__pyx_v_parent]).right_child = __pyx_v_node_id; } __pyx_L6:; - - /* "sklearn/tree/_tree.pyx":712 - * node.weighted_n_node_samples = weighted_n_node_samples - * - * if parent != _TREE_UNDEFINED: # <<<<<<<<<<<<<< - * if is_left: - * self.nodes[parent].left_child = node_id - */ + goto __pyx_L5; } + __pyx_L5:; /* "sklearn/tree/_tree.pyx":718 * self.nodes[parent].right_child = node_id @@ -8415,25 +8043,17 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ * else: */ __pyx_v_node->threshold = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; - - /* "sklearn/tree/_tree.pyx":718 - * self.nodes[parent].right_child = node_id - * - * if is_leaf: # <<<<<<<<<<<<<< - * node.left_child = _TREE_LEAF - * node.right_child = _TREE_LEAF - */ goto __pyx_L7; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":726 + /* "sklearn/tree/_tree.pyx":726 * else: * # left_child and right_child will be set later * node.feature = feature # <<<<<<<<<<<<<< * node.threshold = threshold * */ - /*else*/ { __pyx_v_node->feature = __pyx_v_feature; /* "sklearn/tree/_tree.pyx":727 @@ -8633,15 +8253,9 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_5); __pyx_t_5 = 0; - - /* "sklearn/tree/_tree.pyx":737 - * out = self._get_value_ndarray().take(self.apply(X), axis=0, - * mode='clip') - * if self.n_outputs == 1: # <<<<<<<<<<<<<< - * out = out.reshape(X.shape[0], self.max_n_classes) - * return out - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_tree.pyx":739 * if self.n_outputs == 1: @@ -8837,24 +8451,16 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - - /* "sklearn/tree/_tree.pyx":743 - * cpdef np.ndarray apply(self, object X): - * """Finds the terminal region (=leaf node) for each sample in X.""" - * if issparse(X): # <<<<<<<<<<<<<< - * return self._apply_sparse_csr(X) - * else: - */ } + /*else*/ { - /* "sklearn/tree/_tree.pyx":746 + /* "sklearn/tree/_tree.pyx":746 * return self._apply_sparse_csr(X) * else: * return self._apply_dense(X) # <<<<<<<<<<<<<< * * */ - /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -8975,7 +8581,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ * raise ValueError("X should be in np.ndarray format, got %s" * % type(X)) */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_X, __pyx_ptype_5numpy_ndarray); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_X, ((PyObject*)__pyx_ptype_5numpy_ndarray)); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { @@ -9007,14 +8613,6 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":753 - * - * # Check input - * if not isinstance(X, np.ndarray): # <<<<<<<<<<<<<< - * raise ValueError("X should be in np.ndarray format, got %s" - * % type(X)) - */ } /* "sklearn/tree/_tree.pyx":757 @@ -9058,14 +8656,6 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":757 - * % type(X)) - * - * if X.dtype != DTYPE: # <<<<<<<<<<<<<< - * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) - * - */ } /* "sklearn/tree/_tree.pyx":761 @@ -9279,14 +8869,6 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ * else: */ __pyx_t_2 = (((__pyx_v_X_ptr[((__pyx_v_X_sample_stride * __pyx_v_i) + (__pyx_v_X_fx_stride * __pyx_v_node->feature))]) <= __pyx_v_node->threshold) != 0); - - /* "sklearn/tree/_tree.pyx":781 - * while node.left_child != _TREE_LEAF: - * # ... and node.right_child != _TREE_LEAF: - * if X_ptr[X_sample_stride * i + # <<<<<<<<<<<<<< - * X_fx_stride * node.feature] <= node.threshold: - * node = &self.nodes[node.left_child] - */ if (__pyx_t_2) { /* "sklearn/tree/_tree.pyx":783 @@ -9297,25 +8879,17 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ * node = &self.nodes[node.right_child] */ __pyx_v_node = (&(__pyx_v_self->nodes[__pyx_v_node->left_child])); - - /* "sklearn/tree/_tree.pyx":781 - * while node.left_child != _TREE_LEAF: - * # ... and node.right_child != _TREE_LEAF: - * if X_ptr[X_sample_stride * i + # <<<<<<<<<<<<<< - * X_fx_stride * node.feature] <= node.threshold: - * node = &self.nodes[node.left_child] - */ goto __pyx_L12; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":785 + /* "sklearn/tree/_tree.pyx":785 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< * * out_ptr[i] = (node - self.nodes) # node offset */ - /*else*/ { __pyx_v_node = (&(__pyx_v_self->nodes[__pyx_v_node->right_child])); } __pyx_L12:; @@ -9508,14 +9082,6 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":796 - * """ - * # Check input - * if not isinstance(X, csr_matrix): # <<<<<<<<<<<<<< - * raise ValueError("X should be in csr_matrix format, got %s" - * % type(X)) - */ } /* "sklearn/tree/_tree.pyx":800 @@ -9559,14 +9125,6 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":800 - * % type(X)) - * - * if X.dtype != DTYPE: # <<<<<<<<<<<<<< - * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) - * - */ } /* "sklearn/tree/_tree.pyx":804 @@ -9721,6 +9279,8 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); /* "sklearn/tree/_tree.pyx":817 * # Initialize output @@ -9729,14 +9289,12 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru * cdef SIZE_t* out_ptr = out.data * */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_intp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "sklearn/tree/_tree.pyx":816 @@ -9949,25 +9507,17 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru * else: */ __pyx_v_feature_value = (__pyx_v_X_sample[__pyx_v_node->feature]); - - /* "sklearn/tree/_tree.pyx":848 - * while node.left_child != _TREE_LEAF: - * # ... and node.right_child != _TREE_LEAF: - * if feature_to_sample[node.feature] == i: # <<<<<<<<<<<<<< - * feature_value = X_sample[node.feature] - * - */ goto __pyx_L14; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":852 + /* "sklearn/tree/_tree.pyx":852 * * else: * feature_value = 0. # <<<<<<<<<<<<<< * * if feature_value <= node.threshold: */ - /*else*/ { __pyx_v_feature_value = 0.; } __pyx_L14:; @@ -9990,25 +9540,17 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru * node = &self.nodes[node.right_child] */ __pyx_v_node = (&(__pyx_v_self->nodes[__pyx_v_node->left_child])); - - /* "sklearn/tree/_tree.pyx":854 - * feature_value = 0. - * - * if feature_value <= node.threshold: # <<<<<<<<<<<<<< - * node = &self.nodes[node.left_child] - * else: - */ goto __pyx_L15; } + /*else*/ { - /* "sklearn/tree/_tree.pyx":857 + /* "sklearn/tree/_tree.pyx":857 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< * * out_ptr[i] = (node - self.nodes) # node offset */ - /*else*/ { __pyx_v_node = (&(__pyx_v_self->nodes[__pyx_v_node->right_child])); } __pyx_L15:; @@ -10388,15 +9930,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances * node += 1 */ (__pyx_v_importance_data[__pyx_t_13]) = ((__pyx_v_importance_data[__pyx_t_13]) + (((__pyx_v_node->weighted_n_node_samples * __pyx_v_node->impurity) - (__pyx_v_left->weighted_n_node_samples * __pyx_v_left->impurity)) - (__pyx_v_right->weighted_n_node_samples * __pyx_v_right->impurity))); - - /* "sklearn/tree/_tree.pyx":883 - * with nogil: - * while node != end_node: - * if node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< - * # ... and node.right_child != _TREE_LEAF: - * left = &nodes[node.left_child] - */ + goto __pyx_L8; } + __pyx_L8:; /* "sklearn/tree/_tree.pyx":892 * left.weighted_n_node_samples * left.impurity - @@ -10555,24 +10091,12 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; - - /* "sklearn/tree/_tree.pyx":899 - * normalizer = np.sum(importances) - * - * if normalizer > 0.0: # <<<<<<<<<<<<<< - * # Avoid dividing by zero (e.g., when root is pure) - * importances /= normalizer - */ + goto __pyx_L10; } - - /* "sklearn/tree/_tree.pyx":896 - * importances /= nodes[0].weighted_n_node_samples - * - * if normalize: # <<<<<<<<<<<<<< - * normalizer = np.sum(importances) - * - */ + __pyx_L10:; + goto __pyx_L9; } + __pyx_L9:; /* "sklearn/tree/_tree.pyx":903 * importances /= normalizer @@ -10881,7 +10405,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru * Py_INCREF(self) * arr.base = self */ - __pyx_t_2 = PyArray_NewFromDescr(((PyObject *)__pyx_ptype_5numpy_ndarray), ((PyArray_Descr *)__pyx_t_1), 1, __pyx_v_shape, __pyx_v_strides, ((void *)__pyx_v_self->nodes), NPY_DEFAULT, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyArray_NewFromDescr(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyArray_Descr *)__pyx_t_1), 1, __pyx_v_shape, __pyx_v_strides, ((void *)__pyx_v_self->nodes), NPY_DEFAULT, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11436,7 +10960,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -11486,7 +11010,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -11499,7 +11023,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -11508,7 +11032,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -11517,7 +11041,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -11526,7 +11050,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -11536,7 +11060,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -11544,30 +11068,22 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * copy_shape = 0 */ __pyx_v_copy_shape = 1; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ goto __pyx_L4; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - /*else*/ { __pyx_v_copy_shape = 0; } __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11581,7 +11097,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -11591,17 +11107,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -11613,17 +11121,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11637,7 +11137,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -11647,17 +11147,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -11669,17 +11161,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -11688,7 +11172,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -11697,7 +11181,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -11707,7 +11191,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -11716,7 +11200,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -11725,7 +11209,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -11736,7 +11220,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -11745,7 +11229,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -11754,28 +11238,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ goto __pyx_L11; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -11786,7 +11262,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -11795,7 +11271,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -11804,7 +11280,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -11813,28 +11289,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< * cdef dtype descr = self.descr - * cdef int offset + * cdef list stack */ __pyx_v_f = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack * cdef int offset - * */ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); __Pyx_INCREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -11843,7 +11319,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -11861,7 +11337,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -11873,25 +11349,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ goto __pyx_L14; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< * * if not hasfields: */ - /*else*/ { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_info->obj); @@ -11900,7 +11368,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -11910,7 +11378,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -11920,7 +11388,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -11940,7 +11408,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -11956,51 +11424,43 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - } + switch (__pyx_v_t) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" */ - switch (__pyx_v_t) { case NPY_BYTE: __pyx_v_f = __pyx_k_b; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -12011,7 +11471,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -12022,7 +11482,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -12033,7 +11493,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -12044,7 +11504,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -12055,7 +11515,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -12066,7 +11526,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -12077,7 +11537,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -12088,7 +11548,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -12099,7 +11559,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -12110,7 +11570,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -12121,7 +11581,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -12132,7 +11592,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -12143,7 +11603,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -12154,7 +11614,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -12165,7 +11625,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -12177,33 +11637,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -12212,7 +11672,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -12221,27 +11681,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_r = 0; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 */ - /*else*/ { __pyx_v_info->format = ((char *)malloc(255)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -12250,7 +11702,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -12259,17 +11711,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_7; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -12279,7 +11731,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -12311,7 +11763,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -12335,7 +11787,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -12345,7 +11797,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -12353,17 +11805,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * stdlib.free(info.strides) */ free(__pyx_v_info->format); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ + goto __pyx_L3; } + __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -12373,7 +11819,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -12381,17 +11827,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * */ free(__pyx_v_info->strides); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ + goto __pyx_L4; } + __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -12403,7 +11843,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -12420,7 +11860,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -12428,13 +11868,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -12453,7 +11893,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -12470,7 +11910,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -12478,13 +11918,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -12503,7 +11943,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -12520,7 +11960,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -12528,13 +11968,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -12553,7 +11993,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -12570,7 +12010,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -12578,13 +12018,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -12603,7 +12043,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -12620,7 +12060,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -12628,13 +12068,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -12653,7 +12093,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -12685,17 +12125,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":793 + * cdef int delta_offset + * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< * cdef bint little_endian = ((&endian_detector)[0] != 0) * cdef tuple fields */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * cdef tuple fields @@ -12703,7 +12143,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -12712,21 +12152,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -12735,15 +12175,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -12760,7 +12200,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -12768,60 +12208,52 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -12841,7 +12273,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -12857,39 +12289,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -12897,15 +12313,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -12914,7 +12330,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -12923,7 +12339,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -12934,7 +12350,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -12944,7 +12360,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -12954,19 +12370,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -12976,274 +12392,266 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -13252,18 +12660,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -13272,18 +12680,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -13292,49 +12700,49 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L15:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -13342,31 +12750,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * # Cython ignores struct boundary information ("T{...}"), */ __pyx_v_f = (__pyx_v_f + 1); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ goto __pyx_L13; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; } __pyx_L13:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -13376,7 +12776,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -13386,7 +12786,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -13411,7 +12811,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -13426,7 +12826,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -13437,7 +12837,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -13445,28 +12845,20 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a * Py_INCREF(base) # important to do this before decref below! */ __pyx_v_baseptr = NULL; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ goto __pyx_L3; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.base) */ - /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":975 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -13477,7 +12869,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -13486,7 +12878,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -13495,7 +12887,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -13507,7 +12899,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -13521,7 +12913,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -13531,7 +12923,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":981 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -13542,29 +12934,21 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983 * return None * else: * return arr.base # <<<<<<<<<<<<<< */ - /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); __pyx_r = ((PyObject *)__pyx_v_arr->base); goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -13774,9 +13158,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Tree = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -13883,9 +13266,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_TreeBuilder = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -13959,9 +13341,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -14035,9 +13416,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -14207,7 +13587,7 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -14250,7 +13630,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -14261,7 +13641,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -14272,47 +13652,47 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __Pyx_RefNannyFinishContext(); @@ -14367,24 +13747,18 @@ PyMODINIT_FUNC PyInit__tree(void) } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__tree(void)", 0); - if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS @@ -14407,12 +13781,12 @@ PyMODINIT_FUNC PyInit__tree(void) #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_sklearn__tree___tree) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } #if PY_MAJOR_VERSION >= 3 { @@ -14423,9 +13797,9 @@ PyMODINIT_FUNC PyInit__tree(void) } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ @@ -14481,17 +13855,17 @@ PyMODINIT_FUNC PyInit__tree(void) sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_10_criterion_Criterion = __Pyx_ImportType("sklearn.tree._criterion", "Criterion", sizeof(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_10_criterion_Criterion)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion = (struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_10_criterion_Criterion->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_9_splitter_Splitter = __Pyx_ImportType("sklearn.tree._splitter", "Splitter", sizeof(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_9_splitter_Splitter)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_7sklearn_4tree_9_splitter_Splitter = (struct __pyx_vtabstruct_7sklearn_4tree_9_splitter_Splitter*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_9_splitter_Splitter->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_9_splitter_Splitter)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_10_criterion_Criterion = __Pyx_ImportType("sklearn.tree._criterion", "Criterion", sizeof(struct __pyx_obj_7sklearn_4tree_10_criterion_Criterion), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_10_criterion_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion = (struct __pyx_vtabstruct_7sklearn_4tree_10_criterion_Criterion*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_10_criterion_Criterion->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_10_criterion_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_9_splitter_Splitter = __Pyx_ImportType("sklearn.tree._splitter", "Splitter", sizeof(struct __pyx_obj_7sklearn_4tree_9_splitter_Splitter), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_9_splitter_Splitter)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7sklearn_4tree_9_splitter_Splitter = (struct __pyx_vtabstruct_7sklearn_4tree_9_splitter_Splitter*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_9_splitter_Splitter->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_9_splitter_Splitter)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_6_utils_Stack = __Pyx_ImportType("sklearn.tree._utils", "Stack", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_Stack), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_Stack)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_7sklearn_4tree_6_utils_Stack = (struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_6_utils_Stack->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_6_utils_Stack)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap = __Pyx_ImportType("sklearn.tree._utils", "PriorityHeap", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14505,9 +13879,6 @@ PyMODINIT_FUNC PyInit__tree(void) if (__Pyx_ImportFunction(__pyx_t_1, "__pyx_fuse_2safe_realloc", (void (**)(void))&__pyx_fuse_2__pyx_f_7sklearn_4tree_6_utils_safe_realloc, "unsigned char *(unsigned char **, size_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /* "sklearn/tree/_tree.pyx":25 * from libc.string cimport memset @@ -14749,6 +14120,16 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_MIN_IMPURITY_SPLIT = 1e-7; + /* "sklearn/tree/_tree.pyx":69 + * + * # Repeat struct definition for numpy + * NODE_DTYPE = np.dtype({ # <<<<<<<<<<<<<< + * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', + * 'n_node_samples', 'weighted_n_node_samples'], + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + /* "sklearn/tree/_tree.pyx":70 * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ @@ -14756,8 +14137,6 @@ PyMODINIT_FUNC PyInit__tree(void) * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_left_child); @@ -14781,7 +14160,7 @@ PyMODINIT_FUNC PyInit__tree(void) __Pyx_INCREF(__pyx_n_s_weighted_n_node_samples); __Pyx_GIVEREF(__pyx_n_s_weighted_n_node_samples); PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_weighted_n_node_samples); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_names, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_names, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "sklearn/tree/_tree.pyx":72 @@ -14865,7 +14244,7 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_formats, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_formats, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "sklearn/tree/_tree.pyx":75 @@ -14968,7 +14347,7 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_offsets, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_offsets, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "sklearn/tree/_tree.pyx":69 @@ -14983,7 +14362,7 @@ PyMODINIT_FUNC PyInit__tree(void) __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_NODE_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15008,7 +14387,7 @@ PyMODINIT_FUNC PyInit__tree(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -16373,79 +15752,6 @@ static void* __Pyx_GetVtable(PyObject *dict) { return NULL; } -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -16465,7 +15771,7 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return count; } while (start < end) { - mid = start + (end - start) / 2; + mid = (start + end) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { @@ -16618,6 +15924,79 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, Py_XDECREF(py_frame); } +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); @@ -16639,33 +16018,29 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \ + { \ + func_type value = func_value; \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + if (is_unsigned && unlikely(value < zero)) \ + goto raise_neg_overflow; \ + else \ + goto raise_overflow; \ + } \ + } \ + return (target_type) value; \ } -#if CYTHON_USE_PYLONG_INTERNALS +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" + #endif #endif static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -16682,39 +16057,13 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0]) - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -16730,77 +16079,24 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { } #endif if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0]) - case -2: - if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(Py_intptr_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyLong_AsLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -16849,7 +16145,7 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -16866,39 +16162,13 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -16914,77 +16184,24 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { } #endif if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) -(((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) -(((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) -(((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -17049,7 +16266,7 @@ static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { #endif t = 1; while (likely(e)) { - t *= (b * (e&1)) | ((~e)&1); + t *= (b * (e&1)) | ((~e)&1); /* 1 or b */ b *= b; e >>= 1; } @@ -17057,7 +16274,7 @@ static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(Py_intptr_t) < sizeof(long)) { @@ -17083,7 +16300,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { @@ -17109,7 +16326,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { @@ -17135,7 +16352,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(npy_int32) < sizeof(long)) { @@ -17161,7 +16378,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { } static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { - const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0; + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -17178,39 +16395,13 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (npy_int32) 0; - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0]) - case 2: - if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) { - return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) { - return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) { - return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -17226,77 +16417,24 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { } #endif if (sizeof(npy_int32) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (npy_int32) 0; - case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0]) - case -2: - if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) -(((((npy_int32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) -(((((((npy_int32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) -(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) { - return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(npy_int32) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong(x)) } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -17584,34 +16722,8 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { #endif #endif -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -17628,39 +16740,13 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -17676,77 +16762,24 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } #endif if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) -(((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) -(((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) -(((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -17981,7 +17014,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && @@ -18022,7 +17055,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ #endif } else #endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) +#if !CYTHON_COMPILING_IN_PYPY if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); @@ -18052,7 +17085,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { #else if (PyLong_Check(x)) #endif - return __Pyx_NewRef(x); + return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { @@ -18092,55 +17125,18 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); #endif if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - } - } + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif #endif return PyLong_AsSsize_t(b); } diff --git a/sklearn/tree/_utils.c b/sklearn/tree/_utils.c index 745b85292639d..8e6c60dc64556 100644 --- a/sklearn/tree/_utils.c +++ b/sklearn/tree/_utils.c @@ -1,13 +1,25 @@ -/* Generated by Cython 0.23 */ +/* Generated by Cython 0.22.1 */ #define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_23" +#define CYTHON_ABI "0_22_1" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -42,9 +54,6 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 -#define CYTHON_USE_PYLONG_INTERNALS 1 -#endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif @@ -52,12 +61,12 @@ #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif @@ -75,7 +84,7 @@ #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -94,10 +103,12 @@ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) + #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) + #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) @@ -165,32 +176,6 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) - #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ @@ -202,20 +187,46 @@ typedef struct { #define CYTHON_INLINE #endif #endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif #endif -#include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif +#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(T& ref) : ptr(&ref) { } + T *operator->() { return ptr; } + operator T&() { return *ptr; } + private: + T *ptr; +}; +#endif #if PY_MAJOR_VERSION >= 3 @@ -234,6 +245,10 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #endif +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include #define __PYX_HAVE__sklearn__tree___utils #define __PYX_HAVE_API__sklearn__tree___utils #include "string.h" @@ -278,34 +293,16 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) @@ -340,9 +337,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); @@ -476,7 +472,7 @@ static const char *__pyx_f[] = { "type.pxd", }; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -485,7 +481,7 @@ static const char *__pyx_f[] = { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -494,7 +490,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -503,7 +499,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":729 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -512,7 +508,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -521,7 +517,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -530,7 +526,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -539,7 +535,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":736 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -548,7 +544,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -557,7 +553,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":741 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -566,7 +562,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -575,7 +571,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -584,7 +580,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -593,7 +589,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -602,7 +598,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -611,7 +607,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -620,7 +616,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -629,7 +625,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -638,7 +634,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -647,7 +643,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -656,7 +652,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -734,7 +730,7 @@ typedef npy_uint32 __pyx_t_7sklearn_4tree_6_utils_UINT32_t; struct __pyx_obj_7sklearn_4tree_6_utils_Stack; struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -743,7 +739,7 @@ struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -752,7 +748,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -761,7 +757,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -901,19 +897,19 @@ static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtabpt static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ } #else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif - #define __Pyx_RefNannyFinishContext()\ + #define __Pyx_RefNannyFinishContext() \ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) @@ -936,13 +932,13 @@ static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtabpt #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) @@ -979,8 +975,8 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, @@ -1014,8 +1010,6 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static int __Pyx_SetVtable(PyObject *dict, void *vtable); -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - typedef struct { int code_line; PyCodeObject* code_object; @@ -1033,6 +1027,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *); #if CYTHON_CCOMPLEX @@ -1137,8 +1133,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -1170,21 +1164,19 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s /* Module declarations from 'cpython.buffer' */ +/* Module declarations from 'cpython.ref' */ + /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ +/* Module declarations from 'cpython.object' */ + /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'numpy' */ @@ -1216,6 +1208,15 @@ static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_7sklearn_4tree_6_utils__realloc_test(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_6_utils_5Stack___cinit__(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *__pyx_v_self, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_capacity); /* proto */ +static void __pyx_pf_7sklearn_4tree_6_utils_5Stack_2__dealloc__(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_self, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_capacity); /* proto */ +static void __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap_2__dealloc__(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_self); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_7sklearn_4tree_6_utils_Stack(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_6_utils_PriorityHeap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static char __pyx_k_B[] = "B"; static char __pyx_k_H[] = "H"; static char __pyx_k_I[] = "I"; @@ -1250,8 +1251,8 @@ static char __pyx_k_sklearn_tree__utils[] = "sklearn.tree._utils"; static char __pyx_k_could_not_allocate_d_bytes[] = "could not allocate %d bytes"; static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static char __pyx_k_could_not_allocate_d_d_bytes[] = "could not allocate (%d * %d) bytes"; -static char __pyx_k_Users_ogrisel_code_scikit_learn[] = "/Users/ogrisel/code/scikit-learn/sklearn/tree/_utils.pyx"; static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_volatile_jmschrei_Bureau_scikit[] = "/volatile/jmschrei/Bureau/scikit-learn/sklearn/tree/_utils.pyx"; static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; @@ -1261,7 +1262,6 @@ static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_kp_s_Users_ogrisel_code_scikit_learn; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_capacity; static PyObject *__pyx_kp_s_could_not_allocate_d_bytes; @@ -1279,15 +1279,7 @@ static PyObject *__pyx_n_s_realloc_test; static PyObject *__pyx_n_s_sklearn_tree__utils; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_pf_7sklearn_4tree_6_utils__realloc_test(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_6_utils_5Stack___cinit__(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *__pyx_v_self, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_capacity); /* proto */ -static void __pyx_pf_7sklearn_4tree_6_utils_5Stack_2__dealloc__(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_self, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_capacity); /* proto */ -static void __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap_2__dealloc__(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_self); /* proto */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tp_new_7sklearn_4tree_6_utils_Stack(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_6_utils_PriorityHeap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_kp_s_volatile_jmschrei_Bureau_scikit; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; @@ -1379,14 +1371,6 @@ static __pyx_t_7sklearn_4tree_6_utils_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tre __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":30 - * # 0.20.1 to crash. - * cdef size_t nbytes = nelems * sizeof(p[0][0]) - * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< - * # Overflow in the multiplication - * raise MemoryError("could not allocate (%d * %d) bytes" - */ } /* "sklearn/tree/_utils.pyx":34 @@ -1431,14 +1415,6 @@ static __pyx_t_7sklearn_4tree_6_utils_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tre __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":35 - * % (nelems, sizeof(p[0][0]))) - * cdef realloc_ptr tmp = realloc(p[0], nbytes) - * if tmp == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("could not allocate %d bytes" % nbytes) - * - */ } /* "sklearn/tree/_utils.pyx":38 @@ -1554,14 +1530,6 @@ static __pyx_t_7sklearn_4tree_6_utils_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":30 - * # 0.20.1 to crash. - * cdef size_t nbytes = nelems * sizeof(p[0][0]) - * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< - * # Overflow in the multiplication - * raise MemoryError("could not allocate (%d * %d) bytes" - */ } /* "sklearn/tree/_utils.pyx":34 @@ -1606,14 +1574,6 @@ static __pyx_t_7sklearn_4tree_6_utils_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":35 - * % (nelems, sizeof(p[0][0]))) - * cdef realloc_ptr tmp = realloc(p[0], nbytes) - * if tmp == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("could not allocate %d bytes" % nbytes) - * - */ } /* "sklearn/tree/_utils.pyx":38 @@ -1729,14 +1689,6 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_6_utils_safe_realloc(un __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":30 - * # 0.20.1 to crash. - * cdef size_t nbytes = nelems * sizeof(p[0][0]) - * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< - * # Overflow in the multiplication - * raise MemoryError("could not allocate (%d * %d) bytes" - */ } /* "sklearn/tree/_utils.pyx":34 @@ -1781,14 +1733,6 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_6_utils_safe_realloc(un __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":35 - * % (nelems, sizeof(p[0][0]))) - * cdef realloc_ptr tmp = realloc(p[0], nbytes) - * if tmp == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("could not allocate %d bytes" % nbytes) - * - */ } /* "sklearn/tree/_utils.pyx":38 @@ -1914,15 +1858,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_6_utils__realloc_test(CYTHON_UNUSED PyO } } #endif - - /* "sklearn/tree/_utils.pyx":47 - * cdef SIZE_t* p = NULL - * safe_realloc(&p, (-1) / 2) - * if p != NULL: # <<<<<<<<<<<<<< - * free(p) - * assert False - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_utils.pyx":42 * @@ -2286,14 +2224,6 @@ static int __pyx_pf_7sklearn_4tree_6_utils_5Stack___cinit__(struct __pyx_obj_7sk * def __dealloc__(self): */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":110 - * self.top = 0 - * self.stack_ = malloc(capacity * sizeof(StackRecord)) - * if self.stack_ == NULL: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ } /* "sklearn/tree/_utils.pyx":106 @@ -2475,14 +2405,6 @@ static int __pyx_f_7sklearn_4tree_6_utils_5Stack_push(struct __pyx_obj_7sklearn_ */ __pyx_r = -1; goto __pyx_L0; - - /* "sklearn/tree/_utils.pyx":134 - * stack = realloc(self.stack_, - * self.capacity * sizeof(StackRecord)) - * if stack == NULL: # <<<<<<<<<<<<<< - * # no free; __dealloc__ handles that - * return -1 - */ } /* "sklearn/tree/_utils.pyx":137 @@ -2493,15 +2415,9 @@ static int __pyx_f_7sklearn_4tree_6_utils_5Stack_push(struct __pyx_obj_7sklearn_ * stack = self.stack_ */ __pyx_v_self->stack_ = __pyx_v_stack; - - /* "sklearn/tree/_utils.pyx":130 - * - * # Resize if capacity not sufficient - * if top >= self.capacity: # <<<<<<<<<<<<<< - * self.capacity *= 2 - * stack = realloc(self.stack_, - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_utils.pyx":139 * self.stack_ = stack @@ -2663,14 +2579,6 @@ static int __pyx_f_7sklearn_4tree_6_utils_5Stack_pop(struct __pyx_obj_7sklearn_4 */ __pyx_r = -1; goto __pyx_L0; - - /* "sklearn/tree/_utils.pyx":161 - * cdef StackRecord* stack = self.stack_ - * - * if top <= 0: # <<<<<<<<<<<<<< - * return -1 - * - */ } /* "sklearn/tree/_utils.pyx":164 @@ -2746,14 +2654,6 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t * cdef SIZE_t parent_pos = (pos - 1) / 2 */ goto __pyx_L0; - - /* "sklearn/tree/_utils.pyx":177 - * """Restore heap invariant parent.improvement > child.improvement from - * ``pos`` upwards. """ - * if pos == 0: # <<<<<<<<<<<<<< - * return - * - */ } /* "sklearn/tree/_utils.pyx":180 @@ -2795,15 +2695,9 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t * */ __pyx_f_7sklearn_4tree_6_utils_heapify_up(__pyx_v_heap, __pyx_v_parent_pos); - - /* "sklearn/tree/_utils.pyx":182 - * cdef SIZE_t parent_pos = (pos - 1) / 2 - * - * if heap[parent_pos].improvement < heap[pos].improvement: # <<<<<<<<<<<<<< - * heap[parent_pos], heap[pos] = heap[pos], heap[parent_pos] - * heapify_up(heap, parent_pos) - */ + goto __pyx_L4; } + __pyx_L4:; /* "sklearn/tree/_utils.pyx":174 * # ============================================================================= @@ -2885,14 +2779,6 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ __pyx_t_2 = (((__pyx_v_heap[__pyx_v_left_pos]).improvement > (__pyx_v_heap[__pyx_v_largest]).improvement) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - - /* "sklearn/tree/_utils.pyx":195 - * cdef SIZE_t largest = pos - * - * if (left_pos < heap_length and # <<<<<<<<<<<<<< - * heap[left_pos].improvement > heap[largest].improvement): - * largest = left_pos - */ if (__pyx_t_1) { /* "sklearn/tree/_utils.pyx":197 @@ -2903,15 +2789,9 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ * if (right_pos < heap_length and */ __pyx_v_largest = __pyx_v_left_pos; - - /* "sklearn/tree/_utils.pyx":195 - * cdef SIZE_t largest = pos - * - * if (left_pos < heap_length and # <<<<<<<<<<<<<< - * heap[left_pos].improvement > heap[largest].improvement): - * largest = left_pos - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_utils.pyx":199 * largest = left_pos @@ -2937,14 +2817,6 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ __pyx_t_2 = (((__pyx_v_heap[__pyx_v_right_pos]).improvement > (__pyx_v_heap[__pyx_v_largest]).improvement) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - - /* "sklearn/tree/_utils.pyx":199 - * largest = left_pos - * - * if (right_pos < heap_length and # <<<<<<<<<<<<<< - * heap[right_pos].improvement > heap[largest].improvement): - * largest = right_pos - */ if (__pyx_t_1) { /* "sklearn/tree/_utils.pyx":201 @@ -2955,15 +2827,9 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ * if largest != pos: */ __pyx_v_largest = __pyx_v_right_pos; - - /* "sklearn/tree/_utils.pyx":199 - * largest = left_pos - * - * if (right_pos < heap_length and # <<<<<<<<<<<<<< - * heap[right_pos].improvement > heap[largest].improvement): - * largest = right_pos - */ + goto __pyx_L6; } + __pyx_L6:; /* "sklearn/tree/_utils.pyx":203 * largest = right_pos @@ -2995,15 +2861,9 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ * */ __pyx_f_7sklearn_4tree_6_utils_heapify_down(__pyx_v_heap, __pyx_v_largest, __pyx_v_heap_length); - - /* "sklearn/tree/_utils.pyx":203 - * largest = right_pos - * - * if largest != pos: # <<<<<<<<<<<<<< - * heap[pos], heap[largest] = heap[largest], heap[pos] - * heapify_down(heap, largest, heap_length) - */ + goto __pyx_L9; } + __pyx_L9:; /* "sklearn/tree/_utils.pyx":187 * @@ -3130,14 +2990,6 @@ static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx * def __dealloc__(self): */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_utils.pyx":232 - * self.heap_ptr = 0 - * self.heap_ = malloc(capacity * sizeof(PriorityHeapRecord)) - * if self.heap_ == NULL: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ } /* "sklearn/tree/_utils.pyx":228 @@ -3319,14 +3171,6 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ __pyx_r = -1; goto __pyx_L0; - - /* "sklearn/tree/_utils.pyx":258 - * self.capacity * - * sizeof(PriorityHeapRecord)) - * if heap == NULL: # <<<<<<<<<<<<<< - * # no free; __dealloc__ handles that - * return -1 - */ } /* "sklearn/tree/_utils.pyx":261 @@ -3337,15 +3181,9 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 * # Put element as last element of heap */ __pyx_v_self->heap_ = __pyx_v_heap; - - /* "sklearn/tree/_utils.pyx":253 - * - * # Resize if capacity not sufficient - * if heap_ptr >= self.capacity: # <<<<<<<<<<<<<< - * self.capacity *= 2 - * heap = realloc(self.heap_, - */ + goto __pyx_L3; } + __pyx_L3:; /* "sklearn/tree/_utils.pyx":264 * @@ -3545,14 +3383,6 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s */ __pyx_r = -1; goto __pyx_L0; - - /* "sklearn/tree/_utils.pyx":288 - * cdef PriorityHeapRecord* heap = self.heap_ - * - * if heap_ptr <= 0: # <<<<<<<<<<<<<< - * return -1 - * - */ } /* "sklearn/tree/_utils.pyx":292 @@ -3594,15 +3424,9 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s * self.heap_ptr = heap_ptr - 1 */ __pyx_f_7sklearn_4tree_6_utils_heapify_down(__pyx_v_heap, 0, (__pyx_v_heap_ptr - 1)); - - /* "sklearn/tree/_utils.pyx":298 - * - * # Restore heap invariant - * if heap_ptr > 1: # <<<<<<<<<<<<<< - * heapify_down(heap, 0, heap_ptr - 1) - * - */ + goto __pyx_L4; } + __pyx_L4:; /* "sklearn/tree/_utils.pyx":301 * heapify_down(heap, 0, heap_ptr - 1) @@ -3634,7 +3458,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -3684,7 +3508,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -3697,7 +3521,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3706,7 +3530,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3715,7 +3539,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -3724,7 +3548,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3734,7 +3558,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -3742,30 +3566,22 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * copy_shape = 0 */ __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ - /*else*/ { __pyx_v_copy_shape = 0; } __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3779,7 +3595,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3789,17 +3605,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -3811,17 +3619,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3835,7 +3635,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3845,17 +3645,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -3867,17 +3659,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -3886,7 +3670,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -3895,7 +3679,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -3905,7 +3689,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -3914,7 +3698,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -3923,7 +3707,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -3934,7 +3718,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -3943,7 +3727,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -3952,28 +3736,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ goto __pyx_L11; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3984,7 +3760,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3993,7 +3769,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -4002,7 +3778,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -4011,28 +3787,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< * cdef dtype descr = self.descr - * cdef int offset + * cdef list stack */ __pyx_v_f = NULL; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack * cdef int offset - * */ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); __Pyx_INCREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -4041,7 +3817,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -4059,7 +3835,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -4071,25 +3847,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ goto __pyx_L14; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< * * if not hasfields: */ - /*else*/ { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_info->obj); @@ -4098,7 +3866,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -4108,7 +3876,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -4118,7 +3886,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4138,7 +3906,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4154,51 +3922,43 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - } + switch (__pyx_v_t) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" */ - switch (__pyx_v_t) { case NPY_BYTE: __pyx_v_f = __pyx_k_b; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -4209,7 +3969,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -4220,7 +3980,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -4231,7 +3991,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -4242,7 +4002,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -4253,7 +4013,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -4264,7 +4024,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -4275,7 +4035,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -4286,7 +4046,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -4297,7 +4057,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -4308,7 +4068,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -4319,7 +4079,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -4330,7 +4090,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -4341,7 +4101,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -4352,7 +4112,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -4363,7 +4123,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -4375,33 +4135,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -4410,7 +4170,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -4419,27 +4179,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_r = 0; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 */ - /*else*/ { __pyx_v_info->format = ((char *)malloc(255)); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -4448,7 +4200,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -4457,17 +4209,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_7; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -4477,7 +4229,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -4509,7 +4261,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4533,7 +4285,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4543,7 +4295,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -4551,17 +4303,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * stdlib.free(info.strides) */ free(__pyx_v_info->format); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ + goto __pyx_L3; } + __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4571,7 +4317,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -4579,17 +4325,11 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * */ free(__pyx_v_info->strides); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ + goto __pyx_L4; } + __pyx_L4:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4601,7 +4341,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4618,7 +4358,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -4626,13 +4366,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":770 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4651,7 +4391,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4668,7 +4408,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -4676,13 +4416,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":773 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4701,7 +4441,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4718,7 +4458,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -4726,13 +4466,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4751,7 +4491,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4768,7 +4508,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -4776,13 +4516,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4801,7 +4541,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4818,7 +4558,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4826,13 +4566,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4851,7 +4591,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4883,17 +4623,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":793 + * cdef int delta_offset + * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< * cdef bint little_endian = ((&endian_detector)[0] != 0) * cdef tuple fields */ __pyx_v_endian_detector = 1; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * cdef tuple fields @@ -4901,7 +4641,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4910,21 +4650,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -4933,15 +4673,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -4958,7 +4698,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -4966,60 +4706,52 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5039,7 +4771,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5055,39 +4787,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -5095,15 +4811,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -5112,7 +4828,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -5121,7 +4837,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -5132,7 +4848,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -5142,7 +4858,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5152,19 +4868,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5174,274 +4890,266 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5450,18 +5158,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5470,18 +5178,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5490,49 +5198,49 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L15:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -5540,31 +5248,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * # Cython ignores struct boundary information ("T{...}"), */ __pyx_v_f = (__pyx_v_f + 1); - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ goto __pyx_L13; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; } __pyx_L13:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5574,7 +5274,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -5584,7 +5284,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5609,7 +5309,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5624,7 +5324,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5635,7 +5335,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5643,28 +5343,20 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a * Py_INCREF(base) # important to do this before decref below! */ __pyx_v_baseptr = NULL; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ goto __pyx_L3; } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.base) */ - /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":975 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -5675,7 +5367,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5684,7 +5376,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5693,7 +5385,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5705,7 +5397,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5719,7 +5411,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5729,7 +5421,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":981 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -5740,29 +5432,21 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ } + /*else*/ { - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983 * return None * else: * return arr.base # <<<<<<<<<<<<<< */ - /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); __pyx_r = ((PyObject *)__pyx_v_arr->base); goto __pyx_L0; } - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5827,9 +5511,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_6_utils_Stack = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -5924,9 +5607,8 @@ static PyTypeObject __pyx_type_7sklearn_4tree_6_utils_PriorityHeap = { 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ + #else + 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ @@ -5999,7 +5681,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_ogrisel_code_scikit_learn, __pyx_k_Users_ogrisel_code_scikit_learn, sizeof(__pyx_k_Users_ogrisel_code_scikit_learn), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_capacity, __pyx_k_capacity, sizeof(__pyx_k_capacity), 0, 0, 1, 1}, {&__pyx_kp_s_could_not_allocate_d_bytes, __pyx_k_could_not_allocate_d_bytes, sizeof(__pyx_k_could_not_allocate_d_bytes), 0, 0, 1, 0}, @@ -6017,13 +5698,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_sklearn_tree__utils, __pyx_k_sklearn_tree__utils, sizeof(__pyx_k_sklearn_tree__utils), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_k_volatile_jmschrei_Bureau_scikit, sizeof(__pyx_k_volatile_jmschrei_Bureau_scikit), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -6033,7 +5715,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -6044,7 +5726,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -6055,47 +5737,47 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); @@ -6109,7 +5791,7 @@ static int __Pyx_InitCachedConstants(void) { __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ogrisel_code_scikit_learn, __pyx_n_s_realloc_test, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_n_s_realloc_test, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6147,24 +5829,18 @@ PyMODINIT_FUNC PyInit__utils(void) } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__utils(void)", 0); - if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS @@ -6187,12 +5863,12 @@ PyMODINIT_FUNC PyInit__utils(void) #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_sklearn__tree___utils) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } #if PY_MAJOR_VERSION >= 3 { @@ -6203,9 +5879,9 @@ PyMODINIT_FUNC PyInit__utils(void) } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ @@ -6247,13 +5923,10 @@ PyMODINIT_FUNC PyInit__utils(void) __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif /* "sklearn/tree/_utils.pyx":18 * from libc.math cimport log as ln @@ -6298,7 +5971,7 @@ PyMODINIT_FUNC PyInit__utils(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../venvs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6751,86 +6424,13 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { return -1; } -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { - mid = start + (end - start) / 2; + mid = (start + end) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { @@ -6983,33 +6583,102 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, Py_XDECREF(py_frame); } -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \ + { \ + func_type value = func_value; \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + if (is_unsigned && unlikely(value < zero)) \ + goto raise_neg_overflow; \ + else \ + goto raise_overflow; \ + } \ + } \ + return (target_type) value; \ } -#if CYTHON_USE_PYLONG_INTERNALS +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" + #endif #endif static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { - const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0; + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -7026,39 +6695,13 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0]) - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -7074,77 +6717,24 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { } #endif if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (Py_intptr_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0]) - case -2: - if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) -(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) { - return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(Py_intptr_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyLong_AsLong(x)) } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -7433,7 +7023,7 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { #endif static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { @@ -7459,7 +7049,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; + const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -7476,39 +7066,13 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -7524,77 +7088,24 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { } #endif if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) -(((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) -(((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) -(((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -7642,34 +7153,8 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { return (int) -1; } -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { @@ -7695,7 +7180,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; + const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { @@ -7712,39 +7197,13 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { @@ -7760,77 +7219,24 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } #endif if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) -(((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) -(((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) -(((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - } - break; + case 0: return 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0])); + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } + #endif #endif if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + __PYX_VERIFY_RETURN_INT(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { @@ -8048,7 +7454,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && @@ -8089,7 +7495,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ #endif } else #endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) +#if !CYTHON_COMPILING_IN_PYPY if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); @@ -8119,7 +7525,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { #else if (PyLong_Check(x)) #endif - return __Pyx_NewRef(x); + return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { @@ -8159,55 +7565,18 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); #endif if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | digits[2]) << PyLong_SHIFT) | digits[1]) << PyLong_SHIFT) | digits[0])); - } - break; - } - } + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif #endif return PyLong_AsSsize_t(b); }