1 /* Generated by Cython 0.25.2 */
3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
8 #error Cython requires Python 2.6+ or Python 3.2+.
10 #define CYTHON_ABI "0_25_2"
13 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
15 #if !defined(WIN32) && !defined(MS_WINDOWS)
27 #define DL_IMPORT(t) t
30 #define DL_EXPORT(t) t
32 #ifndef HAVE_LONG_LONG
33 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #define HAVE_LONG_LONG
38 #define PY_LONG_LONG LONG_LONG
41 #define Py_HUGE_VAL HUGE_VAL
44 #define CYTHON_COMPILING_IN_PYPY 1
45 #define CYTHON_COMPILING_IN_PYSTON 0
46 #define CYTHON_COMPILING_IN_CPYTHON 0
47 #undef CYTHON_USE_TYPE_SLOTS
48 #define CYTHON_USE_TYPE_SLOTS 0
49 #undef CYTHON_USE_ASYNC_SLOTS
50 #define CYTHON_USE_ASYNC_SLOTS 0
51 #undef CYTHON_USE_PYLIST_INTERNALS
52 #define CYTHON_USE_PYLIST_INTERNALS 0
53 #undef CYTHON_USE_UNICODE_INTERNALS
54 #define CYTHON_USE_UNICODE_INTERNALS 0
55 #undef CYTHON_USE_UNICODE_WRITER
56 #define CYTHON_USE_UNICODE_WRITER 0
57 #undef CYTHON_USE_PYLONG_INTERNALS
58 #define CYTHON_USE_PYLONG_INTERNALS 0
59 #undef CYTHON_AVOID_BORROWED_REFS
60 #define CYTHON_AVOID_BORROWED_REFS 1
61 #undef CYTHON_ASSUME_SAFE_MACROS
62 #define CYTHON_ASSUME_SAFE_MACROS 0
63 #undef CYTHON_UNPACK_METHODS
64 #define CYTHON_UNPACK_METHODS 0
65 #undef CYTHON_FAST_THREAD_STATE
66 #define CYTHON_FAST_THREAD_STATE 0
67 #undef CYTHON_FAST_PYCALL
68 #define CYTHON_FAST_PYCALL 0
69 #elif defined(PYSTON_VERSION)
70 #define CYTHON_COMPILING_IN_PYPY 0
71 #define CYTHON_COMPILING_IN_PYSTON 1
72 #define CYTHON_COMPILING_IN_CPYTHON 0
73 #ifndef CYTHON_USE_TYPE_SLOTS
74 #define CYTHON_USE_TYPE_SLOTS 1
76 #undef CYTHON_USE_ASYNC_SLOTS
77 #define CYTHON_USE_ASYNC_SLOTS 0
78 #undef CYTHON_USE_PYLIST_INTERNALS
79 #define CYTHON_USE_PYLIST_INTERNALS 0
80 #ifndef CYTHON_USE_UNICODE_INTERNALS
81 #define CYTHON_USE_UNICODE_INTERNALS 1
83 #undef CYTHON_USE_UNICODE_WRITER
84 #define CYTHON_USE_UNICODE_WRITER 0
85 #undef CYTHON_USE_PYLONG_INTERNALS
86 #define CYTHON_USE_PYLONG_INTERNALS 0
87 #ifndef CYTHON_AVOID_BORROWED_REFS
88 #define CYTHON_AVOID_BORROWED_REFS 0
90 #ifndef CYTHON_ASSUME_SAFE_MACROS
91 #define CYTHON_ASSUME_SAFE_MACROS 1
93 #ifndef CYTHON_UNPACK_METHODS
94 #define CYTHON_UNPACK_METHODS 1
96 #undef CYTHON_FAST_THREAD_STATE
97 #define CYTHON_FAST_THREAD_STATE 0
98 #undef CYTHON_FAST_PYCALL
99 #define CYTHON_FAST_PYCALL 0
101 #define CYTHON_COMPILING_IN_PYPY 0
102 #define CYTHON_COMPILING_IN_PYSTON 0
103 #define CYTHON_COMPILING_IN_CPYTHON 1
104 #ifndef CYTHON_USE_TYPE_SLOTS
105 #define CYTHON_USE_TYPE_SLOTS 1
107 #if PY_MAJOR_VERSION < 3
108 #undef CYTHON_USE_ASYNC_SLOTS
109 #define CYTHON_USE_ASYNC_SLOTS 0
110 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
111 #define CYTHON_USE_ASYNC_SLOTS 1
113 #if PY_VERSION_HEX < 0x02070000
114 #undef CYTHON_USE_PYLONG_INTERNALS
115 #define CYTHON_USE_PYLONG_INTERNALS 0
116 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
117 #define CYTHON_USE_PYLONG_INTERNALS 1
119 #ifndef CYTHON_USE_PYLIST_INTERNALS
120 #define CYTHON_USE_PYLIST_INTERNALS 1
122 #ifndef CYTHON_USE_UNICODE_INTERNALS
123 #define CYTHON_USE_UNICODE_INTERNALS 1
125 #if PY_VERSION_HEX < 0x030300F0
126 #undef CYTHON_USE_UNICODE_WRITER
127 #define CYTHON_USE_UNICODE_WRITER 0
128 #elif !defined(CYTHON_USE_UNICODE_WRITER)
129 #define CYTHON_USE_UNICODE_WRITER 1
131 #ifndef CYTHON_AVOID_BORROWED_REFS
132 #define CYTHON_AVOID_BORROWED_REFS 0
134 #ifndef CYTHON_ASSUME_SAFE_MACROS
135 #define CYTHON_ASSUME_SAFE_MACROS 1
137 #ifndef CYTHON_UNPACK_METHODS
138 #define CYTHON_UNPACK_METHODS 1
140 #ifndef CYTHON_FAST_THREAD_STATE
141 #define CYTHON_FAST_THREAD_STATE 1
143 #ifndef CYTHON_FAST_PYCALL
144 #define CYTHON_FAST_PYCALL 1
147 #if !defined(CYTHON_FAST_PYCCALL)
148 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
150 #if CYTHON_USE_PYLONG_INTERNALS
151 #include "longintrepr.h"
156 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
157 #define Py_OptimizeFlag 0
159 #define __PYX_BUILD_PY_SSIZE_T "n"
160 #define CYTHON_FORMAT_SSIZE_T "z"
161 #if PY_MAJOR_VERSION < 3
162 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
163 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
164 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
165 #define __Pyx_DefaultClassType PyClass_Type
167 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
168 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
169 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
170 #define __Pyx_DefaultClassType PyType_Type
172 #ifndef Py_TPFLAGS_CHECKTYPES
173 #define Py_TPFLAGS_CHECKTYPES 0
175 #ifndef Py_TPFLAGS_HAVE_INDEX
176 #define Py_TPFLAGS_HAVE_INDEX 0
178 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
179 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
181 #ifndef Py_TPFLAGS_HAVE_FINALIZE
182 #define Py_TPFLAGS_HAVE_FINALIZE 0
184 #ifndef METH_FASTCALL
185 #define METH_FASTCALL 0x80
186 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
187 Py_ssize_t nargs, PyObject *kwnames);
189 #define __Pyx_PyCFunctionFast _PyCFunctionFast
191 #if CYTHON_FAST_PYCCALL
192 #define __Pyx_PyFastCFunction_Check(func)\
193 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
195 #define __Pyx_PyFastCFunction_Check(func) 0
197 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
198 #define CYTHON_PEP393_ENABLED 1
199 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
200 0 : _PyUnicode_Ready((PyObject *)(op)))
201 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
202 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
203 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
204 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
205 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
206 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
207 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
208 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
210 #define CYTHON_PEP393_ENABLED 0
211 #define PyUnicode_1BYTE_KIND 1
212 #define PyUnicode_2BYTE_KIND 2
213 #define PyUnicode_4BYTE_KIND 4
214 #define __Pyx_PyUnicode_READY(op) (0)
215 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
216 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
217 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
218 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
219 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
220 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
221 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
222 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
224 #if CYTHON_COMPILING_IN_PYPY
225 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
226 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
228 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
229 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
230 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
232 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
233 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
235 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
236 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
238 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
239 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
241 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
242 #define PyObject_Malloc(s) PyMem_Malloc(s)
243 #define PyObject_Free(p) PyMem_Free(p)
244 #define PyObject_Realloc(p) PyMem_Realloc(p)
246 #if CYTHON_COMPILING_IN_PYSTON
247 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
248 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
250 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
251 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
253 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
254 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
255 #if PY_MAJOR_VERSION >= 3
256 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
258 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
260 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
261 #define PyObject_ASCII(o) PyObject_Repr(o)
263 #if PY_MAJOR_VERSION >= 3
264 #define PyBaseString_Type PyUnicode_Type
265 #define PyStringObject PyUnicodeObject
266 #define PyString_Type PyUnicode_Type
267 #define PyString_Check PyUnicode_Check
268 #define PyString_CheckExact PyUnicode_CheckExact
270 #if PY_MAJOR_VERSION >= 3
271 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
272 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
274 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
275 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
277 #ifndef PySet_CheckExact
278 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
280 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
281 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
282 #if PY_MAJOR_VERSION >= 3
283 #define PyIntObject PyLongObject
284 #define PyInt_Type PyLong_Type
285 #define PyInt_Check(op) PyLong_Check(op)
286 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
287 #define PyInt_FromString PyLong_FromString
288 #define PyInt_FromUnicode PyLong_FromUnicode
289 #define PyInt_FromLong PyLong_FromLong
290 #define PyInt_FromSize_t PyLong_FromSize_t
291 #define PyInt_FromSsize_t PyLong_FromSsize_t
292 #define PyInt_AsLong PyLong_AsLong
293 #define PyInt_AS_LONG PyLong_AS_LONG
294 #define PyInt_AsSsize_t PyLong_AsSsize_t
295 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
296 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
297 #define PyNumber_Int PyNumber_Long
299 #if PY_MAJOR_VERSION >= 3
300 #define PyBoolObject PyLongObject
302 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
303 #ifndef PyUnicode_InternFromString
304 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
307 #if PY_VERSION_HEX < 0x030200A4
308 typedef long Py_hash_t;
309 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
310 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
312 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
313 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
315 #if PY_MAJOR_VERSION >= 3
316 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
318 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
320 #if CYTHON_USE_ASYNC_SLOTS
321 #if PY_VERSION_HEX >= 0x030500B1
322 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
323 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
329 } __Pyx_PyAsyncMethodsStruct;
330 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
333 #define __Pyx_PyType_AsAsync(obj) NULL
335 #ifndef CYTHON_RESTRICT
336 #if defined(__GNUC__)
337 #define CYTHON_RESTRICT __restrict__
338 #elif defined(_MSC_VER) && _MSC_VER >= 1400
339 #define CYTHON_RESTRICT __restrict
340 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
341 #define CYTHON_RESTRICT restrict
343 #define CYTHON_RESTRICT
346 #ifndef CYTHON_UNUSED
347 # if defined(__GNUC__)
348 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
349 # define CYTHON_UNUSED __attribute__ ((__unused__))
351 # define CYTHON_UNUSED
353 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
354 # define CYTHON_UNUSED __attribute__ ((__unused__))
356 # define CYTHON_UNUSED
359 #ifndef CYTHON_MAYBE_UNUSED_VAR
360 # if defined(__cplusplus)
361 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
363 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
366 #ifndef CYTHON_NCP_UNUSED
367 # if CYTHON_COMPILING_IN_CPYTHON
368 # define CYTHON_NCP_UNUSED
370 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
373 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
375 #ifndef CYTHON_INLINE
376 #if defined(__clang__)
377 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
378 #elif defined(__GNUC__)
379 #define CYTHON_INLINE __inline__
380 #elif defined(_MSC_VER)
381 #define CYTHON_INLINE __inline
382 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
383 #define CYTHON_INLINE inline
385 #define CYTHON_INLINE
389 #if defined(WIN32) || defined(MS_WINDOWS)
390 #define _USE_MATH_DEFINES
394 #define __PYX_NAN() ((float) NAN)
396 static CYTHON_INLINE float __PYX_NAN() {
398 memset(&value, 0xFF, sizeof(value));
402 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
403 #define __Pyx_truncl trunc
405 #define __Pyx_truncl truncl
409 #define __PYX_ERR(f_index, lineno, Ln_error) \
411 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
414 #if PY_MAJOR_VERSION >= 3
415 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
416 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
418 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
419 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
422 #ifndef __PYX_EXTERN_C
424 #define __PYX_EXTERN_C extern "C"
426 #define __PYX_EXTERN_C extern
430 #define __PYX_HAVE__cython_nms
431 #define __PYX_HAVE_API__cython_nms
435 #include "numpy/arrayobject.h"
436 #include "numpy/ufuncobject.h"
441 #ifdef PYREX_WITHOUT_ASSERTIONS
442 #define CYTHON_WITHOUT_ASSERTIONS
445 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
446 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
448 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
449 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
450 #define __PYX_DEFAULT_STRING_ENCODING ""
451 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
452 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
453 #define __Pyx_uchar_cast(c) ((unsigned char)c)
454 #define __Pyx_long_cast(x) ((long)x)
455 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
456 (sizeof(type) < sizeof(Py_ssize_t)) ||\
457 (sizeof(type) > sizeof(Py_ssize_t) &&\
458 likely(v < (type)PY_SSIZE_T_MAX ||\
459 v == (type)PY_SSIZE_T_MAX) &&\
460 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
461 v == (type)PY_SSIZE_T_MIN))) ||\
462 (sizeof(type) == sizeof(Py_ssize_t) &&\
463 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
464 v == (type)PY_SSIZE_T_MAX))) )
465 #if defined (__cplusplus) && __cplusplus >= 201103L
467 #define __Pyx_sst_abs(value) std::abs(value)
468 #elif SIZEOF_INT >= SIZEOF_SIZE_T
469 #define __Pyx_sst_abs(value) abs(value)
470 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
474 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475 #define __Pyx_sst_abs(value) llabs(value)
476 #elif defined (__GNUC__)
477 #define __Pyx_sst_abs(value) __builtin_llabs(value)
479 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485 #define __Pyx_PyBytes_FromString PyBytes_FromString
486 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
487 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
488 #if PY_MAJOR_VERSION < 3
489 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
490 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
492 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
497 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
505 const Py_UNICODE *u_end = u;
507 return (size_t)(u_end - u - 1);
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
512 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
518 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
520 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522 #if CYTHON_ASSUME_SAFE_MACROS
523 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
525 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
527 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
528 #if PY_MAJOR_VERSION >= 3
529 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
531 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
533 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
534 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
535 static int __Pyx_sys_getdefaultencoding_not_ascii;
536 static int __Pyx_init_sys_getdefaultencoding_params(void) {
538 PyObject* default_encoding = NULL;
539 PyObject* ascii_chars_u = NULL;
540 PyObject* ascii_chars_b = NULL;
541 const char* default_encoding_c;
542 sys = PyImport_ImportModule("sys");
544 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
546 if (!default_encoding) goto bad;
547 default_encoding_c = PyBytes_AsString(default_encoding);
548 if (!default_encoding_c) goto bad;
549 if (strcmp(default_encoding_c, "ascii") == 0) {
550 __Pyx_sys_getdefaultencoding_not_ascii = 0;
552 char ascii_chars[128];
554 for (c = 0; c < 128; c++) {
557 __Pyx_sys_getdefaultencoding_not_ascii = 1;
558 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
559 if (!ascii_chars_u) goto bad;
560 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
561 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
564 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
568 Py_DECREF(ascii_chars_u);
569 Py_DECREF(ascii_chars_b);
571 Py_DECREF(default_encoding);
574 Py_XDECREF(default_encoding);
575 Py_XDECREF(ascii_chars_u);
576 Py_XDECREF(ascii_chars_b);
580 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
581 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
583 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
584 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
585 static char* __PYX_DEFAULT_STRING_ENCODING;
586 static int __Pyx_init_sys_getdefaultencoding_params(void) {
588 PyObject* default_encoding = NULL;
589 char* default_encoding_c;
590 sys = PyImport_ImportModule("sys");
592 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
594 if (!default_encoding) goto bad;
595 default_encoding_c = PyBytes_AsString(default_encoding);
596 if (!default_encoding_c) goto bad;
597 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
598 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
599 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
600 Py_DECREF(default_encoding);
603 Py_XDECREF(default_encoding);
610 /* Test for GCC > 2.95 */
611 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
612 #define likely(x) __builtin_expect(!!(x), 1)
613 #define unlikely(x) __builtin_expect(!!(x), 0)
614 #else /* !__GNUC__ or GCC < 2.95 */
615 #define likely(x) (x)
616 #define unlikely(x) (x)
617 #endif /* __GNUC__ */
619 static PyObject *__pyx_m;
620 static PyObject *__pyx_d;
621 static PyObject *__pyx_b;
622 static PyObject *__pyx_empty_tuple;
623 static PyObject *__pyx_empty_bytes;
624 static PyObject *__pyx_empty_unicode;
625 static int __pyx_lineno;
626 static int __pyx_clineno = 0;
627 static const char * __pyx_cfilenm= __FILE__;
628 static const char *__pyx_filename;
631 #if !defined(CYTHON_CCOMPLEX)
632 #if defined(__cplusplus)
633 #define CYTHON_CCOMPLEX 1
634 #elif defined(_Complex_I)
635 #define CYTHON_CCOMPLEX 1
637 #define CYTHON_CCOMPLEX 0
647 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
649 #define _Complex_I 1.0fj
653 static const char *__pyx_f[] = {
658 /* BufferFormatStructs.proto */
659 #define IS_UNSIGNED(type) (((type) -1) > 0)
660 struct __Pyx_StructField_;
661 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
664 struct __Pyx_StructField_* fields;
672 typedef struct __Pyx_StructField_ {
673 __Pyx_TypeInfo* type;
678 __Pyx_StructField* field;
679 size_t parent_offset;
680 } __Pyx_BufFmt_StackElem;
682 __Pyx_StructField root;
683 __Pyx_BufFmt_StackElem* head;
685 size_t new_count, enc_count;
686 size_t struct_alignment;
692 } __Pyx_BufFmt_Context;
695 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
696 * # in Cython to enable them only on the right systems.
698 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
699 * ctypedef npy_int16 int16_t
700 * ctypedef npy_int32 int32_t
702 typedef npy_int8 __pyx_t_5numpy_int8_t;
704 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
706 * ctypedef npy_int8 int8_t
707 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
708 * ctypedef npy_int32 int32_t
709 * ctypedef npy_int64 int64_t
711 typedef npy_int16 __pyx_t_5numpy_int16_t;
713 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727
714 * ctypedef npy_int8 int8_t
715 * ctypedef npy_int16 int16_t
716 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
717 * ctypedef npy_int64 int64_t
718 * #ctypedef npy_int96 int96_t
720 typedef npy_int32 __pyx_t_5numpy_int32_t;
722 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728
723 * ctypedef npy_int16 int16_t
724 * ctypedef npy_int32 int32_t
725 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
726 * #ctypedef npy_int96 int96_t
727 * #ctypedef npy_int128 int128_t
729 typedef npy_int64 __pyx_t_5numpy_int64_t;
731 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
732 * #ctypedef npy_int128 int128_t
734 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
735 * ctypedef npy_uint16 uint16_t
736 * ctypedef npy_uint32 uint32_t
738 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
740 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
742 * ctypedef npy_uint8 uint8_t
743 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
744 * ctypedef npy_uint32 uint32_t
745 * ctypedef npy_uint64 uint64_t
747 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
749 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734
750 * ctypedef npy_uint8 uint8_t
751 * ctypedef npy_uint16 uint16_t
752 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
753 * ctypedef npy_uint64 uint64_t
754 * #ctypedef npy_uint96 uint96_t
756 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
758 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735
759 * ctypedef npy_uint16 uint16_t
760 * ctypedef npy_uint32 uint32_t
761 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
762 * #ctypedef npy_uint96 uint96_t
763 * #ctypedef npy_uint128 uint128_t
765 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
767 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
768 * #ctypedef npy_uint128 uint128_t
770 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
771 * ctypedef npy_float64 float64_t
772 * #ctypedef npy_float80 float80_t
774 typedef npy_float32 __pyx_t_5numpy_float32_t;
776 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
778 * ctypedef npy_float32 float32_t
779 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
780 * #ctypedef npy_float80 float80_t
781 * #ctypedef npy_float128 float128_t
783 typedef npy_float64 __pyx_t_5numpy_float64_t;
785 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
786 * # The int types are mapped a bit surprising --
787 * # numpy.int corresponds to 'l' and numpy.long to 'q'
788 * ctypedef npy_long int_t # <<<<<<<<<<<<<<
789 * ctypedef npy_longlong long_t
790 * ctypedef npy_longlong longlong_t
792 typedef npy_long __pyx_t_5numpy_int_t;
794 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750
795 * # numpy.int corresponds to 'l' and numpy.long to 'q'
796 * ctypedef npy_long int_t
797 * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
798 * ctypedef npy_longlong longlong_t
801 typedef npy_longlong __pyx_t_5numpy_long_t;
803 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
804 * ctypedef npy_long int_t
805 * ctypedef npy_longlong long_t
806 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
808 * ctypedef npy_ulong uint_t
810 typedef npy_longlong __pyx_t_5numpy_longlong_t;
812 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
813 * ctypedef npy_longlong longlong_t
815 * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
816 * ctypedef npy_ulonglong ulong_t
817 * ctypedef npy_ulonglong ulonglong_t
819 typedef npy_ulong __pyx_t_5numpy_uint_t;
821 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
823 * ctypedef npy_ulong uint_t
824 * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
825 * ctypedef npy_ulonglong ulonglong_t
828 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
830 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
831 * ctypedef npy_ulong uint_t
832 * ctypedef npy_ulonglong ulong_t
833 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
835 * ctypedef npy_intp intp_t
837 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
839 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757
840 * ctypedef npy_ulonglong ulonglong_t
842 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
843 * ctypedef npy_uintp uintp_t
846 typedef npy_intp __pyx_t_5numpy_intp_t;
848 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
850 * ctypedef npy_intp intp_t
851 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
853 * ctypedef npy_double float_t
855 typedef npy_uintp __pyx_t_5numpy_uintp_t;
857 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
858 * ctypedef npy_uintp uintp_t
860 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
861 * ctypedef npy_double double_t
862 * ctypedef npy_longdouble longdouble_t
864 typedef npy_double __pyx_t_5numpy_float_t;
866 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761
868 * ctypedef npy_double float_t
869 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
870 * ctypedef npy_longdouble longdouble_t
873 typedef npy_double __pyx_t_5numpy_double_t;
875 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
876 * ctypedef npy_double float_t
877 * ctypedef npy_double double_t
878 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
880 * ctypedef npy_cfloat cfloat_t
882 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
883 /* Declarations.proto */
886 typedef ::std::complex< float > __pyx_t_float_complex;
888 typedef float _Complex __pyx_t_float_complex;
891 typedef struct { float real, imag; } __pyx_t_float_complex;
893 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
895 /* Declarations.proto */
898 typedef ::std::complex< double > __pyx_t_double_complex;
900 typedef double _Complex __pyx_t_double_complex;
903 typedef struct { double real, imag; } __pyx_t_double_complex;
905 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
908 /*--- Type declarations ---*/
910 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
911 * ctypedef npy_longdouble longdouble_t
913 * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
914 * ctypedef npy_cdouble cdouble_t
915 * ctypedef npy_clongdouble clongdouble_t
917 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
919 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
921 * ctypedef npy_cfloat cfloat_t
922 * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
923 * ctypedef npy_clongdouble clongdouble_t
926 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
928 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
929 * ctypedef npy_cfloat cfloat_t
930 * ctypedef npy_cdouble cdouble_t
931 * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
933 * ctypedef npy_cdouble complex_t
935 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
937 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
938 * ctypedef npy_clongdouble clongdouble_t
940 * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
942 * cdef inline object PyArray_MultiIterNew1(a):
944 typedef npy_cdouble __pyx_t_5numpy_complex_t;
946 /* --- Runtime support code (head) --- */
948 #ifndef CYTHON_REFNANNY
949 #define CYTHON_REFNANNY 0
953 void (*INCREF)(void*, PyObject*, int);
954 void (*DECREF)(void*, PyObject*, int);
955 void (*GOTREF)(void*, PyObject*, int);
956 void (*GIVEREF)(void*, PyObject*, int);
957 void* (*SetupContext)(const char*, int, const char*);
958 void (*FinishContext)(void**);
959 } __Pyx_RefNannyAPIStruct;
960 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
961 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
962 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
964 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
966 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
967 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
968 PyGILState_Release(__pyx_gilstate_save);\
970 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
973 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
974 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
976 #define __Pyx_RefNannyFinishContext()\
977 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
978 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
979 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
980 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
981 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
982 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
983 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
984 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
985 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
987 #define __Pyx_RefNannyDeclarations
988 #define __Pyx_RefNannySetupContext(name, acquire_gil)
989 #define __Pyx_RefNannyFinishContext()
990 #define __Pyx_INCREF(r) Py_INCREF(r)
991 #define __Pyx_DECREF(r) Py_DECREF(r)
992 #define __Pyx_GOTREF(r)
993 #define __Pyx_GIVEREF(r)
994 #define __Pyx_XINCREF(r) Py_XINCREF(r)
995 #define __Pyx_XDECREF(r) Py_XDECREF(r)
996 #define __Pyx_XGOTREF(r)
997 #define __Pyx_XGIVEREF(r)
999 #define __Pyx_XDECREF_SET(r, v) do {\
1000 PyObject *tmp = (PyObject *) r;\
1001 r = v; __Pyx_XDECREF(tmp);\
1003 #define __Pyx_DECREF_SET(r, v) do {\
1004 PyObject *tmp = (PyObject *) r;\
1005 r = v; __Pyx_DECREF(tmp);\
1007 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1008 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1010 /* PyObjectGetAttrStr.proto */
1011 #if CYTHON_USE_TYPE_SLOTS
1012 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
1013 PyTypeObject* tp = Py_TYPE(obj);
1014 if (likely(tp->tp_getattro))
1015 return tp->tp_getattro(obj, attr_name);
1016 #if PY_MAJOR_VERSION < 3
1017 if (likely(tp->tp_getattr))
1018 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
1020 return PyObject_GetAttr(obj, attr_name);
1023 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1026 /* GetBuiltinName.proto */
1027 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1029 /* RaiseArgTupleInvalid.proto */
1030 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1031 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1033 /* RaiseDoubleKeywords.proto */
1034 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1036 /* ParseKeywords.proto */
1037 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1038 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1039 const char* function_name);
1041 /* ArgTypeTest.proto */
1042 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
1043 const char *name, int exact);
1045 /* BufferFormatCheck.proto */
1046 static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1047 __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1048 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1049 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1050 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1051 __Pyx_BufFmt_StackElem* stack,
1052 __Pyx_TypeInfo* type); // PROTO
1054 /* ExtTypeTest.proto */
1055 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1057 /* PyIntBinop.proto */
1058 #if !CYTHON_COMPILING_IN_PYPY
1059 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1061 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1062 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1065 /* PyCFunctionFastCall.proto */
1066 #if CYTHON_FAST_PYCCALL
1067 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1069 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1072 /* PyFunctionFastCall.proto */
1073 #if CYTHON_FAST_PYCALL
1074 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1075 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1076 #if 1 || PY_VERSION_HEX < 0x030600B1
1077 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1079 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1083 /* PyObjectCall.proto */
1084 #if CYTHON_COMPILING_IN_CPYTHON
1085 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1087 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1090 /* PyObjectCallMethO.proto */
1091 #if CYTHON_COMPILING_IN_CPYTHON
1092 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1095 /* PyObjectCallOneArg.proto */
1096 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1098 /* PyObjectCallNoArg.proto */
1099 #if CYTHON_COMPILING_IN_CPYTHON
1100 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1102 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1105 /* GetModuleGlobalName.proto */
1106 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1108 /* BufferIndexError.proto */
1109 static void __Pyx_RaiseBufferIndexError(int axis);
1111 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1112 /* ListAppend.proto */
1113 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1114 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1115 PyListObject* L = (PyListObject*) list;
1116 Py_ssize_t len = Py_SIZE(list);
1117 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1119 PyList_SET_ITEM(list, len, x);
1120 Py_SIZE(list) = len+1;
1123 return PyList_Append(list, x);
1126 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1129 /* PyThreadStateGet.proto */
1130 #if CYTHON_FAST_THREAD_STATE
1131 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1132 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1134 #define __Pyx_PyThreadState_declare
1135 #define __Pyx_PyThreadState_assign
1138 /* PyErrFetchRestore.proto */
1139 #if CYTHON_FAST_THREAD_STATE
1140 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1141 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1142 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1143 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1144 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1145 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1147 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1148 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1149 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1150 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1153 /* RaiseException.proto */
1154 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1156 /* DictGetItem.proto */
1157 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1158 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
1160 value = PyDict_GetItemWithError(d, key);
1161 if (unlikely(!value)) {
1162 if (!PyErr_Occurred()) {
1163 PyObject* args = PyTuple_Pack(1, key);
1165 PyErr_SetObject(PyExc_KeyError, args);
1174 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1177 /* RaiseTooManyValuesToUnpack.proto */
1178 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1180 /* RaiseNeedMoreValuesToUnpack.proto */
1181 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1183 /* RaiseNoneIterError.proto */
1184 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1186 /* SaveResetException.proto */
1187 #if CYTHON_FAST_THREAD_STATE
1188 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1189 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1190 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1191 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1193 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1194 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1197 /* PyErrExceptionMatches.proto */
1198 #if CYTHON_FAST_THREAD_STATE
1199 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1200 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1202 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1205 /* GetException.proto */
1206 #if CYTHON_FAST_THREAD_STATE
1207 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1208 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1210 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1214 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1216 /* CodeObjectCache.proto */
1218 PyCodeObject* code_object;
1220 } __Pyx_CodeObjectCacheEntry;
1221 struct __Pyx_CodeObjectCache {
1224 __Pyx_CodeObjectCacheEntry* entries;
1226 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1227 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1228 static PyCodeObject *__pyx_find_code_object(int code_line);
1229 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1231 /* AddTraceback.proto */
1232 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1233 int py_line, const char *filename);
1235 /* BufferStructDeclare.proto */
1237 Py_ssize_t shape, strides, suboffsets;
1238 } __Pyx_Buf_DimInfo;
1244 __Pyx_Buffer *rcbuffer;
1246 __Pyx_Buf_DimInfo diminfo[8];
1247 } __Pyx_LocalBuf_ND;
1249 #if PY_MAJOR_VERSION < 3
1250 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1251 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1253 #define __Pyx_GetBuffer PyObject_GetBuffer
1254 #define __Pyx_ReleaseBuffer PyBuffer_Release
1259 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
1260 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
1262 /* CIntToPy.proto */
1263 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1265 /* CIntToPy.proto */
1266 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1268 /* RealImag.proto */
1271 #define __Pyx_CREAL(z) ((z).real())
1272 #define __Pyx_CIMAG(z) ((z).imag())
1274 #define __Pyx_CREAL(z) (__real__(z))
1275 #define __Pyx_CIMAG(z) (__imag__(z))
1278 #define __Pyx_CREAL(z) ((z).real)
1279 #define __Pyx_CIMAG(z) ((z).imag)
1281 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1282 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1283 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1284 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1286 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1287 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1290 /* Arithmetic.proto */
1292 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1293 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1294 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1295 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1296 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1297 #define __Pyx_c_neg_float(a) (-(a))
1299 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1300 #define __Pyx_c_conj_float(z) (::std::conj(z))
1302 #define __Pyx_c_abs_float(z) (::std::abs(z))
1303 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1306 #define __Pyx_c_is_zero_float(z) ((z)==0)
1307 #define __Pyx_c_conj_float(z) (conjf(z))
1309 #define __Pyx_c_abs_float(z) (cabsf(z))
1310 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1314 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1315 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1316 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1317 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1318 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1319 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1320 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1321 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1323 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1324 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1328 /* Arithmetic.proto */
1330 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1331 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1332 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1333 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1334 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1335 #define __Pyx_c_neg_double(a) (-(a))
1337 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1338 #define __Pyx_c_conj_double(z) (::std::conj(z))
1340 #define __Pyx_c_abs_double(z) (::std::abs(z))
1341 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1344 #define __Pyx_c_is_zero_double(z) ((z)==0)
1345 #define __Pyx_c_conj_double(z) (conj(z))
1347 #define __Pyx_c_abs_double(z) (cabs(z))
1348 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1352 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1353 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1354 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1355 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1356 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1357 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1358 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1359 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1361 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1362 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1366 /* CIntToPy.proto */
1367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
1369 /* CIntFromPy.proto */
1370 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1372 /* CIntFromPy.proto */
1373 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1375 /* CheckBinaryVersion.proto */
1376 static int __Pyx_check_binary_version(void);
1378 /* PyIdentifierFromString.proto */
1379 #if !defined(__Pyx_PyIdentifier_FromString)
1380 #if PY_MAJOR_VERSION < 3
1381 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
1383 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
1387 /* ModuleImport.proto */
1388 static PyObject *__Pyx_ImportModule(const char *name);
1390 /* TypeImport.proto */
1391 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
1393 /* InitStrings.proto */
1394 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1397 /* Module declarations from 'cpython.buffer' */
1399 /* Module declarations from 'libc.string' */
1401 /* Module declarations from 'libc.stdio' */
1403 /* Module declarations from '__builtin__' */
1405 /* Module declarations from 'cpython.type' */
1406 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1408 /* Module declarations from 'cpython' */
1410 /* Module declarations from 'cpython.object' */
1412 /* Module declarations from 'cpython.ref' */
1414 /* Module declarations from 'libc.stdlib' */
1416 /* Module declarations from 'numpy' */
1418 /* Module declarations from 'numpy' */
1419 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1420 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1421 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1422 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1423 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1424 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
1426 /* Module declarations from 'cython_nms' */
1427 static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_f_10cython_nms_max(__pyx_t_5numpy_float32_t, __pyx_t_5numpy_float32_t); /*proto*/
1428 static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_f_10cython_nms_min(__pyx_t_5numpy_float32_t, __pyx_t_5numpy_float32_t); /*proto*/
1429 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 };
1430 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 };
1431 #define __Pyx_MODULE_NAME "cython_nms"
1432 int __pyx_module_is_main_cython_nms = 0;
1434 /* Implementation of 'cython_nms' */
1435 static PyObject *__pyx_builtin_range;
1436 static PyObject *__pyx_builtin_ValueError;
1437 static PyObject *__pyx_builtin_RuntimeError;
1438 static PyObject *__pyx_builtin_ImportError;
1439 static const char __pyx_k_h[] = "h";
1440 static const char __pyx_k_i[] = "_i";
1441 static const char __pyx_k_j[] = "_j";
1442 static const char __pyx_k_w[] = "w";
1443 static const char __pyx_k_np[] = "np";
1444 static const char __pyx_k_x1[] = "x1";
1445 static const char __pyx_k_x2[] = "x2";
1446 static const char __pyx_k_y1[] = "y1";
1447 static const char __pyx_k_y2[] = "y2";
1448 static const char __pyx_k_i_2[] = "i";
1449 static const char __pyx_k_int[] = "int";
1450 static const char __pyx_k_ix1[] = "ix1";
1451 static const char __pyx_k_ix2[] = "ix2";
1452 static const char __pyx_k_iy1[] = "iy1";
1453 static const char __pyx_k_iy2[] = "iy2";
1454 static const char __pyx_k_j_2[] = "j";
1455 static const char __pyx_k_nms[] = "nms";
1456 static const char __pyx_k_ovr[] = "ovr";
1457 static const char __pyx_k_xx1[] = "xx1";
1458 static const char __pyx_k_xx2[] = "xx2";
1459 static const char __pyx_k_yy1[] = "yy1";
1460 static const char __pyx_k_yy2[] = "yy2";
1461 static const char __pyx_k_dets[] = "dets";
1462 static const char __pyx_k_keep[] = "keep";
1463 static const char __pyx_k_main[] = "__main__";
1464 static const char __pyx_k_ovr1[] = "ovr1";
1465 static const char __pyx_k_ovr2[] = "ovr2";
1466 static const char __pyx_k_test[] = "__test__";
1467 static const char __pyx_k_areas[] = "areas";
1468 static const char __pyx_k_dtype[] = "dtype";
1469 static const char __pyx_k_iarea[] = "iarea";
1470 static const char __pyx_k_inter[] = "inter";
1471 static const char __pyx_k_ndets[] = "ndets";
1472 static const char __pyx_k_numpy[] = "numpy";
1473 static const char __pyx_k_order[] = "order";
1474 static const char __pyx_k_range[] = "range";
1475 static const char __pyx_k_zeros[] = "zeros";
1476 static const char __pyx_k_import[] = "__import__";
1477 static const char __pyx_k_scores[] = "scores";
1478 static const char __pyx_k_thresh[] = "thresh";
1479 static const char __pyx_k_argsort[] = "argsort";
1480 static const char __pyx_k_nms_new[] = "nms_new";
1481 static const char __pyx_k_ValueError[] = "ValueError";
1482 static const char __pyx_k_cython_nms[] = "cython_nms";
1483 static const char __pyx_k_suppressed[] = "suppressed";
1484 static const char __pyx_k_ImportError[] = "ImportError";
1485 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1486 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
1487 static const char __pyx_k_home_yjr_PycharmProjects_Faster[] = "/home/yjr/PycharmProjects/Faster-RCNN_Tensorflow/libs/box_utils/cython_utils/nms.pyx";
1488 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1489 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
1490 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
1491 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
1492 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
1493 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1494 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
1495 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1496 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1497 static PyObject *__pyx_n_s_ImportError;
1498 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1499 static PyObject *__pyx_n_s_RuntimeError;
1500 static PyObject *__pyx_n_s_ValueError;
1501 static PyObject *__pyx_n_s_areas;
1502 static PyObject *__pyx_n_s_argsort;
1503 static PyObject *__pyx_n_s_cython_nms;
1504 static PyObject *__pyx_n_s_dets;
1505 static PyObject *__pyx_n_s_dtype;
1506 static PyObject *__pyx_n_s_h;
1507 static PyObject *__pyx_kp_s_home_yjr_PycharmProjects_Faster;
1508 static PyObject *__pyx_n_s_i;
1509 static PyObject *__pyx_n_s_i_2;
1510 static PyObject *__pyx_n_s_iarea;
1511 static PyObject *__pyx_n_s_import;
1512 static PyObject *__pyx_n_s_int;
1513 static PyObject *__pyx_n_s_inter;
1514 static PyObject *__pyx_n_s_ix1;
1515 static PyObject *__pyx_n_s_ix2;
1516 static PyObject *__pyx_n_s_iy1;
1517 static PyObject *__pyx_n_s_iy2;
1518 static PyObject *__pyx_n_s_j;
1519 static PyObject *__pyx_n_s_j_2;
1520 static PyObject *__pyx_n_s_keep;
1521 static PyObject *__pyx_n_s_main;
1522 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1523 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1524 static PyObject *__pyx_n_s_ndets;
1525 static PyObject *__pyx_n_s_nms;
1526 static PyObject *__pyx_n_s_nms_new;
1527 static PyObject *__pyx_n_s_np;
1528 static PyObject *__pyx_n_s_numpy;
1529 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1530 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1531 static PyObject *__pyx_n_s_order;
1532 static PyObject *__pyx_n_s_ovr;
1533 static PyObject *__pyx_n_s_ovr1;
1534 static PyObject *__pyx_n_s_ovr2;
1535 static PyObject *__pyx_n_s_range;
1536 static PyObject *__pyx_n_s_scores;
1537 static PyObject *__pyx_n_s_suppressed;
1538 static PyObject *__pyx_n_s_test;
1539 static PyObject *__pyx_n_s_thresh;
1540 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1541 static PyObject *__pyx_n_s_w;
1542 static PyObject *__pyx_n_s_x1;
1543 static PyObject *__pyx_n_s_x2;
1544 static PyObject *__pyx_n_s_xx1;
1545 static PyObject *__pyx_n_s_xx2;
1546 static PyObject *__pyx_n_s_y1;
1547 static PyObject *__pyx_n_s_y2;
1548 static PyObject *__pyx_n_s_yy1;
1549 static PyObject *__pyx_n_s_yy2;
1550 static PyObject *__pyx_n_s_zeros;
1551 static PyObject *__pyx_pf_10cython_nms_nms(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dets, PyObject *__pyx_v_thresh); /* proto */
1552 static PyObject *__pyx_pf_10cython_nms_2nms_new(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dets, PyObject *__pyx_v_thresh); /* proto */
1553 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
1554 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
1555 static PyObject *__pyx_float_0_95;
1556 static PyObject *__pyx_int_0;
1557 static PyObject *__pyx_int_1;
1558 static PyObject *__pyx_int_2;
1559 static PyObject *__pyx_int_3;
1560 static PyObject *__pyx_int_4;
1561 static PyObject *__pyx_int_neg_1;
1562 static PyObject *__pyx_slice_;
1563 static PyObject *__pyx_slice__3;
1564 static PyObject *__pyx_slice__5;
1565 static PyObject *__pyx_slice__7;
1566 static PyObject *__pyx_slice__9;
1567 static PyObject *__pyx_tuple__2;
1568 static PyObject *__pyx_tuple__4;
1569 static PyObject *__pyx_tuple__6;
1570 static PyObject *__pyx_tuple__8;
1571 static PyObject *__pyx_slice__11;
1572 static PyObject *__pyx_slice__12;
1573 static PyObject *__pyx_slice__14;
1574 static PyObject *__pyx_slice__16;
1575 static PyObject *__pyx_slice__18;
1576 static PyObject *__pyx_slice__20;
1577 static PyObject *__pyx_slice__22;
1578 static PyObject *__pyx_tuple__10;
1579 static PyObject *__pyx_tuple__13;
1580 static PyObject *__pyx_tuple__15;
1581 static PyObject *__pyx_tuple__17;
1582 static PyObject *__pyx_tuple__19;
1583 static PyObject *__pyx_tuple__21;
1584 static PyObject *__pyx_tuple__23;
1585 static PyObject *__pyx_tuple__24;
1586 static PyObject *__pyx_tuple__25;
1587 static PyObject *__pyx_tuple__26;
1588 static PyObject *__pyx_tuple__27;
1589 static PyObject *__pyx_tuple__28;
1590 static PyObject *__pyx_tuple__29;
1591 static PyObject *__pyx_tuple__30;
1592 static PyObject *__pyx_tuple__31;
1593 static PyObject *__pyx_tuple__32;
1594 static PyObject *__pyx_tuple__34;
1595 static PyObject *__pyx_codeobj__33;
1596 static PyObject *__pyx_codeobj__35;
1599 * cimport numpy as np
1601 * cdef inline np.float32_t max(np.float32_t a, np.float32_t b): # <<<<<<<<<<<<<<
1602 * return a if a >= b else b
1606 static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_f_10cython_nms_max(__pyx_t_5numpy_float32_t __pyx_v_a, __pyx_t_5numpy_float32_t __pyx_v_b) {
1607 __pyx_t_5numpy_float32_t __pyx_r;
1608 __Pyx_RefNannyDeclarations
1609 __pyx_t_5numpy_float32_t __pyx_t_1;
1610 __Pyx_RefNannySetupContext("max", 0);
1614 * cdef inline np.float32_t max(np.float32_t a, np.float32_t b):
1615 * return a if a >= b else b # <<<<<<<<<<<<<<
1617 * cdef inline np.float32_t min(np.float32_t a, np.float32_t b):
1619 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
1620 __pyx_t_1 = __pyx_v_a;
1622 __pyx_t_1 = __pyx_v_b;
1624 __pyx_r = __pyx_t_1;
1628 * cimport numpy as np
1630 * cdef inline np.float32_t max(np.float32_t a, np.float32_t b): # <<<<<<<<<<<<<<
1631 * return a if a >= b else b
1635 /* function exit code */
1637 __Pyx_RefNannyFinishContext();
1642 * return a if a >= b else b
1644 * cdef inline np.float32_t min(np.float32_t a, np.float32_t b): # <<<<<<<<<<<<<<
1645 * return a if a <= b else b
1649 static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_f_10cython_nms_min(__pyx_t_5numpy_float32_t __pyx_v_a, __pyx_t_5numpy_float32_t __pyx_v_b) {
1650 __pyx_t_5numpy_float32_t __pyx_r;
1651 __Pyx_RefNannyDeclarations
1652 __pyx_t_5numpy_float32_t __pyx_t_1;
1653 __Pyx_RefNannySetupContext("min", 0);
1657 * cdef inline np.float32_t min(np.float32_t a, np.float32_t b):
1658 * return a if a <= b else b # <<<<<<<<<<<<<<
1660 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
1662 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
1663 __pyx_t_1 = __pyx_v_a;
1665 __pyx_t_1 = __pyx_v_b;
1667 __pyx_r = __pyx_t_1;
1671 * return a if a >= b else b
1673 * cdef inline np.float32_t min(np.float32_t a, np.float32_t b): # <<<<<<<<<<<<<<
1674 * return a if a <= b else b
1678 /* function exit code */
1680 __Pyx_RefNannyFinishContext();
1685 * return a if a <= b else b
1687 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
1688 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
1689 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
1692 /* Python wrapper */
1693 static PyObject *__pyx_pw_10cython_nms_1nms(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1694 static PyMethodDef __pyx_mdef_10cython_nms_1nms = {"nms", (PyCFunction)__pyx_pw_10cython_nms_1nms, METH_VARARGS|METH_KEYWORDS, 0};
1695 static PyObject *__pyx_pw_10cython_nms_1nms(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1696 PyArrayObject *__pyx_v_dets = 0;
1697 PyObject *__pyx_v_thresh = 0;
1698 PyObject *__pyx_r = 0;
1699 __Pyx_RefNannyDeclarations
1700 __Pyx_RefNannySetupContext("nms (wrapper)", 0);
1702 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dets,&__pyx_n_s_thresh,0};
1703 PyObject* values[2] = {0,0};
1704 if (unlikely(__pyx_kwds)) {
1706 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1708 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1709 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1711 default: goto __pyx_L5_argtuple_error;
1713 kw_args = PyDict_Size(__pyx_kwds);
1716 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dets)) != 0)) kw_args--;
1717 else goto __pyx_L5_argtuple_error;
1719 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thresh)) != 0)) kw_args--;
1721 __Pyx_RaiseArgtupleInvalid("nms", 1, 2, 2, 1); __PYX_ERR(0, 17, __pyx_L3_error)
1724 if (unlikely(kw_args > 0)) {
1725 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nms") < 0)) __PYX_ERR(0, 17, __pyx_L3_error)
1727 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1728 goto __pyx_L5_argtuple_error;
1730 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1731 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1733 __pyx_v_dets = ((PyArrayObject *)values[0]);
1734 __pyx_v_thresh = ((PyObject*)values[1]);
1736 goto __pyx_L4_argument_unpacking_done;
1737 __pyx_L5_argtuple_error:;
1738 __Pyx_RaiseArgtupleInvalid("nms", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error)
1740 __Pyx_AddTraceback("cython_nms.nms", __pyx_clineno, __pyx_lineno, __pyx_filename);
1741 __Pyx_RefNannyFinishContext();
1743 __pyx_L4_argument_unpacking_done:;
1744 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dets), __pyx_ptype_5numpy_ndarray, 1, "dets", 0))) __PYX_ERR(0, 17, __pyx_L1_error)
1745 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thresh), (&PyFloat_Type), 1, "thresh", 1))) __PYX_ERR(0, 17, __pyx_L1_error)
1746 __pyx_r = __pyx_pf_10cython_nms_nms(__pyx_self, __pyx_v_dets, __pyx_v_thresh);
1748 /* function exit code */
1753 __Pyx_RefNannyFinishContext();
1757 static PyObject *__pyx_pf_10cython_nms_nms(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dets, PyObject *__pyx_v_thresh) {
1758 PyArrayObject *__pyx_v_x1 = 0;
1759 PyArrayObject *__pyx_v_y1 = 0;
1760 PyArrayObject *__pyx_v_x2 = 0;
1761 PyArrayObject *__pyx_v_y2 = 0;
1762 PyArrayObject *__pyx_v_scores = 0;
1763 PyArrayObject *__pyx_v_areas = 0;
1764 PyArrayObject *__pyx_v_order = 0;
1766 PyArrayObject *__pyx_v_suppressed = 0;
1771 __pyx_t_5numpy_float32_t __pyx_v_ix1;
1772 __pyx_t_5numpy_float32_t __pyx_v_iy1;
1773 __pyx_t_5numpy_float32_t __pyx_v_ix2;
1774 __pyx_t_5numpy_float32_t __pyx_v_iy2;
1775 __pyx_t_5numpy_float32_t __pyx_v_iarea;
1776 __pyx_t_5numpy_float32_t __pyx_v_xx1;
1777 __pyx_t_5numpy_float32_t __pyx_v_yy1;
1778 __pyx_t_5numpy_float32_t __pyx_v_xx2;
1779 __pyx_t_5numpy_float32_t __pyx_v_yy2;
1780 __pyx_t_5numpy_float32_t __pyx_v_w;
1781 __pyx_t_5numpy_float32_t __pyx_v_h;
1782 __pyx_t_5numpy_float32_t __pyx_v_inter;
1783 __pyx_t_5numpy_float32_t __pyx_v_ovr;
1784 PyObject *__pyx_v_keep = NULL;
1785 __Pyx_LocalBuf_ND __pyx_pybuffernd_areas;
1786 __Pyx_Buffer __pyx_pybuffer_areas;
1787 __Pyx_LocalBuf_ND __pyx_pybuffernd_dets;
1788 __Pyx_Buffer __pyx_pybuffer_dets;
1789 __Pyx_LocalBuf_ND __pyx_pybuffernd_order;
1790 __Pyx_Buffer __pyx_pybuffer_order;
1791 __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
1792 __Pyx_Buffer __pyx_pybuffer_scores;
1793 __Pyx_LocalBuf_ND __pyx_pybuffernd_suppressed;
1794 __Pyx_Buffer __pyx_pybuffer_suppressed;
1795 __Pyx_LocalBuf_ND __pyx_pybuffernd_x1;
1796 __Pyx_Buffer __pyx_pybuffer_x1;
1797 __Pyx_LocalBuf_ND __pyx_pybuffernd_x2;
1798 __Pyx_Buffer __pyx_pybuffer_x2;
1799 __Pyx_LocalBuf_ND __pyx_pybuffernd_y1;
1800 __Pyx_Buffer __pyx_pybuffer_y1;
1801 __Pyx_LocalBuf_ND __pyx_pybuffernd_y2;
1802 __Pyx_Buffer __pyx_pybuffer_y2;
1803 PyObject *__pyx_r = NULL;
1804 __Pyx_RefNannyDeclarations
1805 PyObject *__pyx_t_1 = NULL;
1806 PyArrayObject *__pyx_t_2 = NULL;
1807 PyArrayObject *__pyx_t_3 = NULL;
1808 PyArrayObject *__pyx_t_4 = NULL;
1809 PyArrayObject *__pyx_t_5 = NULL;
1810 PyArrayObject *__pyx_t_6 = NULL;
1811 PyObject *__pyx_t_7 = NULL;
1812 PyObject *__pyx_t_8 = NULL;
1813 PyArrayObject *__pyx_t_9 = NULL;
1814 PyArrayObject *__pyx_t_10 = NULL;
1815 PyObject *__pyx_t_11 = NULL;
1816 PyObject *__pyx_t_12 = NULL;
1817 PyArrayObject *__pyx_t_13 = NULL;
1820 Py_ssize_t __pyx_t_16;
1822 Py_ssize_t __pyx_t_18;
1825 Py_ssize_t __pyx_t_21;
1826 Py_ssize_t __pyx_t_22;
1827 Py_ssize_t __pyx_t_23;
1828 Py_ssize_t __pyx_t_24;
1829 Py_ssize_t __pyx_t_25;
1831 Py_ssize_t __pyx_t_27;
1833 Py_ssize_t __pyx_t_29;
1834 Py_ssize_t __pyx_t_30;
1835 Py_ssize_t __pyx_t_31;
1836 Py_ssize_t __pyx_t_32;
1837 Py_ssize_t __pyx_t_33;
1838 Py_ssize_t __pyx_t_34;
1839 __pyx_t_5numpy_float32_t __pyx_t_35;
1840 Py_ssize_t __pyx_t_36;
1841 __Pyx_RefNannySetupContext("nms", 0);
1842 __pyx_pybuffer_x1.pybuffer.buf = NULL;
1843 __pyx_pybuffer_x1.refcount = 0;
1844 __pyx_pybuffernd_x1.data = NULL;
1845 __pyx_pybuffernd_x1.rcbuffer = &__pyx_pybuffer_x1;
1846 __pyx_pybuffer_y1.pybuffer.buf = NULL;
1847 __pyx_pybuffer_y1.refcount = 0;
1848 __pyx_pybuffernd_y1.data = NULL;
1849 __pyx_pybuffernd_y1.rcbuffer = &__pyx_pybuffer_y1;
1850 __pyx_pybuffer_x2.pybuffer.buf = NULL;
1851 __pyx_pybuffer_x2.refcount = 0;
1852 __pyx_pybuffernd_x2.data = NULL;
1853 __pyx_pybuffernd_x2.rcbuffer = &__pyx_pybuffer_x2;
1854 __pyx_pybuffer_y2.pybuffer.buf = NULL;
1855 __pyx_pybuffer_y2.refcount = 0;
1856 __pyx_pybuffernd_y2.data = NULL;
1857 __pyx_pybuffernd_y2.rcbuffer = &__pyx_pybuffer_y2;
1858 __pyx_pybuffer_scores.pybuffer.buf = NULL;
1859 __pyx_pybuffer_scores.refcount = 0;
1860 __pyx_pybuffernd_scores.data = NULL;
1861 __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
1862 __pyx_pybuffer_areas.pybuffer.buf = NULL;
1863 __pyx_pybuffer_areas.refcount = 0;
1864 __pyx_pybuffernd_areas.data = NULL;
1865 __pyx_pybuffernd_areas.rcbuffer = &__pyx_pybuffer_areas;
1866 __pyx_pybuffer_order.pybuffer.buf = NULL;
1867 __pyx_pybuffer_order.refcount = 0;
1868 __pyx_pybuffernd_order.data = NULL;
1869 __pyx_pybuffernd_order.rcbuffer = &__pyx_pybuffer_order;
1870 __pyx_pybuffer_suppressed.pybuffer.buf = NULL;
1871 __pyx_pybuffer_suppressed.refcount = 0;
1872 __pyx_pybuffernd_suppressed.data = NULL;
1873 __pyx_pybuffernd_suppressed.rcbuffer = &__pyx_pybuffer_suppressed;
1874 __pyx_pybuffer_dets.pybuffer.buf = NULL;
1875 __pyx_pybuffer_dets.refcount = 0;
1876 __pyx_pybuffernd_dets.data = NULL;
1877 __pyx_pybuffernd_dets.rcbuffer = &__pyx_pybuffer_dets;
1879 __Pyx_BufFmt_StackElem __pyx_stack[1];
1880 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dets.rcbuffer->pybuffer, (PyObject*)__pyx_v_dets, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 17, __pyx_L1_error)
1882 __pyx_pybuffernd_dets.diminfo[0].strides = __pyx_pybuffernd_dets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dets.diminfo[0].shape = __pyx_pybuffernd_dets.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dets.diminfo[1].strides = __pyx_pybuffernd_dets.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dets.diminfo[1].shape = __pyx_pybuffernd_dets.rcbuffer->pybuffer.shape[1];
1886 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
1887 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0] # <<<<<<<<<<<<<<
1888 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
1889 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
1891 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
1892 __Pyx_GOTREF(__pyx_t_1);
1893 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 18, __pyx_L1_error)
1894 __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
1896 __Pyx_BufFmt_StackElem __pyx_stack[1];
1897 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x1.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
1898 __pyx_v_x1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x1.rcbuffer->pybuffer.buf = NULL;
1899 __PYX_ERR(0, 18, __pyx_L1_error)
1900 } else {__pyx_pybuffernd_x1.diminfo[0].strides = __pyx_pybuffernd_x1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x1.diminfo[0].shape = __pyx_pybuffernd_x1.rcbuffer->pybuffer.shape[0];
1904 __pyx_v_x1 = ((PyArrayObject *)__pyx_t_1);
1908 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
1909 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
1910 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1] # <<<<<<<<<<<<<<
1911 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
1912 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
1914 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
1915 __Pyx_GOTREF(__pyx_t_1);
1916 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 19, __pyx_L1_error)
1917 __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
1919 __Pyx_BufFmt_StackElem __pyx_stack[1];
1920 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
1921 __pyx_v_y1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y1.rcbuffer->pybuffer.buf = NULL;
1922 __PYX_ERR(0, 19, __pyx_L1_error)
1923 } else {__pyx_pybuffernd_y1.diminfo[0].strides = __pyx_pybuffernd_y1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y1.diminfo[0].shape = __pyx_pybuffernd_y1.rcbuffer->pybuffer.shape[0];
1927 __pyx_v_y1 = ((PyArrayObject *)__pyx_t_1);
1931 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
1932 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
1933 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2] # <<<<<<<<<<<<<<
1934 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
1935 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
1937 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
1938 __Pyx_GOTREF(__pyx_t_1);
1939 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 20, __pyx_L1_error)
1940 __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
1942 __Pyx_BufFmt_StackElem __pyx_stack[1];
1943 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x2.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
1944 __pyx_v_x2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x2.rcbuffer->pybuffer.buf = NULL;
1945 __PYX_ERR(0, 20, __pyx_L1_error)
1946 } else {__pyx_pybuffernd_x2.diminfo[0].strides = __pyx_pybuffernd_x2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x2.diminfo[0].shape = __pyx_pybuffernd_x2.rcbuffer->pybuffer.shape[0];
1950 __pyx_v_x2 = ((PyArrayObject *)__pyx_t_1);
1954 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
1955 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
1956 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3] # <<<<<<<<<<<<<<
1957 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
1960 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
1961 __Pyx_GOTREF(__pyx_t_1);
1962 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 21, __pyx_L1_error)
1963 __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
1965 __Pyx_BufFmt_StackElem __pyx_stack[1];
1966 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y2.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
1967 __pyx_v_y2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y2.rcbuffer->pybuffer.buf = NULL;
1968 __PYX_ERR(0, 21, __pyx_L1_error)
1969 } else {__pyx_pybuffernd_y2.diminfo[0].strides = __pyx_pybuffernd_y2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y2.diminfo[0].shape = __pyx_pybuffernd_y2.rcbuffer->pybuffer.shape[0];
1973 __pyx_v_y2 = ((PyArrayObject *)__pyx_t_1);
1977 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
1978 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
1979 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4] # <<<<<<<<<<<<<<
1981 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
1983 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
1984 __Pyx_GOTREF(__pyx_t_1);
1985 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 22, __pyx_L1_error)
1986 __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
1988 __Pyx_BufFmt_StackElem __pyx_stack[1];
1989 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
1990 __pyx_v_scores = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_scores.rcbuffer->pybuffer.buf = NULL;
1991 __PYX_ERR(0, 22, __pyx_L1_error)
1992 } else {__pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0];
1996 __pyx_v_scores = ((PyArrayObject *)__pyx_t_1);
2000 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
2002 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1) # <<<<<<<<<<<<<<
2003 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]
2006 __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_x2), ((PyObject *)__pyx_v_x1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
2007 __Pyx_GOTREF(__pyx_t_1);
2008 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 24, __pyx_L1_error)
2009 __Pyx_GOTREF(__pyx_t_7);
2010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2011 __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_y2), ((PyObject *)__pyx_v_y1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
2012 __Pyx_GOTREF(__pyx_t_1);
2013 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 24, __pyx_L1_error)
2014 __Pyx_GOTREF(__pyx_t_8);
2015 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2016 __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
2017 __Pyx_GOTREF(__pyx_t_1);
2018 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2019 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2020 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 24, __pyx_L1_error)
2021 __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
2023 __Pyx_BufFmt_StackElem __pyx_stack[1];
2024 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_areas.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2025 __pyx_v_areas = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_areas.rcbuffer->pybuffer.buf = NULL;
2026 __PYX_ERR(0, 24, __pyx_L1_error)
2027 } else {__pyx_pybuffernd_areas.diminfo[0].strides = __pyx_pybuffernd_areas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_areas.diminfo[0].shape = __pyx_pybuffernd_areas.rcbuffer->pybuffer.shape[0];
2031 __pyx_v_areas = ((PyArrayObject *)__pyx_t_1);
2036 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
2037 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1] # <<<<<<<<<<<<<<
2039 * cdef int ndets = dets.shape[0]
2041 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_argsort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 25, __pyx_L1_error)
2042 __Pyx_GOTREF(__pyx_t_8);
2044 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
2045 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
2046 if (likely(__pyx_t_7)) {
2047 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
2048 __Pyx_INCREF(__pyx_t_7);
2049 __Pyx_INCREF(function);
2050 __Pyx_DECREF_SET(__pyx_t_8, function);
2054 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
2055 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2057 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
2059 __Pyx_GOTREF(__pyx_t_1);
2060 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2061 __pyx_t_8 = PyObject_GetItem(__pyx_t_1, __pyx_slice__11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 25, __pyx_L1_error)
2062 __Pyx_GOTREF(__pyx_t_8);
2063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2064 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 25, __pyx_L1_error)
2065 __pyx_t_10 = ((PyArrayObject *)__pyx_t_8);
2067 __Pyx_BufFmt_StackElem __pyx_stack[1];
2068 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_order.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2069 __pyx_v_order = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_order.rcbuffer->pybuffer.buf = NULL;
2070 __PYX_ERR(0, 25, __pyx_L1_error)
2071 } else {__pyx_pybuffernd_order.diminfo[0].strides = __pyx_pybuffernd_order.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_order.diminfo[0].shape = __pyx_pybuffernd_order.rcbuffer->pybuffer.shape[0];
2075 __pyx_v_order = ((PyArrayObject *)__pyx_t_8);
2079 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]
2081 * cdef int ndets = dets.shape[0] # <<<<<<<<<<<<<<
2082 * cdef np.ndarray[np.int_t, ndim=1] suppressed = \
2083 * np.zeros((ndets), dtype=np.int)
2085 __pyx_v_ndets = (__pyx_v_dets->dimensions[0]);
2088 * cdef int ndets = dets.shape[0]
2089 * cdef np.ndarray[np.int_t, ndim=1] suppressed = \
2090 * np.zeros((ndets), dtype=np.int) # <<<<<<<<<<<<<<
2094 __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
2095 __Pyx_GOTREF(__pyx_t_8);
2096 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
2097 __Pyx_GOTREF(__pyx_t_1);
2098 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2099 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_ndets); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
2100 __Pyx_GOTREF(__pyx_t_8);
2101 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
2102 __Pyx_GOTREF(__pyx_t_7);
2103 __Pyx_GIVEREF(__pyx_t_8);
2104 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
2106 __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
2107 __Pyx_GOTREF(__pyx_t_8);
2108 __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 29, __pyx_L1_error)
2109 __Pyx_GOTREF(__pyx_t_11);
2110 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 29, __pyx_L1_error)
2111 __Pyx_GOTREF(__pyx_t_12);
2112 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
2113 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
2114 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
2115 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 29, __pyx_L1_error)
2116 __Pyx_GOTREF(__pyx_t_12);
2117 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2118 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2119 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2120 if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 29, __pyx_L1_error)
2121 __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
2123 __Pyx_BufFmt_StackElem __pyx_stack[1];
2124 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_suppressed.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
2125 __pyx_v_suppressed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf = NULL;
2126 __PYX_ERR(0, 28, __pyx_L1_error)
2127 } else {__pyx_pybuffernd_suppressed.diminfo[0].strides = __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_suppressed.diminfo[0].shape = __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.shape[0];
2131 __pyx_v_suppressed = ((PyArrayObject *)__pyx_t_12);
2135 * cdef np.float32_t inter, ovr
2137 * keep = [] # <<<<<<<<<<<<<<
2138 * for _i in range(ndets):
2141 __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 42, __pyx_L1_error)
2142 __Pyx_GOTREF(__pyx_t_12);
2143 __pyx_v_keep = ((PyObject*)__pyx_t_12);
2149 * for _i in range(ndets): # <<<<<<<<<<<<<<
2151 * if suppressed[i] == 1:
2153 __pyx_t_14 = __pyx_v_ndets;
2154 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
2155 __pyx_v__i = __pyx_t_15;
2159 * for _i in range(ndets):
2160 * i = order[_i] # <<<<<<<<<<<<<<
2161 * if suppressed[i] == 1:
2164 __pyx_t_16 = __pyx_v__i;
2166 if (__pyx_t_16 < 0) {
2167 __pyx_t_16 += __pyx_pybuffernd_order.diminfo[0].shape;
2168 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
2169 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_17 = 0;
2170 if (unlikely(__pyx_t_17 != -1)) {
2171 __Pyx_RaiseBufferIndexError(__pyx_t_17);
2172 __PYX_ERR(0, 44, __pyx_L1_error)
2174 __pyx_v_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_order.diminfo[0].strides));
2177 * for _i in range(ndets):
2179 * if suppressed[i] == 1: # <<<<<<<<<<<<<<
2183 __pyx_t_18 = __pyx_v_i;
2185 if (__pyx_t_18 < 0) {
2186 __pyx_t_18 += __pyx_pybuffernd_suppressed.diminfo[0].shape;
2187 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
2188 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_suppressed.diminfo[0].shape)) __pyx_t_17 = 0;
2189 if (unlikely(__pyx_t_17 != -1)) {
2190 __Pyx_RaiseBufferIndexError(__pyx_t_17);
2191 __PYX_ERR(0, 45, __pyx_L1_error)
2193 __pyx_t_19 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_suppressed.diminfo[0].strides)) == 1) != 0);
2198 * if suppressed[i] == 1:
2199 * continue # <<<<<<<<<<<<<<
2203 goto __pyx_L3_continue;
2206 * for _i in range(ndets):
2208 * if suppressed[i] == 1: # <<<<<<<<<<<<<<
2215 * if suppressed[i] == 1:
2217 * keep.append(i) # <<<<<<<<<<<<<<
2221 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
2222 __Pyx_GOTREF(__pyx_t_12);
2223 __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_keep, __pyx_t_12); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 47, __pyx_L1_error)
2224 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
2229 * ix1 = x1[i] # <<<<<<<<<<<<<<
2233 __pyx_t_21 = __pyx_v_i;
2235 if (__pyx_t_21 < 0) {
2236 __pyx_t_21 += __pyx_pybuffernd_x1.diminfo[0].shape;
2237 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 0;
2238 } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x1.diminfo[0].shape)) __pyx_t_17 = 0;
2239 if (unlikely(__pyx_t_17 != -1)) {
2240 __Pyx_RaiseBufferIndexError(__pyx_t_17);
2241 __PYX_ERR(0, 48, __pyx_L1_error)
2243 __pyx_v_ix1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x1.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x1.diminfo[0].strides));
2248 * iy1 = y1[i] # <<<<<<<<<<<<<<
2252 __pyx_t_22 = __pyx_v_i;
2254 if (__pyx_t_22 < 0) {
2255 __pyx_t_22 += __pyx_pybuffernd_y1.diminfo[0].shape;
2256 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
2257 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_y1.diminfo[0].shape)) __pyx_t_17 = 0;
2258 if (unlikely(__pyx_t_17 != -1)) {
2259 __Pyx_RaiseBufferIndexError(__pyx_t_17);
2260 __PYX_ERR(0, 49, __pyx_L1_error)
2262 __pyx_v_iy1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y1.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_y1.diminfo[0].strides));
2267 * ix2 = x2[i] # <<<<<<<<<<<<<<
2271 __pyx_t_23 = __pyx_v_i;
2273 if (__pyx_t_23 < 0) {
2274 __pyx_t_23 += __pyx_pybuffernd_x2.diminfo[0].shape;
2275 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 0;
2276 } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x2.diminfo[0].shape)) __pyx_t_17 = 0;
2277 if (unlikely(__pyx_t_17 != -1)) {
2278 __Pyx_RaiseBufferIndexError(__pyx_t_17);
2279 __PYX_ERR(0, 50, __pyx_L1_error)
2281 __pyx_v_ix2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x2.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_x2.diminfo[0].strides));
2286 * iy2 = y2[i] # <<<<<<<<<<<<<<
2288 * for _j in range(_i + 1, ndets):
2290 __pyx_t_24 = __pyx_v_i;
2292 if (__pyx_t_24 < 0) {
2293 __pyx_t_24 += __pyx_pybuffernd_y2.diminfo[0].shape;
2294 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 0;
2295 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_y2.diminfo[0].shape)) __pyx_t_17 = 0;
2296 if (unlikely(__pyx_t_17 != -1)) {
2297 __Pyx_RaiseBufferIndexError(__pyx_t_17);
2298 __PYX_ERR(0, 51, __pyx_L1_error)
2300 __pyx_v_iy2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y2.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_y2.diminfo[0].strides));
2305 * iarea = areas[i] # <<<<<<<<<<<<<<
2306 * for _j in range(_i + 1, ndets):
2309 __pyx_t_25 = __pyx_v_i;
2311 if (__pyx_t_25 < 0) {
2312 __pyx_t_25 += __pyx_pybuffernd_areas.diminfo[0].shape;
2313 if (unlikely(__pyx_t_25 < 0)) __pyx_t_17 = 0;
2314 } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_areas.diminfo[0].shape)) __pyx_t_17 = 0;
2315 if (unlikely(__pyx_t_17 != -1)) {
2316 __Pyx_RaiseBufferIndexError(__pyx_t_17);
2317 __PYX_ERR(0, 52, __pyx_L1_error)
2319 __pyx_v_iarea = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_areas.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_areas.diminfo[0].strides));
2324 * for _j in range(_i + 1, ndets): # <<<<<<<<<<<<<<
2326 * if suppressed[j] == 1:
2328 __pyx_t_17 = __pyx_v_ndets;
2329 for (__pyx_t_26 = (__pyx_v__i + 1); __pyx_t_26 < __pyx_t_17; __pyx_t_26+=1) {
2330 __pyx_v__j = __pyx_t_26;
2334 * for _j in range(_i + 1, ndets):
2335 * j = order[_j] # <<<<<<<<<<<<<<
2336 * if suppressed[j] == 1:
2339 __pyx_t_27 = __pyx_v__j;
2341 if (__pyx_t_27 < 0) {
2342 __pyx_t_27 += __pyx_pybuffernd_order.diminfo[0].shape;
2343 if (unlikely(__pyx_t_27 < 0)) __pyx_t_28 = 0;
2344 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_28 = 0;
2345 if (unlikely(__pyx_t_28 != -1)) {
2346 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2347 __PYX_ERR(0, 54, __pyx_L1_error)
2349 __pyx_v_j = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_order.diminfo[0].strides));
2352 * for _j in range(_i + 1, ndets):
2354 * if suppressed[j] == 1: # <<<<<<<<<<<<<<
2356 * xx1 = max(ix1, x1[j])
2358 __pyx_t_29 = __pyx_v_j;
2360 if (__pyx_t_29 < 0) {
2361 __pyx_t_29 += __pyx_pybuffernd_suppressed.diminfo[0].shape;
2362 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
2363 } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_suppressed.diminfo[0].shape)) __pyx_t_28 = 0;
2364 if (unlikely(__pyx_t_28 != -1)) {
2365 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2366 __PYX_ERR(0, 55, __pyx_L1_error)
2368 __pyx_t_19 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_suppressed.diminfo[0].strides)) == 1) != 0);
2373 * if suppressed[j] == 1:
2374 * continue # <<<<<<<<<<<<<<
2375 * xx1 = max(ix1, x1[j])
2376 * yy1 = max(iy1, y1[j])
2378 goto __pyx_L6_continue;
2381 * for _j in range(_i + 1, ndets):
2383 * if suppressed[j] == 1: # <<<<<<<<<<<<<<
2385 * xx1 = max(ix1, x1[j])
2390 * if suppressed[j] == 1:
2392 * xx1 = max(ix1, x1[j]) # <<<<<<<<<<<<<<
2393 * yy1 = max(iy1, y1[j])
2394 * xx2 = min(ix2, x2[j])
2396 __pyx_t_30 = __pyx_v_j;
2398 if (__pyx_t_30 < 0) {
2399 __pyx_t_30 += __pyx_pybuffernd_x1.diminfo[0].shape;
2400 if (unlikely(__pyx_t_30 < 0)) __pyx_t_28 = 0;
2401 } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x1.diminfo[0].shape)) __pyx_t_28 = 0;
2402 if (unlikely(__pyx_t_28 != -1)) {
2403 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2404 __PYX_ERR(0, 57, __pyx_L1_error)
2406 __pyx_v_xx1 = __pyx_f_10cython_nms_max(__pyx_v_ix1, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x1.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_x1.diminfo[0].strides)));
2410 * xx1 = max(ix1, x1[j])
2411 * yy1 = max(iy1, y1[j]) # <<<<<<<<<<<<<<
2412 * xx2 = min(ix2, x2[j])
2413 * yy2 = min(iy2, y2[j])
2415 __pyx_t_31 = __pyx_v_j;
2417 if (__pyx_t_31 < 0) {
2418 __pyx_t_31 += __pyx_pybuffernd_y1.diminfo[0].shape;
2419 if (unlikely(__pyx_t_31 < 0)) __pyx_t_28 = 0;
2420 } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_y1.diminfo[0].shape)) __pyx_t_28 = 0;
2421 if (unlikely(__pyx_t_28 != -1)) {
2422 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2423 __PYX_ERR(0, 58, __pyx_L1_error)
2425 __pyx_v_yy1 = __pyx_f_10cython_nms_max(__pyx_v_iy1, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y1.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_y1.diminfo[0].strides)));
2428 * xx1 = max(ix1, x1[j])
2429 * yy1 = max(iy1, y1[j])
2430 * xx2 = min(ix2, x2[j]) # <<<<<<<<<<<<<<
2431 * yy2 = min(iy2, y2[j])
2432 * w = max(0.0, xx2 - xx1 + 1)
2434 __pyx_t_32 = __pyx_v_j;
2436 if (__pyx_t_32 < 0) {
2437 __pyx_t_32 += __pyx_pybuffernd_x2.diminfo[0].shape;
2438 if (unlikely(__pyx_t_32 < 0)) __pyx_t_28 = 0;
2439 } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x2.diminfo[0].shape)) __pyx_t_28 = 0;
2440 if (unlikely(__pyx_t_28 != -1)) {
2441 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2442 __PYX_ERR(0, 59, __pyx_L1_error)
2444 __pyx_v_xx2 = __pyx_f_10cython_nms_min(__pyx_v_ix2, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x2.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_x2.diminfo[0].strides)));
2447 * yy1 = max(iy1, y1[j])
2448 * xx2 = min(ix2, x2[j])
2449 * yy2 = min(iy2, y2[j]) # <<<<<<<<<<<<<<
2450 * w = max(0.0, xx2 - xx1 + 1)
2451 * h = max(0.0, yy2 - yy1 + 1)
2453 __pyx_t_33 = __pyx_v_j;
2455 if (__pyx_t_33 < 0) {
2456 __pyx_t_33 += __pyx_pybuffernd_y2.diminfo[0].shape;
2457 if (unlikely(__pyx_t_33 < 0)) __pyx_t_28 = 0;
2458 } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_y2.diminfo[0].shape)) __pyx_t_28 = 0;
2459 if (unlikely(__pyx_t_28 != -1)) {
2460 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2461 __PYX_ERR(0, 60, __pyx_L1_error)
2463 __pyx_v_yy2 = __pyx_f_10cython_nms_min(__pyx_v_iy2, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y2.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_y2.diminfo[0].strides)));
2466 * xx2 = min(ix2, x2[j])
2467 * yy2 = min(iy2, y2[j])
2468 * w = max(0.0, xx2 - xx1 + 1) # <<<<<<<<<<<<<<
2469 * h = max(0.0, yy2 - yy1 + 1)
2472 __pyx_v_w = __pyx_f_10cython_nms_max(0.0, ((__pyx_v_xx2 - __pyx_v_xx1) + 1.0));
2475 * yy2 = min(iy2, y2[j])
2476 * w = max(0.0, xx2 - xx1 + 1)
2477 * h = max(0.0, yy2 - yy1 + 1) # <<<<<<<<<<<<<<
2479 * ovr = inter / (iarea + areas[j] - inter)
2481 __pyx_v_h = __pyx_f_10cython_nms_max(0.0, ((__pyx_v_yy2 - __pyx_v_yy1) + 1.0));
2484 * w = max(0.0, xx2 - xx1 + 1)
2485 * h = max(0.0, yy2 - yy1 + 1)
2486 * inter = w * h # <<<<<<<<<<<<<<
2487 * ovr = inter / (iarea + areas[j] - inter)
2490 __pyx_v_inter = (__pyx_v_w * __pyx_v_h);
2493 * h = max(0.0, yy2 - yy1 + 1)
2495 * ovr = inter / (iarea + areas[j] - inter) # <<<<<<<<<<<<<<
2499 __pyx_t_34 = __pyx_v_j;
2501 if (__pyx_t_34 < 0) {
2502 __pyx_t_34 += __pyx_pybuffernd_areas.diminfo[0].shape;
2503 if (unlikely(__pyx_t_34 < 0)) __pyx_t_28 = 0;
2504 } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_areas.diminfo[0].shape)) __pyx_t_28 = 0;
2505 if (unlikely(__pyx_t_28 != -1)) {
2506 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2507 __PYX_ERR(0, 64, __pyx_L1_error)
2509 __pyx_t_35 = ((__pyx_v_iarea + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_areas.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_areas.diminfo[0].strides))) - __pyx_v_inter);
2510 if (unlikely(__pyx_t_35 == 0)) {
2511 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
2512 __PYX_ERR(0, 64, __pyx_L1_error)
2514 __pyx_v_ovr = (__pyx_v_inter / __pyx_t_35);
2518 * ovr = inter / (iarea + areas[j] - inter)
2519 * if ovr >= thresh: # <<<<<<<<<<<<<<
2523 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_ovr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 65, __pyx_L1_error)
2524 __Pyx_GOTREF(__pyx_t_12);
2525 __pyx_t_8 = PyObject_RichCompare(__pyx_t_12, __pyx_v_thresh, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 65, __pyx_L1_error)
2526 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
2527 __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 65, __pyx_L1_error)
2528 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2532 * ovr = inter / (iarea + areas[j] - inter)
2534 * suppressed[j] = 1 # <<<<<<<<<<<<<<
2538 __pyx_t_36 = __pyx_v_j;
2540 if (__pyx_t_36 < 0) {
2541 __pyx_t_36 += __pyx_pybuffernd_suppressed.diminfo[0].shape;
2542 if (unlikely(__pyx_t_36 < 0)) __pyx_t_28 = 0;
2543 } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_suppressed.diminfo[0].shape)) __pyx_t_28 = 0;
2544 if (unlikely(__pyx_t_28 != -1)) {
2545 __Pyx_RaiseBufferIndexError(__pyx_t_28);
2546 __PYX_ERR(0, 66, __pyx_L1_error)
2548 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_suppressed.diminfo[0].strides) = 1;
2552 * ovr = inter / (iarea + areas[j] - inter)
2553 * if ovr >= thresh: # <<<<<<<<<<<<<<
2566 * return keep # <<<<<<<<<<<<<<
2568 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
2570 __Pyx_XDECREF(__pyx_r);
2571 __Pyx_INCREF(__pyx_v_keep);
2572 __pyx_r = __pyx_v_keep;
2576 * return a if a <= b else b
2578 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
2579 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
2580 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
2583 /* function exit code */
2585 __Pyx_XDECREF(__pyx_t_1);
2586 __Pyx_XDECREF(__pyx_t_7);
2587 __Pyx_XDECREF(__pyx_t_8);
2588 __Pyx_XDECREF(__pyx_t_11);
2589 __Pyx_XDECREF(__pyx_t_12);
2590 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2591 __Pyx_PyThreadState_declare
2592 __Pyx_PyThreadState_assign
2593 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2594 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_areas.rcbuffer->pybuffer);
2595 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dets.rcbuffer->pybuffer);
2596 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
2597 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
2598 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_suppressed.rcbuffer->pybuffer);
2599 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x1.rcbuffer->pybuffer);
2600 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x2.rcbuffer->pybuffer);
2601 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y1.rcbuffer->pybuffer);
2602 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y2.rcbuffer->pybuffer);
2603 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2604 __Pyx_AddTraceback("cython_nms.nms", __pyx_clineno, __pyx_lineno, __pyx_filename);
2608 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_areas.rcbuffer->pybuffer);
2609 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dets.rcbuffer->pybuffer);
2610 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
2611 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
2612 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_suppressed.rcbuffer->pybuffer);
2613 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x1.rcbuffer->pybuffer);
2614 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x2.rcbuffer->pybuffer);
2615 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y1.rcbuffer->pybuffer);
2616 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y2.rcbuffer->pybuffer);
2618 __Pyx_XDECREF((PyObject *)__pyx_v_x1);
2619 __Pyx_XDECREF((PyObject *)__pyx_v_y1);
2620 __Pyx_XDECREF((PyObject *)__pyx_v_x2);
2621 __Pyx_XDECREF((PyObject *)__pyx_v_y2);
2622 __Pyx_XDECREF((PyObject *)__pyx_v_scores);
2623 __Pyx_XDECREF((PyObject *)__pyx_v_areas);
2624 __Pyx_XDECREF((PyObject *)__pyx_v_order);
2625 __Pyx_XDECREF((PyObject *)__pyx_v_suppressed);
2626 __Pyx_XDECREF(__pyx_v_keep);
2627 __Pyx_XGIVEREF(__pyx_r);
2628 __Pyx_RefNannyFinishContext();
2635 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
2636 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
2637 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
2640 /* Python wrapper */
2641 static PyObject *__pyx_pw_10cython_nms_3nms_new(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2642 static PyMethodDef __pyx_mdef_10cython_nms_3nms_new = {"nms_new", (PyCFunction)__pyx_pw_10cython_nms_3nms_new, METH_VARARGS|METH_KEYWORDS, 0};
2643 static PyObject *__pyx_pw_10cython_nms_3nms_new(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2644 PyArrayObject *__pyx_v_dets = 0;
2645 PyObject *__pyx_v_thresh = 0;
2646 PyObject *__pyx_r = 0;
2647 __Pyx_RefNannyDeclarations
2648 __Pyx_RefNannySetupContext("nms_new (wrapper)", 0);
2650 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dets,&__pyx_n_s_thresh,0};
2651 PyObject* values[2] = {0,0};
2652 if (unlikely(__pyx_kwds)) {
2654 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2656 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2657 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2659 default: goto __pyx_L5_argtuple_error;
2661 kw_args = PyDict_Size(__pyx_kwds);
2664 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dets)) != 0)) kw_args--;
2665 else goto __pyx_L5_argtuple_error;
2667 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thresh)) != 0)) kw_args--;
2669 __Pyx_RaiseArgtupleInvalid("nms_new", 1, 2, 2, 1); __PYX_ERR(0, 70, __pyx_L3_error)
2672 if (unlikely(kw_args > 0)) {
2673 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nms_new") < 0)) __PYX_ERR(0, 70, __pyx_L3_error)
2675 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2676 goto __pyx_L5_argtuple_error;
2678 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2679 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2681 __pyx_v_dets = ((PyArrayObject *)values[0]);
2682 __pyx_v_thresh = ((PyObject*)values[1]);
2684 goto __pyx_L4_argument_unpacking_done;
2685 __pyx_L5_argtuple_error:;
2686 __Pyx_RaiseArgtupleInvalid("nms_new", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error)
2688 __Pyx_AddTraceback("cython_nms.nms_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
2689 __Pyx_RefNannyFinishContext();
2691 __pyx_L4_argument_unpacking_done:;
2692 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dets), __pyx_ptype_5numpy_ndarray, 1, "dets", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
2693 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thresh), (&PyFloat_Type), 1, "thresh", 1))) __PYX_ERR(0, 70, __pyx_L1_error)
2694 __pyx_r = __pyx_pf_10cython_nms_2nms_new(__pyx_self, __pyx_v_dets, __pyx_v_thresh);
2696 /* function exit code */
2701 __Pyx_RefNannyFinishContext();
2705 static PyObject *__pyx_pf_10cython_nms_2nms_new(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dets, PyObject *__pyx_v_thresh) {
2706 PyArrayObject *__pyx_v_x1 = 0;
2707 PyArrayObject *__pyx_v_y1 = 0;
2708 PyArrayObject *__pyx_v_x2 = 0;
2709 PyArrayObject *__pyx_v_y2 = 0;
2710 PyArrayObject *__pyx_v_scores = 0;
2711 PyArrayObject *__pyx_v_areas = 0;
2712 PyArrayObject *__pyx_v_order = 0;
2714 PyArrayObject *__pyx_v_suppressed = 0;
2719 __pyx_t_5numpy_float32_t __pyx_v_ix1;
2720 __pyx_t_5numpy_float32_t __pyx_v_iy1;
2721 __pyx_t_5numpy_float32_t __pyx_v_ix2;
2722 __pyx_t_5numpy_float32_t __pyx_v_iy2;
2723 __pyx_t_5numpy_float32_t __pyx_v_iarea;
2724 __pyx_t_5numpy_float32_t __pyx_v_xx1;
2725 __pyx_t_5numpy_float32_t __pyx_v_yy1;
2726 __pyx_t_5numpy_float32_t __pyx_v_xx2;
2727 __pyx_t_5numpy_float32_t __pyx_v_yy2;
2728 __pyx_t_5numpy_float32_t __pyx_v_w;
2729 __pyx_t_5numpy_float32_t __pyx_v_h;
2730 __pyx_t_5numpy_float32_t __pyx_v_inter;
2731 __pyx_t_5numpy_float32_t __pyx_v_ovr;
2732 PyObject *__pyx_v_keep = NULL;
2733 PyObject *__pyx_v_ovr1 = NULL;
2734 PyObject *__pyx_v_ovr2 = NULL;
2735 __Pyx_LocalBuf_ND __pyx_pybuffernd_areas;
2736 __Pyx_Buffer __pyx_pybuffer_areas;
2737 __Pyx_LocalBuf_ND __pyx_pybuffernd_dets;
2738 __Pyx_Buffer __pyx_pybuffer_dets;
2739 __Pyx_LocalBuf_ND __pyx_pybuffernd_order;
2740 __Pyx_Buffer __pyx_pybuffer_order;
2741 __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
2742 __Pyx_Buffer __pyx_pybuffer_scores;
2743 __Pyx_LocalBuf_ND __pyx_pybuffernd_suppressed;
2744 __Pyx_Buffer __pyx_pybuffer_suppressed;
2745 __Pyx_LocalBuf_ND __pyx_pybuffernd_x1;
2746 __Pyx_Buffer __pyx_pybuffer_x1;
2747 __Pyx_LocalBuf_ND __pyx_pybuffernd_x2;
2748 __Pyx_Buffer __pyx_pybuffer_x2;
2749 __Pyx_LocalBuf_ND __pyx_pybuffernd_y1;
2750 __Pyx_Buffer __pyx_pybuffer_y1;
2751 __Pyx_LocalBuf_ND __pyx_pybuffernd_y2;
2752 __Pyx_Buffer __pyx_pybuffer_y2;
2753 PyObject *__pyx_r = NULL;
2754 __Pyx_RefNannyDeclarations
2755 PyObject *__pyx_t_1 = NULL;
2756 PyArrayObject *__pyx_t_2 = NULL;
2757 PyArrayObject *__pyx_t_3 = NULL;
2758 PyArrayObject *__pyx_t_4 = NULL;
2759 PyArrayObject *__pyx_t_5 = NULL;
2760 PyArrayObject *__pyx_t_6 = NULL;
2761 PyObject *__pyx_t_7 = NULL;
2762 PyObject *__pyx_t_8 = NULL;
2763 PyArrayObject *__pyx_t_9 = NULL;
2764 PyArrayObject *__pyx_t_10 = NULL;
2765 PyObject *__pyx_t_11 = NULL;
2766 PyObject *__pyx_t_12 = NULL;
2767 PyArrayObject *__pyx_t_13 = NULL;
2770 Py_ssize_t __pyx_t_16;
2772 Py_ssize_t __pyx_t_18;
2775 Py_ssize_t __pyx_t_21;
2776 Py_ssize_t __pyx_t_22;
2777 Py_ssize_t __pyx_t_23;
2778 Py_ssize_t __pyx_t_24;
2779 Py_ssize_t __pyx_t_25;
2781 Py_ssize_t __pyx_t_27;
2783 Py_ssize_t __pyx_t_29;
2784 Py_ssize_t __pyx_t_30;
2785 Py_ssize_t __pyx_t_31;
2786 Py_ssize_t __pyx_t_32;
2787 Py_ssize_t __pyx_t_33;
2788 Py_ssize_t __pyx_t_34;
2789 __pyx_t_5numpy_float32_t __pyx_t_35;
2790 Py_ssize_t __pyx_t_36;
2792 Py_ssize_t __pyx_t_38;
2793 __Pyx_RefNannySetupContext("nms_new", 0);
2794 __pyx_pybuffer_x1.pybuffer.buf = NULL;
2795 __pyx_pybuffer_x1.refcount = 0;
2796 __pyx_pybuffernd_x1.data = NULL;
2797 __pyx_pybuffernd_x1.rcbuffer = &__pyx_pybuffer_x1;
2798 __pyx_pybuffer_y1.pybuffer.buf = NULL;
2799 __pyx_pybuffer_y1.refcount = 0;
2800 __pyx_pybuffernd_y1.data = NULL;
2801 __pyx_pybuffernd_y1.rcbuffer = &__pyx_pybuffer_y1;
2802 __pyx_pybuffer_x2.pybuffer.buf = NULL;
2803 __pyx_pybuffer_x2.refcount = 0;
2804 __pyx_pybuffernd_x2.data = NULL;
2805 __pyx_pybuffernd_x2.rcbuffer = &__pyx_pybuffer_x2;
2806 __pyx_pybuffer_y2.pybuffer.buf = NULL;
2807 __pyx_pybuffer_y2.refcount = 0;
2808 __pyx_pybuffernd_y2.data = NULL;
2809 __pyx_pybuffernd_y2.rcbuffer = &__pyx_pybuffer_y2;
2810 __pyx_pybuffer_scores.pybuffer.buf = NULL;
2811 __pyx_pybuffer_scores.refcount = 0;
2812 __pyx_pybuffernd_scores.data = NULL;
2813 __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
2814 __pyx_pybuffer_areas.pybuffer.buf = NULL;
2815 __pyx_pybuffer_areas.refcount = 0;
2816 __pyx_pybuffernd_areas.data = NULL;
2817 __pyx_pybuffernd_areas.rcbuffer = &__pyx_pybuffer_areas;
2818 __pyx_pybuffer_order.pybuffer.buf = NULL;
2819 __pyx_pybuffer_order.refcount = 0;
2820 __pyx_pybuffernd_order.data = NULL;
2821 __pyx_pybuffernd_order.rcbuffer = &__pyx_pybuffer_order;
2822 __pyx_pybuffer_suppressed.pybuffer.buf = NULL;
2823 __pyx_pybuffer_suppressed.refcount = 0;
2824 __pyx_pybuffernd_suppressed.data = NULL;
2825 __pyx_pybuffernd_suppressed.rcbuffer = &__pyx_pybuffer_suppressed;
2826 __pyx_pybuffer_dets.pybuffer.buf = NULL;
2827 __pyx_pybuffer_dets.refcount = 0;
2828 __pyx_pybuffernd_dets.data = NULL;
2829 __pyx_pybuffernd_dets.rcbuffer = &__pyx_pybuffer_dets;
2831 __Pyx_BufFmt_StackElem __pyx_stack[1];
2832 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dets.rcbuffer->pybuffer, (PyObject*)__pyx_v_dets, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 70, __pyx_L1_error)
2834 __pyx_pybuffernd_dets.diminfo[0].strides = __pyx_pybuffernd_dets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dets.diminfo[0].shape = __pyx_pybuffernd_dets.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dets.diminfo[1].strides = __pyx_pybuffernd_dets.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dets.diminfo[1].shape = __pyx_pybuffernd_dets.rcbuffer->pybuffer.shape[1];
2838 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
2839 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0] # <<<<<<<<<<<<<<
2840 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
2841 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
2843 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
2844 __Pyx_GOTREF(__pyx_t_1);
2845 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 71, __pyx_L1_error)
2846 __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
2848 __Pyx_BufFmt_StackElem __pyx_stack[1];
2849 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x1.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2850 __pyx_v_x1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x1.rcbuffer->pybuffer.buf = NULL;
2851 __PYX_ERR(0, 71, __pyx_L1_error)
2852 } else {__pyx_pybuffernd_x1.diminfo[0].strides = __pyx_pybuffernd_x1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x1.diminfo[0].shape = __pyx_pybuffernd_x1.rcbuffer->pybuffer.shape[0];
2856 __pyx_v_x1 = ((PyArrayObject *)__pyx_t_1);
2860 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
2861 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
2862 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1] # <<<<<<<<<<<<<<
2863 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
2864 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
2866 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
2867 __Pyx_GOTREF(__pyx_t_1);
2868 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 72, __pyx_L1_error)
2869 __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
2871 __Pyx_BufFmt_StackElem __pyx_stack[1];
2872 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2873 __pyx_v_y1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y1.rcbuffer->pybuffer.buf = NULL;
2874 __PYX_ERR(0, 72, __pyx_L1_error)
2875 } else {__pyx_pybuffernd_y1.diminfo[0].strides = __pyx_pybuffernd_y1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y1.diminfo[0].shape = __pyx_pybuffernd_y1.rcbuffer->pybuffer.shape[0];
2879 __pyx_v_y1 = ((PyArrayObject *)__pyx_t_1);
2883 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
2884 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
2885 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2] # <<<<<<<<<<<<<<
2886 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
2887 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
2889 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
2890 __Pyx_GOTREF(__pyx_t_1);
2891 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 73, __pyx_L1_error)
2892 __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
2894 __Pyx_BufFmt_StackElem __pyx_stack[1];
2895 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x2.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2896 __pyx_v_x2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_x2.rcbuffer->pybuffer.buf = NULL;
2897 __PYX_ERR(0, 73, __pyx_L1_error)
2898 } else {__pyx_pybuffernd_x2.diminfo[0].strides = __pyx_pybuffernd_x2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x2.diminfo[0].shape = __pyx_pybuffernd_x2.rcbuffer->pybuffer.shape[0];
2902 __pyx_v_x2 = ((PyArrayObject *)__pyx_t_1);
2906 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
2907 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
2908 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3] # <<<<<<<<<<<<<<
2909 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
2912 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
2913 __Pyx_GOTREF(__pyx_t_1);
2914 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 74, __pyx_L1_error)
2915 __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
2917 __Pyx_BufFmt_StackElem __pyx_stack[1];
2918 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y2.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2919 __pyx_v_y2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y2.rcbuffer->pybuffer.buf = NULL;
2920 __PYX_ERR(0, 74, __pyx_L1_error)
2921 } else {__pyx_pybuffernd_y2.diminfo[0].strides = __pyx_pybuffernd_y2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y2.diminfo[0].shape = __pyx_pybuffernd_y2.rcbuffer->pybuffer.shape[0];
2925 __pyx_v_y2 = ((PyArrayObject *)__pyx_t_1);
2929 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
2930 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
2931 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4] # <<<<<<<<<<<<<<
2933 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
2935 __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_dets), __pyx_tuple__21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
2936 __Pyx_GOTREF(__pyx_t_1);
2937 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 75, __pyx_L1_error)
2938 __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
2940 __Pyx_BufFmt_StackElem __pyx_stack[1];
2941 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2942 __pyx_v_scores = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_scores.rcbuffer->pybuffer.buf = NULL;
2943 __PYX_ERR(0, 75, __pyx_L1_error)
2944 } else {__pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0];
2948 __pyx_v_scores = ((PyArrayObject *)__pyx_t_1);
2952 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
2954 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1) # <<<<<<<<<<<<<<
2955 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]
2958 __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_x2), ((PyObject *)__pyx_v_x1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
2959 __Pyx_GOTREF(__pyx_t_1);
2960 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error)
2961 __Pyx_GOTREF(__pyx_t_7);
2962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2963 __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_y2), ((PyObject *)__pyx_v_y1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
2964 __Pyx_GOTREF(__pyx_t_1);
2965 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
2966 __Pyx_GOTREF(__pyx_t_8);
2967 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2968 __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
2969 __Pyx_GOTREF(__pyx_t_1);
2970 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2971 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2972 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 77, __pyx_L1_error)
2973 __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
2975 __Pyx_BufFmt_StackElem __pyx_stack[1];
2976 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_areas.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2977 __pyx_v_areas = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_areas.rcbuffer->pybuffer.buf = NULL;
2978 __PYX_ERR(0, 77, __pyx_L1_error)
2979 } else {__pyx_pybuffernd_areas.diminfo[0].strides = __pyx_pybuffernd_areas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_areas.diminfo[0].shape = __pyx_pybuffernd_areas.rcbuffer->pybuffer.shape[0];
2983 __pyx_v_areas = ((PyArrayObject *)__pyx_t_1);
2988 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
2989 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1] # <<<<<<<<<<<<<<
2991 * cdef int ndets = dets.shape[0]
2993 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_n_s_argsort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
2994 __Pyx_GOTREF(__pyx_t_8);
2996 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
2997 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
2998 if (likely(__pyx_t_7)) {
2999 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3000 __Pyx_INCREF(__pyx_t_7);
3001 __Pyx_INCREF(function);
3002 __Pyx_DECREF_SET(__pyx_t_8, function);
3006 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
3007 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3009 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
3011 __Pyx_GOTREF(__pyx_t_1);
3012 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3013 __pyx_t_8 = PyObject_GetItem(__pyx_t_1, __pyx_slice__22); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
3014 __Pyx_GOTREF(__pyx_t_8);
3015 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3016 if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 78, __pyx_L1_error)
3017 __pyx_t_10 = ((PyArrayObject *)__pyx_t_8);
3019 __Pyx_BufFmt_StackElem __pyx_stack[1];
3020 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_order.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
3021 __pyx_v_order = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_order.rcbuffer->pybuffer.buf = NULL;
3022 __PYX_ERR(0, 78, __pyx_L1_error)
3023 } else {__pyx_pybuffernd_order.diminfo[0].strides = __pyx_pybuffernd_order.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_order.diminfo[0].shape = __pyx_pybuffernd_order.rcbuffer->pybuffer.shape[0];
3027 __pyx_v_order = ((PyArrayObject *)__pyx_t_8);
3031 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]
3033 * cdef int ndets = dets.shape[0] # <<<<<<<<<<<<<<
3034 * cdef np.ndarray[np.int_t, ndim=1] suppressed = \
3035 * np.zeros((ndets), dtype=np.int)
3037 __pyx_v_ndets = (__pyx_v_dets->dimensions[0]);
3040 * cdef int ndets = dets.shape[0]
3041 * cdef np.ndarray[np.int_t, ndim=1] suppressed = \
3042 * np.zeros((ndets), dtype=np.int) # <<<<<<<<<<<<<<
3046 __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 82, __pyx_L1_error)
3047 __Pyx_GOTREF(__pyx_t_8);
3048 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
3049 __Pyx_GOTREF(__pyx_t_1);
3050 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3051 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_ndets); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 82, __pyx_L1_error)
3052 __Pyx_GOTREF(__pyx_t_8);
3053 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
3054 __Pyx_GOTREF(__pyx_t_7);
3055 __Pyx_GIVEREF(__pyx_t_8);
3056 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
3058 __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 82, __pyx_L1_error)
3059 __Pyx_GOTREF(__pyx_t_8);
3060 __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 82, __pyx_L1_error)
3061 __Pyx_GOTREF(__pyx_t_11);
3062 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 82, __pyx_L1_error)
3063 __Pyx_GOTREF(__pyx_t_12);
3064 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3065 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
3066 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3067 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 82, __pyx_L1_error)
3068 __Pyx_GOTREF(__pyx_t_12);
3069 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3070 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3071 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3072 if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 82, __pyx_L1_error)
3073 __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
3075 __Pyx_BufFmt_StackElem __pyx_stack[1];
3076 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_suppressed.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
3077 __pyx_v_suppressed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf = NULL;
3078 __PYX_ERR(0, 81, __pyx_L1_error)
3079 } else {__pyx_pybuffernd_suppressed.diminfo[0].strides = __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_suppressed.diminfo[0].shape = __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.shape[0];
3083 __pyx_v_suppressed = ((PyArrayObject *)__pyx_t_12);
3087 * cdef np.float32_t inter, ovr
3089 * keep = [] # <<<<<<<<<<<<<<
3090 * for _i in range(ndets):
3093 __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 95, __pyx_L1_error)
3094 __Pyx_GOTREF(__pyx_t_12);
3095 __pyx_v_keep = ((PyObject*)__pyx_t_12);
3101 * for _i in range(ndets): # <<<<<<<<<<<<<<
3103 * if suppressed[i] == 1:
3105 __pyx_t_14 = __pyx_v_ndets;
3106 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
3107 __pyx_v__i = __pyx_t_15;
3111 * for _i in range(ndets):
3112 * i = order[_i] # <<<<<<<<<<<<<<
3113 * if suppressed[i] == 1:
3116 __pyx_t_16 = __pyx_v__i;
3118 if (__pyx_t_16 < 0) {
3119 __pyx_t_16 += __pyx_pybuffernd_order.diminfo[0].shape;
3120 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
3121 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_17 = 0;
3122 if (unlikely(__pyx_t_17 != -1)) {
3123 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3124 __PYX_ERR(0, 97, __pyx_L1_error)
3126 __pyx_v_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_order.diminfo[0].strides));
3129 * for _i in range(ndets):
3131 * if suppressed[i] == 1: # <<<<<<<<<<<<<<
3135 __pyx_t_18 = __pyx_v_i;
3137 if (__pyx_t_18 < 0) {
3138 __pyx_t_18 += __pyx_pybuffernd_suppressed.diminfo[0].shape;
3139 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
3140 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_suppressed.diminfo[0].shape)) __pyx_t_17 = 0;
3141 if (unlikely(__pyx_t_17 != -1)) {
3142 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3143 __PYX_ERR(0, 98, __pyx_L1_error)
3145 __pyx_t_19 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_suppressed.diminfo[0].strides)) == 1) != 0);
3150 * if suppressed[i] == 1:
3151 * continue # <<<<<<<<<<<<<<
3155 goto __pyx_L3_continue;
3158 * for _i in range(ndets):
3160 * if suppressed[i] == 1: # <<<<<<<<<<<<<<
3167 * if suppressed[i] == 1:
3169 * keep.append(i) # <<<<<<<<<<<<<<
3173 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L1_error)
3174 __Pyx_GOTREF(__pyx_t_12);
3175 __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_keep, __pyx_t_12); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 100, __pyx_L1_error)
3176 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3181 * ix1 = x1[i] # <<<<<<<<<<<<<<
3185 __pyx_t_21 = __pyx_v_i;
3187 if (__pyx_t_21 < 0) {
3188 __pyx_t_21 += __pyx_pybuffernd_x1.diminfo[0].shape;
3189 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 0;
3190 } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x1.diminfo[0].shape)) __pyx_t_17 = 0;
3191 if (unlikely(__pyx_t_17 != -1)) {
3192 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3193 __PYX_ERR(0, 101, __pyx_L1_error)
3195 __pyx_v_ix1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x1.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x1.diminfo[0].strides));
3200 * iy1 = y1[i] # <<<<<<<<<<<<<<
3204 __pyx_t_22 = __pyx_v_i;
3206 if (__pyx_t_22 < 0) {
3207 __pyx_t_22 += __pyx_pybuffernd_y1.diminfo[0].shape;
3208 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
3209 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_y1.diminfo[0].shape)) __pyx_t_17 = 0;
3210 if (unlikely(__pyx_t_17 != -1)) {
3211 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3212 __PYX_ERR(0, 102, __pyx_L1_error)
3214 __pyx_v_iy1 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y1.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_y1.diminfo[0].strides));
3219 * ix2 = x2[i] # <<<<<<<<<<<<<<
3223 __pyx_t_23 = __pyx_v_i;
3225 if (__pyx_t_23 < 0) {
3226 __pyx_t_23 += __pyx_pybuffernd_x2.diminfo[0].shape;
3227 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 0;
3228 } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x2.diminfo[0].shape)) __pyx_t_17 = 0;
3229 if (unlikely(__pyx_t_17 != -1)) {
3230 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3231 __PYX_ERR(0, 103, __pyx_L1_error)
3233 __pyx_v_ix2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x2.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_x2.diminfo[0].strides));
3238 * iy2 = y2[i] # <<<<<<<<<<<<<<
3240 * for _j in range(_i + 1, ndets):
3242 __pyx_t_24 = __pyx_v_i;
3244 if (__pyx_t_24 < 0) {
3245 __pyx_t_24 += __pyx_pybuffernd_y2.diminfo[0].shape;
3246 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 0;
3247 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_y2.diminfo[0].shape)) __pyx_t_17 = 0;
3248 if (unlikely(__pyx_t_17 != -1)) {
3249 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3250 __PYX_ERR(0, 104, __pyx_L1_error)
3252 __pyx_v_iy2 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y2.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_y2.diminfo[0].strides));
3257 * iarea = areas[i] # <<<<<<<<<<<<<<
3258 * for _j in range(_i + 1, ndets):
3261 __pyx_t_25 = __pyx_v_i;
3263 if (__pyx_t_25 < 0) {
3264 __pyx_t_25 += __pyx_pybuffernd_areas.diminfo[0].shape;
3265 if (unlikely(__pyx_t_25 < 0)) __pyx_t_17 = 0;
3266 } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_areas.diminfo[0].shape)) __pyx_t_17 = 0;
3267 if (unlikely(__pyx_t_17 != -1)) {
3268 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3269 __PYX_ERR(0, 105, __pyx_L1_error)
3271 __pyx_v_iarea = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_areas.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_areas.diminfo[0].strides));
3276 * for _j in range(_i + 1, ndets): # <<<<<<<<<<<<<<
3278 * if suppressed[j] == 1:
3280 __pyx_t_17 = __pyx_v_ndets;
3281 for (__pyx_t_26 = (__pyx_v__i + 1); __pyx_t_26 < __pyx_t_17; __pyx_t_26+=1) {
3282 __pyx_v__j = __pyx_t_26;
3286 * for _j in range(_i + 1, ndets):
3287 * j = order[_j] # <<<<<<<<<<<<<<
3288 * if suppressed[j] == 1:
3291 __pyx_t_27 = __pyx_v__j;
3293 if (__pyx_t_27 < 0) {
3294 __pyx_t_27 += __pyx_pybuffernd_order.diminfo[0].shape;
3295 if (unlikely(__pyx_t_27 < 0)) __pyx_t_28 = 0;
3296 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_order.diminfo[0].shape)) __pyx_t_28 = 0;
3297 if (unlikely(__pyx_t_28 != -1)) {
3298 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3299 __PYX_ERR(0, 107, __pyx_L1_error)
3301 __pyx_v_j = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_order.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_order.diminfo[0].strides));
3304 * for _j in range(_i + 1, ndets):
3306 * if suppressed[j] == 1: # <<<<<<<<<<<<<<
3308 * xx1 = max(ix1, x1[j])
3310 __pyx_t_29 = __pyx_v_j;
3312 if (__pyx_t_29 < 0) {
3313 __pyx_t_29 += __pyx_pybuffernd_suppressed.diminfo[0].shape;
3314 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
3315 } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_suppressed.diminfo[0].shape)) __pyx_t_28 = 0;
3316 if (unlikely(__pyx_t_28 != -1)) {
3317 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3318 __PYX_ERR(0, 108, __pyx_L1_error)
3320 __pyx_t_19 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_suppressed.diminfo[0].strides)) == 1) != 0);
3325 * if suppressed[j] == 1:
3326 * continue # <<<<<<<<<<<<<<
3327 * xx1 = max(ix1, x1[j])
3328 * yy1 = max(iy1, y1[j])
3330 goto __pyx_L6_continue;
3333 * for _j in range(_i + 1, ndets):
3335 * if suppressed[j] == 1: # <<<<<<<<<<<<<<
3337 * xx1 = max(ix1, x1[j])
3342 * if suppressed[j] == 1:
3344 * xx1 = max(ix1, x1[j]) # <<<<<<<<<<<<<<
3345 * yy1 = max(iy1, y1[j])
3346 * xx2 = min(ix2, x2[j])
3348 __pyx_t_30 = __pyx_v_j;
3350 if (__pyx_t_30 < 0) {
3351 __pyx_t_30 += __pyx_pybuffernd_x1.diminfo[0].shape;
3352 if (unlikely(__pyx_t_30 < 0)) __pyx_t_28 = 0;
3353 } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x1.diminfo[0].shape)) __pyx_t_28 = 0;
3354 if (unlikely(__pyx_t_28 != -1)) {
3355 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3356 __PYX_ERR(0, 110, __pyx_L1_error)
3358 __pyx_v_xx1 = __pyx_f_10cython_nms_max(__pyx_v_ix1, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x1.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_x1.diminfo[0].strides)));
3362 * xx1 = max(ix1, x1[j])
3363 * yy1 = max(iy1, y1[j]) # <<<<<<<<<<<<<<
3364 * xx2 = min(ix2, x2[j])
3365 * yy2 = min(iy2, y2[j])
3367 __pyx_t_31 = __pyx_v_j;
3369 if (__pyx_t_31 < 0) {
3370 __pyx_t_31 += __pyx_pybuffernd_y1.diminfo[0].shape;
3371 if (unlikely(__pyx_t_31 < 0)) __pyx_t_28 = 0;
3372 } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_y1.diminfo[0].shape)) __pyx_t_28 = 0;
3373 if (unlikely(__pyx_t_28 != -1)) {
3374 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3375 __PYX_ERR(0, 111, __pyx_L1_error)
3377 __pyx_v_yy1 = __pyx_f_10cython_nms_max(__pyx_v_iy1, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y1.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_y1.diminfo[0].strides)));
3380 * xx1 = max(ix1, x1[j])
3381 * yy1 = max(iy1, y1[j])
3382 * xx2 = min(ix2, x2[j]) # <<<<<<<<<<<<<<
3383 * yy2 = min(iy2, y2[j])
3384 * w = max(0.0, xx2 - xx1 + 1)
3386 __pyx_t_32 = __pyx_v_j;
3388 if (__pyx_t_32 < 0) {
3389 __pyx_t_32 += __pyx_pybuffernd_x2.diminfo[0].shape;
3390 if (unlikely(__pyx_t_32 < 0)) __pyx_t_28 = 0;
3391 } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x2.diminfo[0].shape)) __pyx_t_28 = 0;
3392 if (unlikely(__pyx_t_28 != -1)) {
3393 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3394 __PYX_ERR(0, 112, __pyx_L1_error)
3396 __pyx_v_xx2 = __pyx_f_10cython_nms_min(__pyx_v_ix2, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_x2.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_x2.diminfo[0].strides)));
3399 * yy1 = max(iy1, y1[j])
3400 * xx2 = min(ix2, x2[j])
3401 * yy2 = min(iy2, y2[j]) # <<<<<<<<<<<<<<
3402 * w = max(0.0, xx2 - xx1 + 1)
3403 * h = max(0.0, yy2 - yy1 + 1)
3405 __pyx_t_33 = __pyx_v_j;
3407 if (__pyx_t_33 < 0) {
3408 __pyx_t_33 += __pyx_pybuffernd_y2.diminfo[0].shape;
3409 if (unlikely(__pyx_t_33 < 0)) __pyx_t_28 = 0;
3410 } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_y2.diminfo[0].shape)) __pyx_t_28 = 0;
3411 if (unlikely(__pyx_t_28 != -1)) {
3412 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3413 __PYX_ERR(0, 113, __pyx_L1_error)
3415 __pyx_v_yy2 = __pyx_f_10cython_nms_min(__pyx_v_iy2, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_y2.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_y2.diminfo[0].strides)));
3418 * xx2 = min(ix2, x2[j])
3419 * yy2 = min(iy2, y2[j])
3420 * w = max(0.0, xx2 - xx1 + 1) # <<<<<<<<<<<<<<
3421 * h = max(0.0, yy2 - yy1 + 1)
3424 __pyx_v_w = __pyx_f_10cython_nms_max(0.0, ((__pyx_v_xx2 - __pyx_v_xx1) + 1.0));
3427 * yy2 = min(iy2, y2[j])
3428 * w = max(0.0, xx2 - xx1 + 1)
3429 * h = max(0.0, yy2 - yy1 + 1) # <<<<<<<<<<<<<<
3431 * ovr = inter / (iarea + areas[j] - inter)
3433 __pyx_v_h = __pyx_f_10cython_nms_max(0.0, ((__pyx_v_yy2 - __pyx_v_yy1) + 1.0));
3436 * w = max(0.0, xx2 - xx1 + 1)
3437 * h = max(0.0, yy2 - yy1 + 1)
3438 * inter = w * h # <<<<<<<<<<<<<<
3439 * ovr = inter / (iarea + areas[j] - inter)
3440 * ovr1 = inter / iarea
3442 __pyx_v_inter = (__pyx_v_w * __pyx_v_h);
3445 * h = max(0.0, yy2 - yy1 + 1)
3447 * ovr = inter / (iarea + areas[j] - inter) # <<<<<<<<<<<<<<
3448 * ovr1 = inter / iarea
3449 * ovr2 = inter / areas[j]
3451 __pyx_t_34 = __pyx_v_j;
3453 if (__pyx_t_34 < 0) {
3454 __pyx_t_34 += __pyx_pybuffernd_areas.diminfo[0].shape;
3455 if (unlikely(__pyx_t_34 < 0)) __pyx_t_28 = 0;
3456 } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_areas.diminfo[0].shape)) __pyx_t_28 = 0;
3457 if (unlikely(__pyx_t_28 != -1)) {
3458 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3459 __PYX_ERR(0, 117, __pyx_L1_error)
3461 __pyx_t_35 = ((__pyx_v_iarea + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_areas.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_areas.diminfo[0].strides))) - __pyx_v_inter);
3462 if (unlikely(__pyx_t_35 == 0)) {
3463 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
3464 __PYX_ERR(0, 117, __pyx_L1_error)
3466 __pyx_v_ovr = (__pyx_v_inter / __pyx_t_35);
3470 * ovr = inter / (iarea + areas[j] - inter)
3471 * ovr1 = inter / iarea # <<<<<<<<<<<<<<
3472 * ovr2 = inter / areas[j]
3473 * if ovr >= thresh or ovr1 > 0.95 or ovr2 > 0.95:
3475 if (unlikely(__pyx_v_iarea == 0)) {
3476 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
3477 __PYX_ERR(0, 118, __pyx_L1_error)
3479 __pyx_t_12 = PyFloat_FromDouble((__pyx_v_inter / __pyx_v_iarea)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error)
3480 __Pyx_GOTREF(__pyx_t_12);
3481 __Pyx_XDECREF_SET(__pyx_v_ovr1, __pyx_t_12);
3485 * ovr = inter / (iarea + areas[j] - inter)
3486 * ovr1 = inter / iarea
3487 * ovr2 = inter / areas[j] # <<<<<<<<<<<<<<
3488 * if ovr >= thresh or ovr1 > 0.95 or ovr2 > 0.95:
3491 __pyx_t_36 = __pyx_v_j;
3493 if (__pyx_t_36 < 0) {
3494 __pyx_t_36 += __pyx_pybuffernd_areas.diminfo[0].shape;
3495 if (unlikely(__pyx_t_36 < 0)) __pyx_t_28 = 0;
3496 } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_areas.diminfo[0].shape)) __pyx_t_28 = 0;
3497 if (unlikely(__pyx_t_28 != -1)) {
3498 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3499 __PYX_ERR(0, 119, __pyx_L1_error)
3501 __pyx_t_35 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_areas.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_areas.diminfo[0].strides));
3502 if (unlikely(__pyx_t_35 == 0)) {
3503 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
3504 __PYX_ERR(0, 119, __pyx_L1_error)
3506 __pyx_t_12 = PyFloat_FromDouble((__pyx_v_inter / __pyx_t_35)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 119, __pyx_L1_error)
3507 __Pyx_GOTREF(__pyx_t_12);
3508 __Pyx_XDECREF_SET(__pyx_v_ovr2, __pyx_t_12);
3512 * ovr1 = inter / iarea
3513 * ovr2 = inter / areas[j]
3514 * if ovr >= thresh or ovr1 > 0.95 or ovr2 > 0.95: # <<<<<<<<<<<<<<
3518 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_ovr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 120, __pyx_L1_error)
3519 __Pyx_GOTREF(__pyx_t_12);
3520 __pyx_t_8 = PyObject_RichCompare(__pyx_t_12, __pyx_v_thresh, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error)
3521 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3522 __pyx_t_37 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 120, __pyx_L1_error)
3523 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3526 __pyx_t_19 = __pyx_t_37;
3527 goto __pyx_L10_bool_binop_done;
3529 __pyx_t_8 = PyObject_RichCompare(__pyx_v_ovr1, __pyx_float_0_95, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error)
3530 __pyx_t_37 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 120, __pyx_L1_error)
3531 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3534 __pyx_t_19 = __pyx_t_37;
3535 goto __pyx_L10_bool_binop_done;
3537 __pyx_t_8 = PyObject_RichCompare(__pyx_v_ovr2, __pyx_float_0_95, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error)
3538 __pyx_t_37 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 120, __pyx_L1_error)
3539 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3540 __pyx_t_19 = __pyx_t_37;
3541 __pyx_L10_bool_binop_done:;
3545 * ovr2 = inter / areas[j]
3546 * if ovr >= thresh or ovr1 > 0.95 or ovr2 > 0.95:
3547 * suppressed[j] = 1 # <<<<<<<<<<<<<<
3551 __pyx_t_38 = __pyx_v_j;
3553 if (__pyx_t_38 < 0) {
3554 __pyx_t_38 += __pyx_pybuffernd_suppressed.diminfo[0].shape;
3555 if (unlikely(__pyx_t_38 < 0)) __pyx_t_28 = 0;
3556 } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_suppressed.diminfo[0].shape)) __pyx_t_28 = 0;
3557 if (unlikely(__pyx_t_28 != -1)) {
3558 __Pyx_RaiseBufferIndexError(__pyx_t_28);
3559 __PYX_ERR(0, 121, __pyx_L1_error)
3561 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_suppressed.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_suppressed.diminfo[0].strides) = 1;
3564 * ovr1 = inter / iarea
3565 * ovr2 = inter / areas[j]
3566 * if ovr >= thresh or ovr1 > 0.95 or ovr2 > 0.95: # <<<<<<<<<<<<<<
3579 * return keep # <<<<<<<<<<<<<<
3581 __Pyx_XDECREF(__pyx_r);
3582 __Pyx_INCREF(__pyx_v_keep);
3583 __pyx_r = __pyx_v_keep;
3589 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
3590 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
3591 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
3594 /* function exit code */
3596 __Pyx_XDECREF(__pyx_t_1);
3597 __Pyx_XDECREF(__pyx_t_7);
3598 __Pyx_XDECREF(__pyx_t_8);
3599 __Pyx_XDECREF(__pyx_t_11);
3600 __Pyx_XDECREF(__pyx_t_12);
3601 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3602 __Pyx_PyThreadState_declare
3603 __Pyx_PyThreadState_assign
3604 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3605 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_areas.rcbuffer->pybuffer);
3606 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dets.rcbuffer->pybuffer);
3607 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
3608 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
3609 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_suppressed.rcbuffer->pybuffer);
3610 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x1.rcbuffer->pybuffer);
3611 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x2.rcbuffer->pybuffer);
3612 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y1.rcbuffer->pybuffer);
3613 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y2.rcbuffer->pybuffer);
3614 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3615 __Pyx_AddTraceback("cython_nms.nms_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
3619 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_areas.rcbuffer->pybuffer);
3620 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dets.rcbuffer->pybuffer);
3621 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_order.rcbuffer->pybuffer);
3622 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
3623 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_suppressed.rcbuffer->pybuffer);
3624 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x1.rcbuffer->pybuffer);
3625 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x2.rcbuffer->pybuffer);
3626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y1.rcbuffer->pybuffer);
3627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y2.rcbuffer->pybuffer);
3629 __Pyx_XDECREF((PyObject *)__pyx_v_x1);
3630 __Pyx_XDECREF((PyObject *)__pyx_v_y1);
3631 __Pyx_XDECREF((PyObject *)__pyx_v_x2);
3632 __Pyx_XDECREF((PyObject *)__pyx_v_y2);
3633 __Pyx_XDECREF((PyObject *)__pyx_v_scores);
3634 __Pyx_XDECREF((PyObject *)__pyx_v_areas);
3635 __Pyx_XDECREF((PyObject *)__pyx_v_order);
3636 __Pyx_XDECREF((PyObject *)__pyx_v_suppressed);
3637 __Pyx_XDECREF(__pyx_v_keep);
3638 __Pyx_XDECREF(__pyx_v_ovr1);
3639 __Pyx_XDECREF(__pyx_v_ovr2);
3640 __Pyx_XGIVEREF(__pyx_r);
3641 __Pyx_RefNannyFinishContext();
3645 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
3646 * # experimental exception made for __getbuffer__ and __releasebuffer__
3647 * # -- the details of this may change.
3648 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
3649 * # This implementation of getbuffer is geared towards Cython
3650 * # requirements, and does not yet fullfill the PEP.
3653 /* Python wrapper */
3654 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3655 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3657 __Pyx_RefNannyDeclarations
3658 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
3659 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
3661 /* function exit code */
3662 __Pyx_RefNannyFinishContext();
3666 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3667 int __pyx_v_copy_shape;
3670 int __pyx_v_endian_detector;
3671 int __pyx_v_little_endian;
3674 PyArray_Descr *__pyx_v_descr = 0;
3676 int __pyx_v_hasfields;
3678 __Pyx_RefNannyDeclarations
3681 PyObject *__pyx_t_3 = NULL;
3684 PyObject *__pyx_t_6 = NULL;
3686 __Pyx_RefNannySetupContext("__getbuffer__", 0);
3687 if (__pyx_v_info != NULL) {
3688 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
3689 __Pyx_GIVEREF(__pyx_v_info->obj);
3692 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
3695 * if info == NULL: return # <<<<<<<<<<<<<<
3697 * cdef int copy_shape, i, ndim
3699 __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
3705 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
3707 * cdef int copy_shape, i, ndim
3708 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
3709 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3712 __pyx_v_endian_detector = 1;
3714 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207
3715 * cdef int copy_shape, i, ndim
3716 * cdef int endian_detector = 1
3717 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
3719 * ndim = PyArray_NDIM(self)
3721 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
3723 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
3724 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3726 * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
3728 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
3730 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
3732 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
3733 * ndim = PyArray_NDIM(self)
3735 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
3739 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
3742 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212
3744 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
3745 * copy_shape = 1 # <<<<<<<<<<<<<<
3749 __pyx_v_copy_shape = 1;
3751 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
3752 * ndim = PyArray_NDIM(self)
3754 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
3761 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
3764 * copy_shape = 0 # <<<<<<<<<<<<<<
3766 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3769 __pyx_v_copy_shape = 0;
3773 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
3776 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
3777 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3778 * raise ValueError(u"ndarray is not C contiguous")
3780 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
3783 __pyx_t_1 = __pyx_t_2;
3784 goto __pyx_L6_bool_binop_done;
3787 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
3789 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3790 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
3791 * raise ValueError(u"ndarray is not C contiguous")
3794 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
3795 __pyx_t_1 = __pyx_t_2;
3796 __pyx_L6_bool_binop_done:;
3798 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
3801 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
3802 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3803 * raise ValueError(u"ndarray is not C contiguous")
3807 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
3808 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3809 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3810 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
3812 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3814 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error)
3815 __Pyx_GOTREF(__pyx_t_3);
3816 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3817 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3818 __PYX_ERR(1, 218, __pyx_L1_error)
3820 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
3823 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
3824 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3825 * raise ValueError(u"ndarray is not C contiguous")
3829 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
3830 * raise ValueError(u"ndarray is not C contiguous")
3832 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
3833 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3834 * raise ValueError(u"ndarray is not Fortran contiguous")
3836 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
3839 __pyx_t_1 = __pyx_t_2;
3840 goto __pyx_L9_bool_binop_done;
3843 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
3845 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3846 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
3847 * raise ValueError(u"ndarray is not Fortran contiguous")
3850 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
3851 __pyx_t_1 = __pyx_t_2;
3852 __pyx_L9_bool_binop_done:;
3854 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
3855 * raise ValueError(u"ndarray is not C contiguous")
3857 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
3858 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3859 * raise ValueError(u"ndarray is not Fortran contiguous")
3863 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
3864 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3865 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3866 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
3868 * info.buf = PyArray_DATA(self)
3870 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error)
3871 __Pyx_GOTREF(__pyx_t_3);
3872 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3874 __PYX_ERR(1, 222, __pyx_L1_error)
3876 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
3877 * raise ValueError(u"ndarray is not C contiguous")
3879 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
3880 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3881 * raise ValueError(u"ndarray is not Fortran contiguous")
3885 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224
3886 * raise ValueError(u"ndarray is not Fortran contiguous")
3888 * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
3892 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
3894 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
3896 * info.buf = PyArray_DATA(self)
3897 * info.ndim = ndim # <<<<<<<<<<<<<<
3899 * # Allocate new buffer for strides and shape info.
3901 __pyx_v_info->ndim = __pyx_v_ndim;
3903 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
3904 * info.buf = PyArray_DATA(self)
3906 * if copy_shape: # <<<<<<<<<<<<<<
3907 * # Allocate new buffer for strides and shape info.
3908 * # This is allocated as one block, strides first.
3910 __pyx_t_1 = (__pyx_v_copy_shape != 0);
3913 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
3914 * # Allocate new buffer for strides and shape info.
3915 * # This is allocated as one block, strides first.
3916 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
3917 * info.shape = info.strides + ndim
3918 * for i in range(ndim):
3920 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
3922 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
3923 * # This is allocated as one block, strides first.
3924 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
3925 * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
3926 * for i in range(ndim):
3927 * info.strides[i] = PyArray_STRIDES(self)[i]
3929 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
3931 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
3932 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
3933 * info.shape = info.strides + ndim
3934 * for i in range(ndim): # <<<<<<<<<<<<<<
3935 * info.strides[i] = PyArray_STRIDES(self)[i]
3936 * info.shape[i] = PyArray_DIMS(self)[i]
3938 __pyx_t_4 = __pyx_v_ndim;
3939 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
3940 __pyx_v_i = __pyx_t_5;
3942 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
3943 * info.shape = info.strides + ndim
3944 * for i in range(ndim):
3945 * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
3946 * info.shape[i] = PyArray_DIMS(self)[i]
3949 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
3951 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
3952 * for i in range(ndim):
3953 * info.strides[i] = PyArray_STRIDES(self)[i]
3954 * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
3956 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3958 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
3961 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
3962 * info.buf = PyArray_DATA(self)
3964 * if copy_shape: # <<<<<<<<<<<<<<
3965 * # Allocate new buffer for strides and shape info.
3966 * # This is allocated as one block, strides first.
3971 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
3972 * info.shape[i] = PyArray_DIMS(self)[i]
3974 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
3975 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3976 * info.suboffsets = NULL
3979 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
3981 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
3983 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3984 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
3985 * info.suboffsets = NULL
3986 * info.itemsize = PyArray_ITEMSIZE(self)
3988 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
3992 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
3993 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3994 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3995 * info.suboffsets = NULL # <<<<<<<<<<<<<<
3996 * info.itemsize = PyArray_ITEMSIZE(self)
3997 * info.readonly = not PyArray_ISWRITEABLE(self)
3999 __pyx_v_info->suboffsets = NULL;
4001 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238
4002 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4003 * info.suboffsets = NULL
4004 * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
4005 * info.readonly = not PyArray_ISWRITEABLE(self)
4008 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
4010 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
4011 * info.suboffsets = NULL
4012 * info.itemsize = PyArray_ITEMSIZE(self)
4013 * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
4017 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
4019 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
4022 * cdef char* f = NULL # <<<<<<<<<<<<<<
4023 * cdef dtype descr = self.descr
4028 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
4030 * cdef char* f = NULL
4031 * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
4035 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
4036 __Pyx_INCREF(__pyx_t_3);
4037 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
4040 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
4043 * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
4045 * if not hasfields and not copy_shape:
4047 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
4049 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
4050 * cdef bint hasfields = PyDataType_HASFIELDS(descr)
4052 * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
4053 * # do not call releasebuffer
4056 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
4059 __pyx_t_1 = __pyx_t_2;
4060 goto __pyx_L15_bool_binop_done;
4062 __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
4063 __pyx_t_1 = __pyx_t_2;
4064 __pyx_L15_bool_binop_done:;
4067 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
4068 * if not hasfields and not copy_shape:
4069 * # do not call releasebuffer
4070 * info.obj = None # <<<<<<<<<<<<<<
4072 * # need to call releasebuffer
4074 __Pyx_INCREF(Py_None);
4075 __Pyx_GIVEREF(Py_None);
4076 __Pyx_GOTREF(__pyx_v_info->obj);
4077 __Pyx_DECREF(__pyx_v_info->obj);
4078 __pyx_v_info->obj = Py_None;
4080 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
4081 * cdef bint hasfields = PyDataType_HASFIELDS(descr)
4083 * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
4084 * # do not call releasebuffer
4090 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
4092 * # need to call releasebuffer
4093 * info.obj = self # <<<<<<<<<<<<<<
4098 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4099 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4100 __Pyx_GOTREF(__pyx_v_info->obj);
4101 __Pyx_DECREF(__pyx_v_info->obj);
4102 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
4106 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
4109 * if not hasfields: # <<<<<<<<<<<<<<
4110 * t = descr.type_num
4111 * if ((descr.byteorder == c'>' and little_endian) or
4113 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
4116 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
4119 * t = descr.type_num # <<<<<<<<<<<<<<
4120 * if ((descr.byteorder == c'>' and little_endian) or
4121 * (descr.byteorder == c'<' and not little_endian)):
4123 __pyx_t_4 = __pyx_v_descr->type_num;
4124 __pyx_v_t = __pyx_t_4;
4126 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
4128 * t = descr.type_num
4129 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4130 * (descr.byteorder == c'<' and not little_endian)):
4131 * raise ValueError(u"Non-native byte order not supported")
4133 __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
4135 goto __pyx_L20_next_or;
4138 __pyx_t_2 = (__pyx_v_little_endian != 0);
4141 __pyx_t_1 = __pyx_t_2;
4142 goto __pyx_L19_bool_binop_done;
4146 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
4147 * t = descr.type_num
4148 * if ((descr.byteorder == c'>' and little_endian) or
4149 * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
4150 * raise ValueError(u"Non-native byte order not supported")
4151 * if t == NPY_BYTE: f = "b"
4153 __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
4156 __pyx_t_1 = __pyx_t_2;
4157 goto __pyx_L19_bool_binop_done;
4159 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
4160 __pyx_t_1 = __pyx_t_2;
4161 __pyx_L19_bool_binop_done:;
4163 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
4165 * t = descr.type_num
4166 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4167 * (descr.byteorder == c'<' and not little_endian)):
4168 * raise ValueError(u"Non-native byte order not supported")
4172 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
4173 * if ((descr.byteorder == c'>' and little_endian) or
4174 * (descr.byteorder == c'<' and not little_endian)):
4175 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
4176 * if t == NPY_BYTE: f = "b"
4177 * elif t == NPY_UBYTE: f = "B"
4179 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error)
4180 __Pyx_GOTREF(__pyx_t_3);
4181 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4182 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4183 __PYX_ERR(1, 259, __pyx_L1_error)
4185 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
4187 * t = descr.type_num
4188 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4189 * (descr.byteorder == c'<' and not little_endian)):
4190 * raise ValueError(u"Non-native byte order not supported")
4194 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
4195 * (descr.byteorder == c'<' and not little_endian)):
4196 * raise ValueError(u"Non-native byte order not supported")
4197 * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
4198 * elif t == NPY_UBYTE: f = "B"
4199 * elif t == NPY_SHORT: f = "h"
4201 switch (__pyx_v_t) {
4203 __pyx_v_f = ((char *)"b");
4206 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
4207 * raise ValueError(u"Non-native byte order not supported")
4208 * if t == NPY_BYTE: f = "b"
4209 * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
4210 * elif t == NPY_SHORT: f = "h"
4211 * elif t == NPY_USHORT: f = "H"
4214 __pyx_v_f = ((char *)"B");
4217 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
4218 * if t == NPY_BYTE: f = "b"
4219 * elif t == NPY_UBYTE: f = "B"
4220 * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
4221 * elif t == NPY_USHORT: f = "H"
4222 * elif t == NPY_INT: f = "i"
4225 __pyx_v_f = ((char *)"h");
4228 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
4229 * elif t == NPY_UBYTE: f = "B"
4230 * elif t == NPY_SHORT: f = "h"
4231 * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
4232 * elif t == NPY_INT: f = "i"
4233 * elif t == NPY_UINT: f = "I"
4236 __pyx_v_f = ((char *)"H");
4239 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
4240 * elif t == NPY_SHORT: f = "h"
4241 * elif t == NPY_USHORT: f = "H"
4242 * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
4243 * elif t == NPY_UINT: f = "I"
4244 * elif t == NPY_LONG: f = "l"
4247 __pyx_v_f = ((char *)"i");
4250 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
4251 * elif t == NPY_USHORT: f = "H"
4252 * elif t == NPY_INT: f = "i"
4253 * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
4254 * elif t == NPY_LONG: f = "l"
4255 * elif t == NPY_ULONG: f = "L"
4258 __pyx_v_f = ((char *)"I");
4261 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
4262 * elif t == NPY_INT: f = "i"
4263 * elif t == NPY_UINT: f = "I"
4264 * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
4265 * elif t == NPY_ULONG: f = "L"
4266 * elif t == NPY_LONGLONG: f = "q"
4269 __pyx_v_f = ((char *)"l");
4272 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
4273 * elif t == NPY_UINT: f = "I"
4274 * elif t == NPY_LONG: f = "l"
4275 * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
4276 * elif t == NPY_LONGLONG: f = "q"
4277 * elif t == NPY_ULONGLONG: f = "Q"
4280 __pyx_v_f = ((char *)"L");
4283 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
4284 * elif t == NPY_LONG: f = "l"
4285 * elif t == NPY_ULONG: f = "L"
4286 * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
4287 * elif t == NPY_ULONGLONG: f = "Q"
4288 * elif t == NPY_FLOAT: f = "f"
4291 __pyx_v_f = ((char *)"q");
4294 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
4295 * elif t == NPY_ULONG: f = "L"
4296 * elif t == NPY_LONGLONG: f = "q"
4297 * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
4298 * elif t == NPY_FLOAT: f = "f"
4299 * elif t == NPY_DOUBLE: f = "d"
4302 __pyx_v_f = ((char *)"Q");
4305 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
4306 * elif t == NPY_LONGLONG: f = "q"
4307 * elif t == NPY_ULONGLONG: f = "Q"
4308 * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
4309 * elif t == NPY_DOUBLE: f = "d"
4310 * elif t == NPY_LONGDOUBLE: f = "g"
4313 __pyx_v_f = ((char *)"f");
4316 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
4317 * elif t == NPY_ULONGLONG: f = "Q"
4318 * elif t == NPY_FLOAT: f = "f"
4319 * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
4320 * elif t == NPY_LONGDOUBLE: f = "g"
4321 * elif t == NPY_CFLOAT: f = "Zf"
4324 __pyx_v_f = ((char *)"d");
4327 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
4328 * elif t == NPY_FLOAT: f = "f"
4329 * elif t == NPY_DOUBLE: f = "d"
4330 * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
4331 * elif t == NPY_CFLOAT: f = "Zf"
4332 * elif t == NPY_CDOUBLE: f = "Zd"
4334 case NPY_LONGDOUBLE:
4335 __pyx_v_f = ((char *)"g");
4338 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
4339 * elif t == NPY_DOUBLE: f = "d"
4340 * elif t == NPY_LONGDOUBLE: f = "g"
4341 * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
4342 * elif t == NPY_CDOUBLE: f = "Zd"
4343 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4346 __pyx_v_f = ((char *)"Zf");
4349 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
4350 * elif t == NPY_LONGDOUBLE: f = "g"
4351 * elif t == NPY_CFLOAT: f = "Zf"
4352 * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
4353 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4354 * elif t == NPY_OBJECT: f = "O"
4357 __pyx_v_f = ((char *)"Zd");
4360 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
4361 * elif t == NPY_CFLOAT: f = "Zf"
4362 * elif t == NPY_CDOUBLE: f = "Zd"
4363 * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
4364 * elif t == NPY_OBJECT: f = "O"
4367 case NPY_CLONGDOUBLE:
4368 __pyx_v_f = ((char *)"Zg");
4371 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
4372 * elif t == NPY_CDOUBLE: f = "Zd"
4373 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4374 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
4376 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4379 __pyx_v_f = ((char *)"O");
4383 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
4384 * elif t == NPY_OBJECT: f = "O"
4386 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
4390 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
4391 __Pyx_GOTREF(__pyx_t_3);
4392 __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
4393 __Pyx_GOTREF(__pyx_t_6);
4394 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4395 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
4396 __Pyx_GOTREF(__pyx_t_3);
4397 __Pyx_GIVEREF(__pyx_t_6);
4398 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
4400 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
4401 __Pyx_GOTREF(__pyx_t_6);
4402 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4403 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
4404 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4405 __PYX_ERR(1, 278, __pyx_L1_error)
4409 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
4411 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4412 * info.format = f # <<<<<<<<<<<<<<
4416 __pyx_v_info->format = __pyx_v_f;
4418 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
4419 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4421 * return # <<<<<<<<<<<<<<
4423 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
4428 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
4431 * if not hasfields: # <<<<<<<<<<<<<<
4432 * t = descr.type_num
4433 * if ((descr.byteorder == c'>' and little_endian) or
4437 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
4440 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
4441 * info.format[0] = c'^' # Native data types, manual alignment
4445 __pyx_v_info->format = ((char *)malloc(0xFF));
4447 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
4449 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
4450 * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
4452 * f = _util_dtypestring(descr, info.format + 1,
4454 (__pyx_v_info->format[0]) = '^';
4456 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
4457 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
4458 * info.format[0] = c'^' # Native data types, manual alignment
4459 * offset = 0 # <<<<<<<<<<<<<<
4460 * f = _util_dtypestring(descr, info.format + 1,
4461 * info.format + _buffer_format_string_len,
4465 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
4466 * info.format[0] = c'^' # Native data types, manual alignment
4468 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
4469 * info.format + _buffer_format_string_len,
4472 __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
4473 __pyx_v_f = __pyx_t_7;
4475 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
4476 * info.format + _buffer_format_string_len,
4478 * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
4480 * def __releasebuffer__(ndarray self, Py_buffer* info):
4482 (__pyx_v_f[0]) = '\x00';
4485 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
4486 * # experimental exception made for __getbuffer__ and __releasebuffer__
4487 * # -- the details of this may change.
4488 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
4489 * # This implementation of getbuffer is geared towards Cython
4490 * # requirements, and does not yet fullfill the PEP.
4493 /* function exit code */
4497 __Pyx_XDECREF(__pyx_t_3);
4498 __Pyx_XDECREF(__pyx_t_6);
4499 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4501 if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
4502 __Pyx_GOTREF(__pyx_v_info->obj);
4503 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
4507 if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
4508 __Pyx_GOTREF(Py_None);
4509 __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
4512 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
4513 __Pyx_RefNannyFinishContext();
4517 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
4518 * f[0] = c'\0' # Terminate format string
4520 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
4521 * if PyArray_HASFIELDS(self):
4522 * stdlib.free(info.format)
4525 /* Python wrapper */
4526 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
4527 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4528 __Pyx_RefNannyDeclarations
4529 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
4530 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
4532 /* function exit code */
4533 __Pyx_RefNannyFinishContext();
4536 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4537 __Pyx_RefNannyDeclarations
4539 __Pyx_RefNannySetupContext("__releasebuffer__", 0);
4541 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
4543 * def __releasebuffer__(ndarray self, Py_buffer* info):
4544 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
4545 * stdlib.free(info.format)
4546 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4548 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
4551 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
4552 * def __releasebuffer__(ndarray self, Py_buffer* info):
4553 * if PyArray_HASFIELDS(self):
4554 * stdlib.free(info.format) # <<<<<<<<<<<<<<
4555 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4556 * stdlib.free(info.strides)
4558 free(__pyx_v_info->format);
4560 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
4562 * def __releasebuffer__(ndarray self, Py_buffer* info):
4563 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
4564 * stdlib.free(info.format)
4565 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4569 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
4570 * if PyArray_HASFIELDS(self):
4571 * stdlib.free(info.format)
4572 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4573 * stdlib.free(info.strides)
4574 * # info.shape was stored after info.strides in the same block
4576 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4579 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
4580 * stdlib.free(info.format)
4581 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4582 * stdlib.free(info.strides) # <<<<<<<<<<<<<<
4583 * # info.shape was stored after info.strides in the same block
4586 free(__pyx_v_info->strides);
4588 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
4589 * if PyArray_HASFIELDS(self):
4590 * stdlib.free(info.format)
4591 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4592 * stdlib.free(info.strides)
4593 * # info.shape was stored after info.strides in the same block
4597 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
4598 * f[0] = c'\0' # Terminate format string
4600 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
4601 * if PyArray_HASFIELDS(self):
4602 * stdlib.free(info.format)
4605 /* function exit code */
4606 __Pyx_RefNannyFinishContext();
4609 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
4610 * ctypedef npy_cdouble complex_t
4612 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4613 * return PyArray_MultiIterNew(1, <void*>a)
4617 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4618 PyObject *__pyx_r = NULL;
4619 __Pyx_RefNannyDeclarations
4620 PyObject *__pyx_t_1 = NULL;
4621 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
4623 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
4625 * cdef inline object PyArray_MultiIterNew1(a):
4626 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
4628 * cdef inline object PyArray_MultiIterNew2(a, b):
4630 __Pyx_XDECREF(__pyx_r);
4631 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error)
4632 __Pyx_GOTREF(__pyx_t_1);
4633 __pyx_r = __pyx_t_1;
4637 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
4638 * ctypedef npy_cdouble complex_t
4640 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4641 * return PyArray_MultiIterNew(1, <void*>a)
4645 /* function exit code */
4647 __Pyx_XDECREF(__pyx_t_1);
4648 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4651 __Pyx_XGIVEREF(__pyx_r);
4652 __Pyx_RefNannyFinishContext();
4656 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
4657 * return PyArray_MultiIterNew(1, <void*>a)
4659 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4660 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4664 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4665 PyObject *__pyx_r = NULL;
4666 __Pyx_RefNannyDeclarations
4667 PyObject *__pyx_t_1 = NULL;
4668 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
4670 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
4672 * cdef inline object PyArray_MultiIterNew2(a, b):
4673 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
4675 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4677 __Pyx_XDECREF(__pyx_r);
4678 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error)
4679 __Pyx_GOTREF(__pyx_t_1);
4680 __pyx_r = __pyx_t_1;
4684 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
4685 * return PyArray_MultiIterNew(1, <void*>a)
4687 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4688 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4692 /* function exit code */
4694 __Pyx_XDECREF(__pyx_t_1);
4695 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4698 __Pyx_XGIVEREF(__pyx_r);
4699 __Pyx_RefNannyFinishContext();
4703 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
4704 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4706 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4707 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4711 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4712 PyObject *__pyx_r = NULL;
4713 __Pyx_RefNannyDeclarations
4714 PyObject *__pyx_t_1 = NULL;
4715 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4717 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
4719 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4720 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4722 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4724 __Pyx_XDECREF(__pyx_r);
4725 __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
4726 __Pyx_GOTREF(__pyx_t_1);
4727 __pyx_r = __pyx_t_1;
4731 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
4732 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4734 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4735 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4739 /* function exit code */
4741 __Pyx_XDECREF(__pyx_t_1);
4742 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4745 __Pyx_XGIVEREF(__pyx_r);
4746 __Pyx_RefNannyFinishContext();
4750 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
4751 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4753 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4754 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4758 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4759 PyObject *__pyx_r = NULL;
4760 __Pyx_RefNannyDeclarations
4761 PyObject *__pyx_t_1 = NULL;
4762 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
4764 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
4766 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4767 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
4769 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4771 __Pyx_XDECREF(__pyx_r);
4772 __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_ERR(1, 780, __pyx_L1_error)
4773 __Pyx_GOTREF(__pyx_t_1);
4774 __pyx_r = __pyx_t_1;
4778 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
4779 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4781 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4782 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4786 /* function exit code */
4788 __Pyx_XDECREF(__pyx_t_1);
4789 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4792 __Pyx_XGIVEREF(__pyx_r);
4793 __Pyx_RefNannyFinishContext();
4797 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
4798 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4800 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4801 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4805 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
4806 PyObject *__pyx_r = NULL;
4807 __Pyx_RefNannyDeclarations
4808 PyObject *__pyx_t_1 = NULL;
4809 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
4811 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
4813 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4814 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
4816 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
4818 __Pyx_XDECREF(__pyx_r);
4819 __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_ERR(1, 783, __pyx_L1_error)
4820 __Pyx_GOTREF(__pyx_t_1);
4821 __pyx_r = __pyx_t_1;
4825 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
4826 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4828 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4829 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4833 /* function exit code */
4835 __Pyx_XDECREF(__pyx_t_1);
4836 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4839 __Pyx_XGIVEREF(__pyx_r);
4840 __Pyx_RefNannyFinishContext();
4844 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
4845 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4847 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
4848 * # Recursive utility function used in __getbuffer__ to get format
4849 * # string. The new location in the format string is returned.
4852 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
4853 PyArray_Descr *__pyx_v_child = 0;
4854 int __pyx_v_endian_detector;
4855 int __pyx_v_little_endian;
4856 PyObject *__pyx_v_fields = 0;
4857 PyObject *__pyx_v_childname = NULL;
4858 PyObject *__pyx_v_new_offset = NULL;
4859 PyObject *__pyx_v_t = NULL;
4861 __Pyx_RefNannyDeclarations
4862 PyObject *__pyx_t_1 = NULL;
4863 Py_ssize_t __pyx_t_2;
4864 PyObject *__pyx_t_3 = NULL;
4865 PyObject *__pyx_t_4 = NULL;
4871 __Pyx_RefNannySetupContext("_util_dtypestring", 0);
4873 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
4876 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
4877 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4880 __pyx_v_endian_detector = 1;
4882 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
4884 * cdef int endian_detector = 1
4885 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
4889 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
4891 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
4894 * for childname in descr.names: # <<<<<<<<<<<<<<
4895 * fields = descr.fields[childname]
4896 * child, new_offset = fields
4898 if (unlikely(__pyx_v_descr->names == Py_None)) {
4899 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4900 __PYX_ERR(1, 794, __pyx_L1_error)
4902 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
4904 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
4905 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4906 __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_ERR(1, 794, __pyx_L1_error)
4908 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
4909 __Pyx_GOTREF(__pyx_t_3);
4911 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
4914 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
4916 * for childname in descr.names:
4917 * fields = descr.fields[childname] # <<<<<<<<<<<<<<
4918 * child, new_offset = fields
4921 if (unlikely(__pyx_v_descr->fields == Py_None)) {
4922 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4923 __PYX_ERR(1, 795, __pyx_L1_error)
4925 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error)
4926 __Pyx_GOTREF(__pyx_t_3);
4927 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_ERR(1, 795, __pyx_L1_error)
4928 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
4931 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
4932 * for childname in descr.names:
4933 * fields = descr.fields[childname]
4934 * child, new_offset = fields # <<<<<<<<<<<<<<
4936 * if (end - f) - <int>(new_offset - offset[0]) < 15:
4938 if (likely(__pyx_v_fields != Py_None)) {
4939 PyObject* sequence = __pyx_v_fields;
4940 #if !CYTHON_COMPILING_IN_PYPY
4941 Py_ssize_t size = Py_SIZE(sequence);
4943 Py_ssize_t size = PySequence_Size(sequence);
4945 if (unlikely(size != 2)) {
4946 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4947 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4948 __PYX_ERR(1, 796, __pyx_L1_error)
4950 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4951 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
4952 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
4953 __Pyx_INCREF(__pyx_t_3);
4954 __Pyx_INCREF(__pyx_t_4);
4956 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __pyx_L1_error)
4957 __Pyx_GOTREF(__pyx_t_3);
4958 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error)
4959 __Pyx_GOTREF(__pyx_t_4);
4962 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error)
4964 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error)
4965 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
4967 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
4970 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
4971 * child, new_offset = fields
4973 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
4974 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4977 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error)
4978 __Pyx_GOTREF(__pyx_t_4);
4979 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error)
4980 __Pyx_GOTREF(__pyx_t_3);
4981 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4982 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error)
4983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4984 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
4987 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
4989 * if (end - f) - <int>(new_offset - offset[0]) < 15:
4990 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
4992 * if ((child.byteorder == c'>' and little_endian) or
4994 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error)
4995 __Pyx_GOTREF(__pyx_t_3);
4996 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4998 __PYX_ERR(1, 799, __pyx_L1_error)
5000 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
5001 * child, new_offset = fields
5003 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
5004 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5009 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
5010 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5012 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5013 * (child.byteorder == c'<' and not little_endian)):
5014 * raise ValueError(u"Non-native byte order not supported")
5016 __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
5018 goto __pyx_L8_next_or;
5021 __pyx_t_7 = (__pyx_v_little_endian != 0);
5024 __pyx_t_6 = __pyx_t_7;
5025 goto __pyx_L7_bool_binop_done;
5029 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
5031 * if ((child.byteorder == c'>' and little_endian) or
5032 * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
5033 * raise ValueError(u"Non-native byte order not supported")
5034 * # One could encode it in the format string and have Cython
5036 __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
5039 __pyx_t_6 = __pyx_t_7;
5040 goto __pyx_L7_bool_binop_done;
5042 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
5043 __pyx_t_6 = __pyx_t_7;
5044 __pyx_L7_bool_binop_done:;
5046 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
5047 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5049 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5050 * (child.byteorder == c'<' and not little_endian)):
5051 * raise ValueError(u"Non-native byte order not supported")
5055 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
5056 * if ((child.byteorder == c'>' and little_endian) or
5057 * (child.byteorder == c'<' and not little_endian)):
5058 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
5059 * # One could encode it in the format string and have Cython
5060 * # complain instead, BUT: < and > in format strings also imply
5062 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
5063 __Pyx_GOTREF(__pyx_t_3);
5064 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5065 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5066 __PYX_ERR(1, 803, __pyx_L1_error)
5068 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
5069 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5071 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5072 * (child.byteorder == c'<' and not little_endian)):
5073 * raise ValueError(u"Non-native byte order not supported")
5077 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
5079 * # Output padding bytes
5080 * while offset[0] < new_offset: # <<<<<<<<<<<<<<
5081 * f[0] = 120 # "x"; pad byte
5085 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error)
5086 __Pyx_GOTREF(__pyx_t_3);
5087 __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_ERR(1, 813, __pyx_L1_error)
5088 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5089 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error)
5090 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5091 if (!__pyx_t_6) break;
5093 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
5094 * # Output padding bytes
5095 * while offset[0] < new_offset:
5096 * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
5100 (__pyx_v_f[0]) = 0x78;
5102 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
5103 * while offset[0] < new_offset:
5104 * f[0] = 120 # "x"; pad byte
5105 * f += 1 # <<<<<<<<<<<<<<
5109 __pyx_v_f = (__pyx_v_f + 1);
5111 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
5112 * f[0] = 120 # "x"; pad byte
5114 * offset[0] += 1 # <<<<<<<<<<<<<<
5116 * offset[0] += child.itemsize
5119 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
5122 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
5125 * offset[0] += child.itemsize # <<<<<<<<<<<<<<
5127 * if not PyDataType_HASFIELDS(child):
5130 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
5132 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
5133 * offset[0] += child.itemsize
5135 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
5136 * t = child.type_num
5139 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
5142 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
5144 * if not PyDataType_HASFIELDS(child):
5145 * t = child.type_num # <<<<<<<<<<<<<<
5147 * raise RuntimeError(u"Format string allocated too short.")
5149 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
5150 __Pyx_GOTREF(__pyx_t_4);
5151 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
5154 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
5155 * if not PyDataType_HASFIELDS(child):
5156 * t = child.type_num
5157 * if end - f < 5: # <<<<<<<<<<<<<<
5158 * raise RuntimeError(u"Format string allocated too short.")
5161 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
5164 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
5165 * t = child.type_num
5167 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
5169 * # Until ticket #99 is fixed, use integers to avoid warnings
5171 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error)
5172 __Pyx_GOTREF(__pyx_t_4);
5173 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5174 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5175 __PYX_ERR(1, 823, __pyx_L1_error)
5177 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
5178 * if not PyDataType_HASFIELDS(child):
5179 * t = child.type_num
5180 * if end - f < 5: # <<<<<<<<<<<<<<
5181 * raise RuntimeError(u"Format string allocated too short.")
5186 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
5188 * # Until ticket #99 is fixed, use integers to avoid warnings
5189 * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
5190 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5191 * elif t == NPY_SHORT: f[0] = 104 #"h"
5193 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error)
5194 __Pyx_GOTREF(__pyx_t_4);
5195 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error)
5196 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5197 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error)
5198 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5200 (__pyx_v_f[0]) = 98;
5204 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
5205 * # Until ticket #99 is fixed, use integers to avoid warnings
5206 * if t == NPY_BYTE: f[0] = 98 #"b"
5207 * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
5208 * elif t == NPY_SHORT: f[0] = 104 #"h"
5209 * elif t == NPY_USHORT: f[0] = 72 #"H"
5211 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error)
5212 __Pyx_GOTREF(__pyx_t_3);
5213 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
5214 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5215 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error)
5216 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5218 (__pyx_v_f[0]) = 66;
5222 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
5223 * if t == NPY_BYTE: f[0] = 98 #"b"
5224 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5225 * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
5226 * elif t == NPY_USHORT: f[0] = 72 #"H"
5227 * elif t == NPY_INT: f[0] = 105 #"i"
5229 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error)
5230 __Pyx_GOTREF(__pyx_t_4);
5231 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error)
5232 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5233 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
5234 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5236 (__pyx_v_f[0]) = 0x68;
5240 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
5241 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5242 * elif t == NPY_SHORT: f[0] = 104 #"h"
5243 * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
5244 * elif t == NPY_INT: f[0] = 105 #"i"
5245 * elif t == NPY_UINT: f[0] = 73 #"I"
5247 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error)
5248 __Pyx_GOTREF(__pyx_t_3);
5249 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
5250 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5251 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error)
5252 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5254 (__pyx_v_f[0]) = 72;
5258 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
5259 * elif t == NPY_SHORT: f[0] = 104 #"h"
5260 * elif t == NPY_USHORT: f[0] = 72 #"H"
5261 * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
5262 * elif t == NPY_UINT: f[0] = 73 #"I"
5263 * elif t == NPY_LONG: f[0] = 108 #"l"
5265 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
5266 __Pyx_GOTREF(__pyx_t_4);
5267 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error)
5268 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5269 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
5270 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5272 (__pyx_v_f[0]) = 0x69;
5276 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
5277 * elif t == NPY_USHORT: f[0] = 72 #"H"
5278 * elif t == NPY_INT: f[0] = 105 #"i"
5279 * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
5280 * elif t == NPY_LONG: f[0] = 108 #"l"
5281 * elif t == NPY_ULONG: f[0] = 76 #"L"
5283 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error)
5284 __Pyx_GOTREF(__pyx_t_3);
5285 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error)
5286 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5287 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error)
5288 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5290 (__pyx_v_f[0]) = 73;
5294 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
5295 * elif t == NPY_INT: f[0] = 105 #"i"
5296 * elif t == NPY_UINT: f[0] = 73 #"I"
5297 * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
5298 * elif t == NPY_ULONG: f[0] = 76 #"L"
5299 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5301 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
5302 __Pyx_GOTREF(__pyx_t_4);
5303 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error)
5304 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5305 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
5306 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5308 (__pyx_v_f[0]) = 0x6C;
5312 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
5313 * elif t == NPY_UINT: f[0] = 73 #"I"
5314 * elif t == NPY_LONG: f[0] = 108 #"l"
5315 * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
5316 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5317 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5319 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error)
5320 __Pyx_GOTREF(__pyx_t_3);
5321 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error)
5322 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5323 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error)
5324 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5326 (__pyx_v_f[0]) = 76;
5330 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
5331 * elif t == NPY_LONG: f[0] = 108 #"l"
5332 * elif t == NPY_ULONG: f[0] = 76 #"L"
5333 * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
5334 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5335 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5337 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
5338 __Pyx_GOTREF(__pyx_t_4);
5339 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error)
5340 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5341 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
5342 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5344 (__pyx_v_f[0]) = 0x71;
5348 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
5349 * elif t == NPY_ULONG: f[0] = 76 #"L"
5350 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5351 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
5352 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5353 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5355 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
5356 __Pyx_GOTREF(__pyx_t_3);
5357 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error)
5358 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5359 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error)
5360 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5362 (__pyx_v_f[0]) = 81;
5366 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
5367 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5368 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5369 * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
5370 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5371 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5373 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
5374 __Pyx_GOTREF(__pyx_t_4);
5375 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error)
5376 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5377 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
5378 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5380 (__pyx_v_f[0]) = 0x66;
5384 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
5385 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5386 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5387 * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
5388 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5389 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5391 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
5392 __Pyx_GOTREF(__pyx_t_3);
5393 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
5394 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5395 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
5396 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5398 (__pyx_v_f[0]) = 0x64;
5402 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
5403 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5404 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5405 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
5406 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5407 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5409 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
5410 __Pyx_GOTREF(__pyx_t_4);
5411 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
5412 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5413 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
5414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5416 (__pyx_v_f[0]) = 0x67;
5420 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
5421 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5422 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5423 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
5424 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5425 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5427 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error)
5428 __Pyx_GOTREF(__pyx_t_3);
5429 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
5430 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5431 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error)
5432 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5434 (__pyx_v_f[0]) = 90;
5435 (__pyx_v_f[1]) = 0x66;
5436 __pyx_v_f = (__pyx_v_f + 1);
5440 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
5441 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5442 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5443 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
5444 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5445 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5447 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
5448 __Pyx_GOTREF(__pyx_t_4);
5449 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error)
5450 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5451 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error)
5452 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5454 (__pyx_v_f[0]) = 90;
5455 (__pyx_v_f[1]) = 0x64;
5456 __pyx_v_f = (__pyx_v_f + 1);
5460 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
5461 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5462 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5463 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
5464 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5467 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error)
5468 __Pyx_GOTREF(__pyx_t_3);
5469 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
5470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5471 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error)
5472 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5474 (__pyx_v_f[0]) = 90;
5475 (__pyx_v_f[1]) = 0x67;
5476 __pyx_v_f = (__pyx_v_f + 1);
5480 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
5481 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5482 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5483 * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
5485 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5487 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
5488 __Pyx_GOTREF(__pyx_t_4);
5489 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
5490 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5491 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error)
5492 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5494 (__pyx_v_f[0]) = 79;
5498 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
5499 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5501 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
5506 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
5507 __Pyx_GOTREF(__pyx_t_3);
5508 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
5509 __Pyx_GOTREF(__pyx_t_4);
5510 __Pyx_GIVEREF(__pyx_t_3);
5511 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
5513 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
5514 __Pyx_GOTREF(__pyx_t_3);
5515 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5516 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5517 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5518 __PYX_ERR(1, 844, __pyx_L1_error)
5522 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
5524 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5525 * f += 1 # <<<<<<<<<<<<<<
5527 * # Cython ignores struct boundary information ("T{...}"),
5529 __pyx_v_f = (__pyx_v_f + 1);
5531 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
5532 * offset[0] += child.itemsize
5534 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
5535 * t = child.type_num
5541 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
5542 * # Cython ignores struct boundary information ("T{...}"),
5543 * # so don't output it
5544 * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
5549 __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_ERR(1, 849, __pyx_L1_error)
5550 __pyx_v_f = __pyx_t_9;
5554 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
5557 * for childname in descr.names: # <<<<<<<<<<<<<<
5558 * fields = descr.fields[childname]
5559 * child, new_offset = fields
5562 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5564 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
5565 * # so don't output it
5566 * f = _util_dtypestring(child, f, end, offset)
5567 * return f # <<<<<<<<<<<<<<
5571 __pyx_r = __pyx_v_f;
5574 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
5575 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5577 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
5578 * # Recursive utility function used in __getbuffer__ to get format
5579 * # string. The new location in the format string is returned.
5582 /* function exit code */
5584 __Pyx_XDECREF(__pyx_t_1);
5585 __Pyx_XDECREF(__pyx_t_3);
5586 __Pyx_XDECREF(__pyx_t_4);
5587 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
5590 __Pyx_XDECREF((PyObject *)__pyx_v_child);
5591 __Pyx_XDECREF(__pyx_v_fields);
5592 __Pyx_XDECREF(__pyx_v_childname);
5593 __Pyx_XDECREF(__pyx_v_new_offset);
5594 __Pyx_XDECREF(__pyx_v_t);
5595 __Pyx_RefNannyFinishContext();
5599 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
5602 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5603 * cdef PyObject* baseptr
5607 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5608 PyObject *__pyx_v_baseptr;
5609 __Pyx_RefNannyDeclarations
5612 __Pyx_RefNannySetupContext("set_array_base", 0);
5614 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
5615 * cdef inline void set_array_base(ndarray arr, object base):
5616 * cdef PyObject* baseptr
5617 * if base is None: # <<<<<<<<<<<<<<
5621 __pyx_t_1 = (__pyx_v_base == Py_None);
5622 __pyx_t_2 = (__pyx_t_1 != 0);
5625 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
5626 * cdef PyObject* baseptr
5628 * baseptr = NULL # <<<<<<<<<<<<<<
5630 * Py_INCREF(base) # important to do this before decref below!
5632 __pyx_v_baseptr = NULL;
5634 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
5635 * cdef inline void set_array_base(ndarray arr, object base):
5636 * cdef PyObject* baseptr
5637 * if base is None: # <<<<<<<<<<<<<<
5644 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
5647 * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
5648 * baseptr = <PyObject*>base
5649 * Py_XDECREF(arr.base)
5652 Py_INCREF(__pyx_v_base);
5654 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
5656 * Py_INCREF(base) # important to do this before decref below!
5657 * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
5658 * Py_XDECREF(arr.base)
5659 * arr.base = baseptr
5661 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
5665 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
5666 * Py_INCREF(base) # important to do this before decref below!
5667 * baseptr = <PyObject*>base
5668 * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
5669 * arr.base = baseptr
5672 Py_XDECREF(__pyx_v_arr->base);
5674 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
5675 * baseptr = <PyObject*>base
5676 * Py_XDECREF(arr.base)
5677 * arr.base = baseptr # <<<<<<<<<<<<<<
5679 * cdef inline object get_array_base(ndarray arr):
5681 __pyx_v_arr->base = __pyx_v_baseptr;
5683 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
5686 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5687 * cdef PyObject* baseptr
5691 /* function exit code */
5692 __Pyx_RefNannyFinishContext();
5695 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
5696 * arr.base = baseptr
5698 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5699 * if arr.base is NULL:
5703 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5704 PyObject *__pyx_r = NULL;
5705 __Pyx_RefNannyDeclarations
5707 __Pyx_RefNannySetupContext("get_array_base", 0);
5709 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
5711 * cdef inline object get_array_base(ndarray arr):
5712 * if arr.base is NULL: # <<<<<<<<<<<<<<
5716 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
5719 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
5720 * cdef inline object get_array_base(ndarray arr):
5721 * if arr.base is NULL:
5722 * return None # <<<<<<<<<<<<<<
5724 * return <object>arr.base
5726 __Pyx_XDECREF(__pyx_r);
5727 __Pyx_INCREF(Py_None);
5731 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
5733 * cdef inline object get_array_base(ndarray arr):
5734 * if arr.base is NULL: # <<<<<<<<<<<<<<
5740 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
5743 * return <object>arr.base # <<<<<<<<<<<<<<
5748 __Pyx_XDECREF(__pyx_r);
5749 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
5750 __pyx_r = ((PyObject *)__pyx_v_arr->base);
5754 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
5755 * arr.base = baseptr
5757 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5758 * if arr.base is NULL:
5762 /* function exit code */
5764 __Pyx_XGIVEREF(__pyx_r);
5765 __Pyx_RefNannyFinishContext();
5769 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
5770 * # Versions of the import_* functions which are more suitable for
5772 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5777 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5779 __Pyx_RefNannyDeclarations
5780 PyObject *__pyx_t_1 = NULL;
5781 PyObject *__pyx_t_2 = NULL;
5782 PyObject *__pyx_t_3 = NULL;
5784 PyObject *__pyx_t_5 = NULL;
5785 PyObject *__pyx_t_6 = NULL;
5786 PyObject *__pyx_t_7 = NULL;
5787 PyObject *__pyx_t_8 = NULL;
5788 __Pyx_RefNannySetupContext("import_array", 0);
5790 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
5792 * cdef inline int import_array() except -1:
5793 * try: # <<<<<<<<<<<<<<
5798 __Pyx_PyThreadState_declare
5799 __Pyx_PyThreadState_assign
5800 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5801 __Pyx_XGOTREF(__pyx_t_1);
5802 __Pyx_XGOTREF(__pyx_t_2);
5803 __Pyx_XGOTREF(__pyx_t_3);
5806 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
5807 * cdef inline int import_array() except -1:
5809 * _import_array() # <<<<<<<<<<<<<<
5811 * raise ImportError("numpy.core.multiarray failed to import")
5813 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
5815 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
5817 * cdef inline int import_array() except -1:
5818 * try: # <<<<<<<<<<<<<<
5823 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5824 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5825 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5826 goto __pyx_L10_try_end;
5828 __Pyx_PyThreadState_assign
5830 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
5833 * except Exception: # <<<<<<<<<<<<<<
5834 * raise ImportError("numpy.core.multiarray failed to import")
5837 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5839 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5840 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
5841 __Pyx_GOTREF(__pyx_t_5);
5842 __Pyx_GOTREF(__pyx_t_6);
5843 __Pyx_GOTREF(__pyx_t_7);
5845 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
5848 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
5850 * cdef inline int import_umath() except -1:
5852 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
5853 __Pyx_GOTREF(__pyx_t_8);
5854 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5855 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5856 __PYX_ERR(1, 989, __pyx_L5_except_error)
5858 goto __pyx_L5_except_error;
5859 __pyx_L5_except_error:;
5861 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
5863 * cdef inline int import_array() except -1:
5864 * try: # <<<<<<<<<<<<<<
5868 __Pyx_PyThreadState_assign
5869 __Pyx_XGIVEREF(__pyx_t_1);
5870 __Pyx_XGIVEREF(__pyx_t_2);
5871 __Pyx_XGIVEREF(__pyx_t_3);
5872 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5873 goto __pyx_L1_error;
5877 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
5878 * # Versions of the import_* functions which are more suitable for
5880 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5885 /* function exit code */
5889 __Pyx_XDECREF(__pyx_t_5);
5890 __Pyx_XDECREF(__pyx_t_6);
5891 __Pyx_XDECREF(__pyx_t_7);
5892 __Pyx_XDECREF(__pyx_t_8);
5893 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5896 __Pyx_RefNannyFinishContext();
5900 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
5901 * raise ImportError("numpy.core.multiarray failed to import")
5903 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5908 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5910 __Pyx_RefNannyDeclarations
5911 PyObject *__pyx_t_1 = NULL;
5912 PyObject *__pyx_t_2 = NULL;
5913 PyObject *__pyx_t_3 = NULL;
5915 PyObject *__pyx_t_5 = NULL;
5916 PyObject *__pyx_t_6 = NULL;
5917 PyObject *__pyx_t_7 = NULL;
5918 PyObject *__pyx_t_8 = NULL;
5919 __Pyx_RefNannySetupContext("import_umath", 0);
5921 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
5923 * cdef inline int import_umath() except -1:
5924 * try: # <<<<<<<<<<<<<<
5929 __Pyx_PyThreadState_declare
5930 __Pyx_PyThreadState_assign
5931 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5932 __Pyx_XGOTREF(__pyx_t_1);
5933 __Pyx_XGOTREF(__pyx_t_2);
5934 __Pyx_XGOTREF(__pyx_t_3);
5937 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":993
5938 * cdef inline int import_umath() except -1:
5940 * _import_umath() # <<<<<<<<<<<<<<
5942 * raise ImportError("numpy.core.umath failed to import")
5944 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
5946 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
5948 * cdef inline int import_umath() except -1:
5949 * try: # <<<<<<<<<<<<<<
5954 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5955 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5956 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5957 goto __pyx_L10_try_end;
5959 __Pyx_PyThreadState_assign
5961 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":994
5964 * except Exception: # <<<<<<<<<<<<<<
5965 * raise ImportError("numpy.core.umath failed to import")
5968 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5970 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5971 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
5972 __Pyx_GOTREF(__pyx_t_5);
5973 __Pyx_GOTREF(__pyx_t_6);
5974 __Pyx_GOTREF(__pyx_t_7);
5976 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":995
5979 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
5981 * cdef inline int import_ufunc() except -1:
5983 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
5984 __Pyx_GOTREF(__pyx_t_8);
5985 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5986 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5987 __PYX_ERR(1, 995, __pyx_L5_except_error)
5989 goto __pyx_L5_except_error;
5990 __pyx_L5_except_error:;
5992 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
5994 * cdef inline int import_umath() except -1:
5995 * try: # <<<<<<<<<<<<<<
5999 __Pyx_PyThreadState_assign
6000 __Pyx_XGIVEREF(__pyx_t_1);
6001 __Pyx_XGIVEREF(__pyx_t_2);
6002 __Pyx_XGIVEREF(__pyx_t_3);
6003 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6004 goto __pyx_L1_error;
6008 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
6009 * raise ImportError("numpy.core.multiarray failed to import")
6011 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6016 /* function exit code */
6020 __Pyx_XDECREF(__pyx_t_5);
6021 __Pyx_XDECREF(__pyx_t_6);
6022 __Pyx_XDECREF(__pyx_t_7);
6023 __Pyx_XDECREF(__pyx_t_8);
6024 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6027 __Pyx_RefNannyFinishContext();
6031 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
6032 * raise ImportError("numpy.core.umath failed to import")
6034 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6039 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6041 __Pyx_RefNannyDeclarations
6042 PyObject *__pyx_t_1 = NULL;
6043 PyObject *__pyx_t_2 = NULL;
6044 PyObject *__pyx_t_3 = NULL;
6046 PyObject *__pyx_t_5 = NULL;
6047 PyObject *__pyx_t_6 = NULL;
6048 PyObject *__pyx_t_7 = NULL;
6049 PyObject *__pyx_t_8 = NULL;
6050 __Pyx_RefNannySetupContext("import_ufunc", 0);
6052 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
6054 * cdef inline int import_ufunc() except -1:
6055 * try: # <<<<<<<<<<<<<<
6060 __Pyx_PyThreadState_declare
6061 __Pyx_PyThreadState_assign
6062 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6063 __Pyx_XGOTREF(__pyx_t_1);
6064 __Pyx_XGOTREF(__pyx_t_2);
6065 __Pyx_XGOTREF(__pyx_t_3);
6068 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":999
6069 * cdef inline int import_ufunc() except -1:
6071 * _import_umath() # <<<<<<<<<<<<<<
6073 * raise ImportError("numpy.core.umath failed to import")
6075 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
6077 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
6079 * cdef inline int import_ufunc() except -1:
6080 * try: # <<<<<<<<<<<<<<
6085 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6086 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6087 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6088 goto __pyx_L10_try_end;
6090 __Pyx_PyThreadState_assign
6092 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
6095 * except Exception: # <<<<<<<<<<<<<<
6096 * raise ImportError("numpy.core.umath failed to import")
6098 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6100 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6101 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
6102 __Pyx_GOTREF(__pyx_t_5);
6103 __Pyx_GOTREF(__pyx_t_6);
6104 __Pyx_GOTREF(__pyx_t_7);
6106 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1001
6109 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6111 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
6112 __Pyx_GOTREF(__pyx_t_8);
6113 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6114 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6115 __PYX_ERR(1, 1001, __pyx_L5_except_error)
6117 goto __pyx_L5_except_error;
6118 __pyx_L5_except_error:;
6120 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
6122 * cdef inline int import_ufunc() except -1:
6123 * try: # <<<<<<<<<<<<<<
6127 __Pyx_PyThreadState_assign
6128 __Pyx_XGIVEREF(__pyx_t_1);
6129 __Pyx_XGIVEREF(__pyx_t_2);
6130 __Pyx_XGIVEREF(__pyx_t_3);
6131 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6132 goto __pyx_L1_error;
6136 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
6137 * raise ImportError("numpy.core.umath failed to import")
6139 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6144 /* function exit code */
6148 __Pyx_XDECREF(__pyx_t_5);
6149 __Pyx_XDECREF(__pyx_t_6);
6150 __Pyx_XDECREF(__pyx_t_7);
6151 __Pyx_XDECREF(__pyx_t_8);
6152 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6155 __Pyx_RefNannyFinishContext();
6159 static PyMethodDef __pyx_methods[] = {
6163 #if PY_MAJOR_VERSION >= 3
6164 static struct PyModuleDef __pyx_moduledef = {
6165 #if PY_VERSION_HEX < 0x03020000
6166 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
6168 PyModuleDef_HEAD_INIT,
6173 __pyx_methods /* m_methods */,
6174 NULL, /* m_reload */
6175 NULL, /* m_traverse */
6181 static __Pyx_StringTabEntry __pyx_string_tab[] = {
6182 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
6183 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
6184 {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
6185 {&__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},
6186 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
6187 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
6188 {&__pyx_n_s_areas, __pyx_k_areas, sizeof(__pyx_k_areas), 0, 0, 1, 1},
6189 {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1},
6190 {&__pyx_n_s_cython_nms, __pyx_k_cython_nms, sizeof(__pyx_k_cython_nms), 0, 0, 1, 1},
6191 {&__pyx_n_s_dets, __pyx_k_dets, sizeof(__pyx_k_dets), 0, 0, 1, 1},
6192 {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
6193 {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
6194 {&__pyx_kp_s_home_yjr_PycharmProjects_Faster, __pyx_k_home_yjr_PycharmProjects_Faster, sizeof(__pyx_k_home_yjr_PycharmProjects_Faster), 0, 0, 1, 0},
6195 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
6196 {&__pyx_n_s_i_2, __pyx_k_i_2, sizeof(__pyx_k_i_2), 0, 0, 1, 1},
6197 {&__pyx_n_s_iarea, __pyx_k_iarea, sizeof(__pyx_k_iarea), 0, 0, 1, 1},
6198 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
6199 {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
6200 {&__pyx_n_s_inter, __pyx_k_inter, sizeof(__pyx_k_inter), 0, 0, 1, 1},
6201 {&__pyx_n_s_ix1, __pyx_k_ix1, sizeof(__pyx_k_ix1), 0, 0, 1, 1},
6202 {&__pyx_n_s_ix2, __pyx_k_ix2, sizeof(__pyx_k_ix2), 0, 0, 1, 1},
6203 {&__pyx_n_s_iy1, __pyx_k_iy1, sizeof(__pyx_k_iy1), 0, 0, 1, 1},
6204 {&__pyx_n_s_iy2, __pyx_k_iy2, sizeof(__pyx_k_iy2), 0, 0, 1, 1},
6205 {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
6206 {&__pyx_n_s_j_2, __pyx_k_j_2, sizeof(__pyx_k_j_2), 0, 0, 1, 1},
6207 {&__pyx_n_s_keep, __pyx_k_keep, sizeof(__pyx_k_keep), 0, 0, 1, 1},
6208 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
6209 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
6210 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
6211 {&__pyx_n_s_ndets, __pyx_k_ndets, sizeof(__pyx_k_ndets), 0, 0, 1, 1},
6212 {&__pyx_n_s_nms, __pyx_k_nms, sizeof(__pyx_k_nms), 0, 0, 1, 1},
6213 {&__pyx_n_s_nms_new, __pyx_k_nms_new, sizeof(__pyx_k_nms_new), 0, 0, 1, 1},
6214 {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
6215 {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
6216 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
6217 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
6218 {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
6219 {&__pyx_n_s_ovr, __pyx_k_ovr, sizeof(__pyx_k_ovr), 0, 0, 1, 1},
6220 {&__pyx_n_s_ovr1, __pyx_k_ovr1, sizeof(__pyx_k_ovr1), 0, 0, 1, 1},
6221 {&__pyx_n_s_ovr2, __pyx_k_ovr2, sizeof(__pyx_k_ovr2), 0, 0, 1, 1},
6222 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
6223 {&__pyx_n_s_scores, __pyx_k_scores, sizeof(__pyx_k_scores), 0, 0, 1, 1},
6224 {&__pyx_n_s_suppressed, __pyx_k_suppressed, sizeof(__pyx_k_suppressed), 0, 0, 1, 1},
6225 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
6226 {&__pyx_n_s_thresh, __pyx_k_thresh, sizeof(__pyx_k_thresh), 0, 0, 1, 1},
6227 {&__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},
6228 {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
6229 {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1},
6230 {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1},
6231 {&__pyx_n_s_xx1, __pyx_k_xx1, sizeof(__pyx_k_xx1), 0, 0, 1, 1},
6232 {&__pyx_n_s_xx2, __pyx_k_xx2, sizeof(__pyx_k_xx2), 0, 0, 1, 1},
6233 {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1},
6234 {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1},
6235 {&__pyx_n_s_yy1, __pyx_k_yy1, sizeof(__pyx_k_yy1), 0, 0, 1, 1},
6236 {&__pyx_n_s_yy2, __pyx_k_yy2, sizeof(__pyx_k_yy2), 0, 0, 1, 1},
6237 {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
6238 {0, 0, 0, 0, 0, 0, 0}
6240 static int __Pyx_InitCachedBuiltins(void) {
6241 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 43, __pyx_L1_error)
6242 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error)
6243 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
6244 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
6250 static int __Pyx_InitCachedConstants(void) {
6251 __Pyx_RefNannyDeclarations
6252 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
6256 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
6257 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0] # <<<<<<<<<<<<<<
6258 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6259 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6261 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 18, __pyx_L1_error)
6262 __Pyx_GOTREF(__pyx_slice_);
6263 __Pyx_GIVEREF(__pyx_slice_);
6264 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_slice_, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 18, __pyx_L1_error)
6265 __Pyx_GOTREF(__pyx_tuple__2);
6266 __Pyx_GIVEREF(__pyx_tuple__2);
6269 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
6270 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6271 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1] # <<<<<<<<<<<<<<
6272 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6273 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
6275 __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 19, __pyx_L1_error)
6276 __Pyx_GOTREF(__pyx_slice__3);
6277 __Pyx_GIVEREF(__pyx_slice__3);
6278 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_slice__3, __pyx_int_1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 19, __pyx_L1_error)
6279 __Pyx_GOTREF(__pyx_tuple__4);
6280 __Pyx_GIVEREF(__pyx_tuple__4);
6283 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6284 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6285 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2] # <<<<<<<<<<<<<<
6286 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
6287 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
6289 __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 20, __pyx_L1_error)
6290 __Pyx_GOTREF(__pyx_slice__5);
6291 __Pyx_GIVEREF(__pyx_slice__5);
6292 __pyx_tuple__6 = PyTuple_Pack(2, __pyx_slice__5, __pyx_int_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 20, __pyx_L1_error)
6293 __Pyx_GOTREF(__pyx_tuple__6);
6294 __Pyx_GIVEREF(__pyx_tuple__6);
6297 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6298 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6299 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3] # <<<<<<<<<<<<<<
6300 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
6303 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 21, __pyx_L1_error)
6304 __Pyx_GOTREF(__pyx_slice__7);
6305 __Pyx_GIVEREF(__pyx_slice__7);
6306 __pyx_tuple__8 = PyTuple_Pack(2, __pyx_slice__7, __pyx_int_3); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 21, __pyx_L1_error)
6307 __Pyx_GOTREF(__pyx_tuple__8);
6308 __Pyx_GIVEREF(__pyx_tuple__8);
6311 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6312 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
6313 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4] # <<<<<<<<<<<<<<
6315 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
6317 __pyx_slice__9 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 22, __pyx_L1_error)
6318 __Pyx_GOTREF(__pyx_slice__9);
6319 __Pyx_GIVEREF(__pyx_slice__9);
6320 __pyx_tuple__10 = PyTuple_Pack(2, __pyx_slice__9, __pyx_int_4); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 22, __pyx_L1_error)
6321 __Pyx_GOTREF(__pyx_tuple__10);
6322 __Pyx_GIVEREF(__pyx_tuple__10);
6326 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
6327 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1] # <<<<<<<<<<<<<<
6329 * cdef int ndets = dets.shape[0]
6331 __pyx_slice__11 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 25, __pyx_L1_error)
6332 __Pyx_GOTREF(__pyx_slice__11);
6333 __Pyx_GIVEREF(__pyx_slice__11);
6337 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
6338 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0] # <<<<<<<<<<<<<<
6339 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6340 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6342 __pyx_slice__12 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) __PYX_ERR(0, 71, __pyx_L1_error)
6343 __Pyx_GOTREF(__pyx_slice__12);
6344 __Pyx_GIVEREF(__pyx_slice__12);
6345 __pyx_tuple__13 = PyTuple_Pack(2, __pyx_slice__12, __pyx_int_0); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 71, __pyx_L1_error)
6346 __Pyx_GOTREF(__pyx_tuple__13);
6347 __Pyx_GIVEREF(__pyx_tuple__13);
6350 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh):
6351 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6352 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1] # <<<<<<<<<<<<<<
6353 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6354 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
6356 __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 72, __pyx_L1_error)
6357 __Pyx_GOTREF(__pyx_slice__14);
6358 __Pyx_GIVEREF(__pyx_slice__14);
6359 __pyx_tuple__15 = PyTuple_Pack(2, __pyx_slice__14, __pyx_int_1); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 72, __pyx_L1_error)
6360 __Pyx_GOTREF(__pyx_tuple__15);
6361 __Pyx_GIVEREF(__pyx_tuple__15);
6364 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6365 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6366 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2] # <<<<<<<<<<<<<<
6367 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
6368 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
6370 __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 73, __pyx_L1_error)
6371 __Pyx_GOTREF(__pyx_slice__16);
6372 __Pyx_GIVEREF(__pyx_slice__16);
6373 __pyx_tuple__17 = PyTuple_Pack(2, __pyx_slice__16, __pyx_int_2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 73, __pyx_L1_error)
6374 __Pyx_GOTREF(__pyx_tuple__17);
6375 __Pyx_GIVEREF(__pyx_tuple__17);
6378 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6379 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6380 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3] # <<<<<<<<<<<<<<
6381 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4]
6384 __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) __PYX_ERR(0, 74, __pyx_L1_error)
6385 __Pyx_GOTREF(__pyx_slice__18);
6386 __Pyx_GIVEREF(__pyx_slice__18);
6387 __pyx_tuple__19 = PyTuple_Pack(2, __pyx_slice__18, __pyx_int_3); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 74, __pyx_L1_error)
6388 __Pyx_GOTREF(__pyx_tuple__19);
6389 __Pyx_GIVEREF(__pyx_tuple__19);
6392 * cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2]
6393 * cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3]
6394 * cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4] # <<<<<<<<<<<<<<
6396 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
6398 __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 75, __pyx_L1_error)
6399 __Pyx_GOTREF(__pyx_slice__20);
6400 __Pyx_GIVEREF(__pyx_slice__20);
6401 __pyx_tuple__21 = PyTuple_Pack(2, __pyx_slice__20, __pyx_int_4); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 75, __pyx_L1_error)
6402 __Pyx_GOTREF(__pyx_tuple__21);
6403 __Pyx_GIVEREF(__pyx_tuple__21);
6407 * cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1)
6408 * cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1] # <<<<<<<<<<<<<<
6410 * cdef int ndets = dets.shape[0]
6412 __pyx_slice__22 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__22)) __PYX_ERR(0, 78, __pyx_L1_error)
6413 __Pyx_GOTREF(__pyx_slice__22);
6414 __Pyx_GIVEREF(__pyx_slice__22);
6416 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
6417 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6418 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6419 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6421 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6423 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 218, __pyx_L1_error)
6424 __Pyx_GOTREF(__pyx_tuple__23);
6425 __Pyx_GIVEREF(__pyx_tuple__23);
6427 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
6428 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6429 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6430 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6432 * info.buf = PyArray_DATA(self)
6434 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 222, __pyx_L1_error)
6435 __Pyx_GOTREF(__pyx_tuple__24);
6436 __Pyx_GIVEREF(__pyx_tuple__24);
6438 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
6439 * if ((descr.byteorder == c'>' and little_endian) or
6440 * (descr.byteorder == c'<' and not little_endian)):
6441 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6442 * if t == NPY_BYTE: f = "b"
6443 * elif t == NPY_UBYTE: f = "B"
6445 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 259, __pyx_L1_error)
6446 __Pyx_GOTREF(__pyx_tuple__25);
6447 __Pyx_GIVEREF(__pyx_tuple__25);
6449 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
6451 * if (end - f) - <int>(new_offset - offset[0]) < 15:
6452 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
6454 * if ((child.byteorder == c'>' and little_endian) or
6456 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 799, __pyx_L1_error)
6457 __Pyx_GOTREF(__pyx_tuple__26);
6458 __Pyx_GIVEREF(__pyx_tuple__26);
6460 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
6461 * if ((child.byteorder == c'>' and little_endian) or
6462 * (child.byteorder == c'<' and not little_endian)):
6463 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6464 * # One could encode it in the format string and have Cython
6465 * # complain instead, BUT: < and > in format strings also imply
6467 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 803, __pyx_L1_error)
6468 __Pyx_GOTREF(__pyx_tuple__27);
6469 __Pyx_GIVEREF(__pyx_tuple__27);
6471 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
6472 * t = child.type_num
6474 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
6476 * # Until ticket #99 is fixed, use integers to avoid warnings
6478 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 823, __pyx_L1_error)
6479 __Pyx_GOTREF(__pyx_tuple__28);
6480 __Pyx_GIVEREF(__pyx_tuple__28);
6482 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
6485 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
6487 * cdef inline int import_umath() except -1:
6489 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 989, __pyx_L1_error)
6490 __Pyx_GOTREF(__pyx_tuple__29);
6491 __Pyx_GIVEREF(__pyx_tuple__29);
6493 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":995
6496 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6498 * cdef inline int import_ufunc() except -1:
6500 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 995, __pyx_L1_error)
6501 __Pyx_GOTREF(__pyx_tuple__30);
6502 __Pyx_GIVEREF(__pyx_tuple__30);
6504 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1001
6507 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6509 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 1001, __pyx_L1_error)
6510 __Pyx_GOTREF(__pyx_tuple__31);
6511 __Pyx_GIVEREF(__pyx_tuple__31);
6514 * return a if a <= b else b
6516 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
6517 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6518 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6520 __pyx_tuple__32 = PyTuple_Pack(29, __pyx_n_s_dets, __pyx_n_s_thresh, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_scores, __pyx_n_s_areas, __pyx_n_s_order, __pyx_n_s_ndets, __pyx_n_s_suppressed, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_2, __pyx_n_s_j_2, __pyx_n_s_ix1, __pyx_n_s_iy1, __pyx_n_s_ix2, __pyx_n_s_iy2, __pyx_n_s_iarea, __pyx_n_s_xx1, __pyx_n_s_yy1, __pyx_n_s_xx2, __pyx_n_s_yy2, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_inter, __pyx_n_s_ovr, __pyx_n_s_keep); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 17, __pyx_L1_error)
6521 __Pyx_GOTREF(__pyx_tuple__32);
6522 __Pyx_GIVEREF(__pyx_tuple__32);
6523 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yjr_PycharmProjects_Faster, __pyx_n_s_nms, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 17, __pyx_L1_error)
6528 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
6529 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6530 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6532 __pyx_tuple__34 = PyTuple_Pack(31, __pyx_n_s_dets, __pyx_n_s_thresh, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_scores, __pyx_n_s_areas, __pyx_n_s_order, __pyx_n_s_ndets, __pyx_n_s_suppressed, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_i_2, __pyx_n_s_j_2, __pyx_n_s_ix1, __pyx_n_s_iy1, __pyx_n_s_ix2, __pyx_n_s_iy2, __pyx_n_s_iarea, __pyx_n_s_xx1, __pyx_n_s_yy1, __pyx_n_s_xx2, __pyx_n_s_yy2, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_inter, __pyx_n_s_ovr, __pyx_n_s_keep, __pyx_n_s_ovr1, __pyx_n_s_ovr2); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 70, __pyx_L1_error)
6533 __Pyx_GOTREF(__pyx_tuple__34);
6534 __Pyx_GIVEREF(__pyx_tuple__34);
6535 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yjr_PycharmProjects_Faster, __pyx_n_s_nms_new, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 70, __pyx_L1_error)
6536 __Pyx_RefNannyFinishContext();
6539 __Pyx_RefNannyFinishContext();
6543 static int __Pyx_InitGlobals(void) {
6544 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6545 __pyx_float_0_95 = PyFloat_FromDouble(0.95); if (unlikely(!__pyx_float_0_95)) __PYX_ERR(0, 1, __pyx_L1_error)
6546 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
6547 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6548 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
6549 __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
6550 __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
6551 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6557 #if PY_MAJOR_VERSION < 3
6558 PyMODINIT_FUNC initcython_nms(void); /*proto*/
6559 PyMODINIT_FUNC initcython_nms(void)
6561 PyMODINIT_FUNC PyInit_cython_nms(void); /*proto*/
6562 PyMODINIT_FUNC PyInit_cython_nms(void)
6565 PyObject *__pyx_t_1 = NULL;
6566 __Pyx_RefNannyDeclarations
6568 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6569 if (!__Pyx_RefNanny) {
6571 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6572 if (!__Pyx_RefNanny)
6573 Py_FatalError("failed to import 'refnanny' module");
6576 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cython_nms(void)", 0);
6577 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6578 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
6579 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
6580 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
6581 #ifdef __Pyx_CyFunction_USED
6582 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6584 #ifdef __Pyx_FusedFunction_USED
6585 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6587 #ifdef __Pyx_Coroutine_USED
6588 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6590 #ifdef __Pyx_Generator_USED
6591 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6593 #ifdef __Pyx_StopAsyncIteration_USED
6594 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6596 /*--- Library function declarations ---*/
6597 /*--- Threads initialization code ---*/
6598 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6599 #ifdef WITH_THREAD /* Python build with threading support? */
6600 PyEval_InitThreads();
6603 /*--- Module creation code ---*/
6604 #if PY_MAJOR_VERSION < 3
6605 __pyx_m = Py_InitModule4("cython_nms", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
6607 __pyx_m = PyModule_Create(&__pyx_moduledef);
6609 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
6610 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
6612 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6613 #if CYTHON_COMPILING_IN_PYPY
6616 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6617 /*--- Initialize various global constants etc. ---*/
6618 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6619 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6620 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6622 if (__pyx_module_is_main_cython_nms) {
6623 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6625 #if PY_MAJOR_VERSION >= 3
6627 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
6628 if (!PyDict_GetItemString(modules, "cython_nms")) {
6629 if (unlikely(PyDict_SetItemString(modules, "cython_nms", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
6633 /*--- Builtin init code ---*/
6634 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6635 /*--- Constants init code ---*/
6636 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6637 /*--- Global init code ---*/
6638 /*--- Variable export code ---*/
6639 /*--- Function export code ---*/
6640 /*--- Type init code ---*/
6641 /*--- Type import code ---*/
6642 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
6643 #if CYTHON_COMPILING_IN_PYPY
6644 sizeof(PyTypeObject),
6646 sizeof(PyHeapTypeObject),
6648 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error)
6649 __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
6650 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
6651 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
6652 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
6653 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
6654 /*--- Variable import code ---*/
6655 /*--- Function import code ---*/
6656 /*--- Execution code ---*/
6657 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
6658 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6662 * # --------------------------------------------------------
6664 * import numpy as np # <<<<<<<<<<<<<<
6665 * cimport numpy as np
6668 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
6669 __Pyx_GOTREF(__pyx_t_1);
6670 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
6671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6674 * return a if a <= b else b
6676 * def nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
6677 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6678 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6680 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10cython_nms_1nms, NULL, __pyx_n_s_cython_nms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
6681 __Pyx_GOTREF(__pyx_t_1);
6682 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nms, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
6683 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6688 * def nms_new(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): # <<<<<<<<<<<<<<
6689 * cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0]
6690 * cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1]
6692 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10cython_nms_3nms_new, NULL, __pyx_n_s_cython_nms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
6693 __Pyx_GOTREF(__pyx_t_1);
6694 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nms_new, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
6695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6698 * # -------------------------------------------------------- # <<<<<<<<<<<<<<
6700 * # Copyright (c) 2015 Microsoft
6702 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6703 __Pyx_GOTREF(__pyx_t_1);
6704 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6705 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6707 /* "../../../../../softWares/anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
6708 * raise ImportError("numpy.core.umath failed to import")
6710 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6715 /*--- Wrapped vars code ---*/
6719 __Pyx_XDECREF(__pyx_t_1);
6722 __Pyx_AddTraceback("init cython_nms", __pyx_clineno, __pyx_lineno, __pyx_filename);
6724 Py_DECREF(__pyx_m); __pyx_m = 0;
6725 } else if (!PyErr_Occurred()) {
6726 PyErr_SetString(PyExc_ImportError, "init cython_nms");
6729 __Pyx_RefNannyFinishContext();
6730 #if PY_MAJOR_VERSION < 3
6737 /* --- Runtime support code --- */
6740 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
6741 PyObject *m = NULL, *p = NULL;
6743 m = PyImport_ImportModule((char *)modname);
6745 p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
6747 r = PyLong_AsVoidPtr(p);
6751 return (__Pyx_RefNannyAPIStruct *)r;
6755 /* GetBuiltinName */
6756 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
6757 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
6758 if (unlikely(!result)) {
6759 PyErr_Format(PyExc_NameError,
6760 #if PY_MAJOR_VERSION >= 3
6761 "name '%U' is not defined", name);
6763 "name '%.200s' is not defined", PyString_AS_STRING(name));
6769 /* RaiseArgTupleInvalid */
6770 static void __Pyx_RaiseArgtupleInvalid(
6771 const char* func_name,
6775 Py_ssize_t num_found)
6777 Py_ssize_t num_expected;
6778 const char *more_or_less;
6779 if (num_found < num_min) {
6780 num_expected = num_min;
6781 more_or_less = "at least";
6783 num_expected = num_max;
6784 more_or_less = "at most";
6787 more_or_less = "exactly";
6789 PyErr_Format(PyExc_TypeError,
6790 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
6791 func_name, more_or_less, num_expected,
6792 (num_expected == 1) ? "" : "s", num_found);
6795 /* RaiseDoubleKeywords */
6796 static void __Pyx_RaiseDoubleKeywordsError(
6797 const char* func_name,
6800 PyErr_Format(PyExc_TypeError,
6801 #if PY_MAJOR_VERSION >= 3
6802 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
6804 "%s() got multiple values for keyword argument '%s'", func_name,
6805 PyString_AsString(kw_name));
6810 static int __Pyx_ParseOptionalKeywords(
6812 PyObject **argnames[],
6815 Py_ssize_t num_pos_args,
6816 const char* function_name)
6818 PyObject *key = 0, *value = 0;
6821 PyObject*** first_kw_arg = argnames + num_pos_args;
6822 while (PyDict_Next(kwds, &pos, &key, &value)) {
6823 name = first_kw_arg;
6824 while (*name && (**name != key)) name++;
6826 values[name-argnames] = value;
6829 name = first_kw_arg;
6830 #if PY_MAJOR_VERSION < 3
6831 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
6833 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
6834 && _PyString_Eq(**name, key)) {
6835 values[name-argnames] = value;
6840 if (*name) continue;
6842 PyObject*** argname = argnames;
6843 while (argname != first_kw_arg) {
6844 if ((**argname == key) || (
6845 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
6846 && _PyString_Eq(**argname, key))) {
6847 goto arg_passed_twice;
6854 if (likely(PyUnicode_Check(key))) {
6856 int cmp = (**name == key) ? 0 :
6857 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
6858 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
6860 PyUnicode_Compare(**name, key);
6861 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
6863 values[name-argnames] = value;
6868 if (*name) continue;
6870 PyObject*** argname = argnames;
6871 while (argname != first_kw_arg) {
6872 int cmp = (**argname == key) ? 0 :
6873 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
6874 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
6876 PyUnicode_Compare(**argname, key);
6877 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
6878 if (cmp == 0) goto arg_passed_twice;
6883 goto invalid_keyword_type;
6885 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
6887 goto invalid_keyword;
6892 __Pyx_RaiseDoubleKeywordsError(function_name, key);
6894 invalid_keyword_type:
6895 PyErr_Format(PyExc_TypeError,
6896 "%.200s() keywords must be strings", function_name);
6899 PyErr_Format(PyExc_TypeError,
6900 #if PY_MAJOR_VERSION < 3
6901 "%.200s() got an unexpected keyword argument '%.200s'",
6902 function_name, PyString_AsString(key));
6904 "%s() got an unexpected keyword argument '%U'",
6905 function_name, key);
6912 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
6913 PyErr_Format(PyExc_TypeError,
6914 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
6915 name, type->tp_name, Py_TYPE(obj)->tp_name);
6917 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
6918 const char *name, int exact)
6920 if (unlikely(!type)) {
6921 PyErr_SetString(PyExc_SystemError, "Missing type object");
6924 if (none_allowed && obj == Py_None) return 1;
6926 if (likely(Py_TYPE(obj) == type)) return 1;
6927 #if PY_MAJOR_VERSION == 2
6928 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
6932 if (likely(PyObject_TypeCheck(obj, type))) return 1;
6934 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
6938 /* BufferFormatCheck */
6939 static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
6941 return *(unsigned char*)(&n) != 0;
6943 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
6944 __Pyx_BufFmt_StackElem* stack,
6945 __Pyx_TypeInfo* type) {
6946 stack[0].field = &ctx->root;
6947 stack[0].parent_offset = 0;
6948 ctx->root.type = type;
6949 ctx->root.name = "buffer dtype";
6950 ctx->root.offset = 0;
6952 ctx->head->field = &ctx->root;
6953 ctx->fmt_offset = 0;
6954 ctx->head->parent_offset = 0;
6955 ctx->new_packmode = '@';
6956 ctx->enc_packmode = '@';
6960 ctx->is_complex = 0;
6961 ctx->is_valid_array = 0;
6962 ctx->struct_alignment = 0;
6963 while (type->typegroup == 'S') {
6965 ctx->head->field = type->fields;
6966 ctx->head->parent_offset = 0;
6967 type = type->fields->type;
6970 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
6972 const char* t = *ts;
6973 if (*t < '0' || *t > '9') {
6977 while (*t >= '0' && *t < '9') {
6979 count += *t++ - '0';
6985 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
6986 int number = __Pyx_BufFmt_ParseNumber(ts);
6988 PyErr_Format(PyExc_ValueError,\
6989 "Does not understand character buffer dtype format string ('%c')", **ts);
6992 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
6993 PyErr_Format(PyExc_ValueError,
6994 "Unexpected format string character: '%c'", ch);
6996 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
6998 case 'c': return "'char'";
6999 case 'b': return "'signed char'";
7000 case 'B': return "'unsigned char'";
7001 case 'h': return "'short'";
7002 case 'H': return "'unsigned short'";
7003 case 'i': return "'int'";
7004 case 'I': return "'unsigned int'";
7005 case 'l': return "'long'";
7006 case 'L': return "'unsigned long'";
7007 case 'q': return "'long long'";
7008 case 'Q': return "'unsigned long long'";
7009 case 'f': return (is_complex ? "'complex float'" : "'float'");
7010 case 'd': return (is_complex ? "'complex double'" : "'double'");
7011 case 'g': return (is_complex ? "'complex long double'" : "'long double'");
7012 case 'T': return "a struct";
7013 case 'O': return "Python object";
7014 case 'P': return "a pointer";
7015 case 's': case 'p': return "a string";
7016 case 0: return "end";
7017 default: return "unparseable format string";
7020 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
7022 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7023 case 'h': case 'H': return 2;
7024 case 'i': case 'I': case 'l': case 'L': return 4;
7025 case 'q': case 'Q': return 8;
7026 case 'f': return (is_complex ? 8 : 4);
7027 case 'd': return (is_complex ? 16 : 8);
7029 PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
7032 case 'O': case 'P': return sizeof(void*);
7034 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7038 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
7040 case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7041 case 'h': case 'H': return sizeof(short);
7042 case 'i': case 'I': return sizeof(int);
7043 case 'l': case 'L': return sizeof(long);
7044 #ifdef HAVE_LONG_LONG
7045 case 'q': case 'Q': return sizeof(PY_LONG_LONG);
7047 case 'f': return sizeof(float) * (is_complex ? 2 : 1);
7048 case 'd': return sizeof(double) * (is_complex ? 2 : 1);
7049 case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
7050 case 'O': case 'P': return sizeof(void*);
7052 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7057 typedef struct { char c; short x; } __Pyx_st_short;
7058 typedef struct { char c; int x; } __Pyx_st_int;
7059 typedef struct { char c; long x; } __Pyx_st_long;
7060 typedef struct { char c; float x; } __Pyx_st_float;
7061 typedef struct { char c; double x; } __Pyx_st_double;
7062 typedef struct { char c; long double x; } __Pyx_st_longdouble;
7063 typedef struct { char c; void *x; } __Pyx_st_void_p;
7064 #ifdef HAVE_LONG_LONG
7065 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
7067 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
7069 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7070 case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
7071 case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
7072 case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
7073 #ifdef HAVE_LONG_LONG
7074 case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
7076 case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
7077 case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
7078 case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
7079 case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
7081 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7085 /* These are for computing the padding at the end of the struct to align
7086 on the first member of the struct. This will probably the same as above,
7087 but we don't have any guarantees.
7089 typedef struct { short x; char c; } __Pyx_pad_short;
7090 typedef struct { int x; char c; } __Pyx_pad_int;
7091 typedef struct { long x; char c; } __Pyx_pad_long;
7092 typedef struct { float x; char c; } __Pyx_pad_float;
7093 typedef struct { double x; char c; } __Pyx_pad_double;
7094 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
7095 typedef struct { void *x; char c; } __Pyx_pad_void_p;
7096 #ifdef HAVE_LONG_LONG
7097 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
7099 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
7101 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7102 case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
7103 case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
7104 case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
7105 #ifdef HAVE_LONG_LONG
7106 case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
7108 case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
7109 case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
7110 case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
7111 case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
7113 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7117 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
7121 case 'b': case 'h': case 'i':
7122 case 'l': case 'q': case 's': case 'p':
7124 case 'B': case 'H': case 'I': case 'L': case 'Q':
7126 case 'f': case 'd': case 'g':
7127 return (is_complex ? 'C' : 'R');
7133 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7138 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
7139 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
7140 const char* expected;
7142 if (ctx->head == NULL) {
7146 expected = ctx->head->field->type->name;
7149 PyErr_Format(PyExc_ValueError,
7150 "Buffer dtype mismatch, expected %s%s%s but got %s",
7151 quote, expected, quote,
7152 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
7154 __Pyx_StructField* field = ctx->head->field;
7155 __Pyx_StructField* parent = (ctx->head - 1)->field;
7156 PyErr_Format(PyExc_ValueError,
7157 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
7158 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
7159 parent->type->name, field->name);
7162 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
7164 size_t size, offset, arraysize = 1;
7165 if (ctx->enc_type == 0) return 0;
7166 if (ctx->head->field->type->arraysize[0]) {
7168 if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
7169 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
7171 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
7172 PyErr_Format(PyExc_ValueError,
7173 "Expected a dimension of size %zu, got %zu",
7174 ctx->head->field->type->arraysize[0], ctx->enc_count);
7178 if (!ctx->is_valid_array) {
7179 PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
7180 ctx->head->field->type->ndim, ndim);
7183 for (i = 0; i < ctx->head->field->type->ndim; i++) {
7184 arraysize *= ctx->head->field->type->arraysize[i];
7186 ctx->is_valid_array = 0;
7189 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
7191 __Pyx_StructField* field = ctx->head->field;
7192 __Pyx_TypeInfo* type = field->type;
7193 if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
7194 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
7196 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
7198 if (ctx->enc_packmode == '@') {
7199 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
7200 size_t align_mod_offset;
7201 if (align_at == 0) return -1;
7202 align_mod_offset = ctx->fmt_offset % align_at;
7203 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
7204 if (ctx->struct_alignment == 0)
7205 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
7208 if (type->size != size || type->typegroup != group) {
7209 if (type->typegroup == 'C' && type->fields != NULL) {
7210 size_t parent_offset = ctx->head->parent_offset + field->offset;
7212 ctx->head->field = type->fields;
7213 ctx->head->parent_offset = parent_offset;
7216 if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
7218 __Pyx_BufFmt_RaiseExpected(ctx);
7222 offset = ctx->head->parent_offset + field->offset;
7223 if (ctx->fmt_offset != offset) {
7224 PyErr_Format(PyExc_ValueError,
7225 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
7226 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
7229 ctx->fmt_offset += size;
7231 ctx->fmt_offset += (arraysize - 1) * size;
7234 if (field == &ctx->root) {
7236 if (ctx->enc_count != 0) {
7237 __Pyx_BufFmt_RaiseExpected(ctx);
7242 ctx->head->field = ++field;
7243 if (field->type == NULL) {
7245 field = ctx->head->field;
7247 } else if (field->type->typegroup == 'S') {
7248 size_t parent_offset = ctx->head->parent_offset + field->offset;
7249 if (field->type->fields->type == NULL) continue;
7250 field = field->type->fields;
7252 ctx->head->field = field;
7253 ctx->head->parent_offset = parent_offset;
7259 } while (ctx->enc_count);
7261 ctx->is_complex = 0;
7264 static CYTHON_INLINE PyObject *
7265 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
7267 const char *ts = *tsp;
7269 int ndim = ctx->head->field->type->ndim;
7272 if (ctx->new_count != 1) {
7273 PyErr_SetString(PyExc_ValueError,
7274 "Cannot handle repeated arrays in format string");
7277 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
7278 while (*ts && *ts != ')') {
7280 case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
7283 number = __Pyx_BufFmt_ExpectNumber(&ts);
7284 if (number == -1) return NULL;
7285 if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
7286 return PyErr_Format(PyExc_ValueError,
7287 "Expected a dimension of size %zu, got %d",
7288 ctx->head->field->type->arraysize[i], number);
7289 if (*ts != ',' && *ts != ')')
7290 return PyErr_Format(PyExc_ValueError,
7291 "Expected a comma in format string, got '%c'", *ts);
7292 if (*ts == ',') ts++;
7296 return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
7297 ctx->head->field->type->ndim, i);
7299 PyErr_SetString(PyExc_ValueError,
7300 "Unexpected end of format string, expected ')'");
7303 ctx->is_valid_array = 1;
7308 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
7313 if (ctx->enc_type != 0 && ctx->head == NULL) {
7314 __Pyx_BufFmt_RaiseExpected(ctx);
7317 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
7318 if (ctx->head != NULL) {
7319 __Pyx_BufFmt_RaiseExpected(ctx);
7329 if (!__Pyx_IsLittleEndian()) {
7330 PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
7333 ctx->new_packmode = '=';
7338 if (__Pyx_IsLittleEndian()) {
7339 PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
7342 ctx->new_packmode = '=';
7348 ctx->new_packmode = *ts++;
7352 const char* ts_after_sub;
7353 size_t i, struct_count = ctx->new_count;
7354 size_t struct_alignment = ctx->struct_alignment;
7358 PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
7361 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
7364 ctx->struct_alignment = 0;
7367 for (i = 0; i != struct_count; ++i) {
7368 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
7369 if (!ts_after_sub) return NULL;
7372 if (struct_alignment) ctx->struct_alignment = struct_alignment;
7377 size_t alignment = ctx->struct_alignment;
7379 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
7381 if (alignment && ctx->fmt_offset % alignment) {
7382 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
7387 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
7388 ctx->fmt_offset += ctx->new_count;
7392 ctx->enc_packmode = ctx->new_packmode;
7398 if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
7399 __Pyx_BufFmt_RaiseUnexpectedChar('Z');
7402 case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
7403 case 'l': case 'L': case 'q': case 'Q':
7404 case 'f': case 'd': case 'g':
7406 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
7407 ctx->enc_packmode == ctx->new_packmode) {
7408 ctx->enc_count += ctx->new_count;
7415 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
7416 ctx->enc_count = ctx->new_count;
7417 ctx->enc_packmode = ctx->new_packmode;
7418 ctx->enc_type = *ts;
7419 ctx->is_complex = got_Z;
7426 while(*ts != ':') ++ts;
7430 if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
7434 int number = __Pyx_BufFmt_ExpectNumber(&ts);
7435 if (number == -1) return NULL;
7436 ctx->new_count = (size_t)number;
7441 static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
7444 buf->strides = __Pyx_zeros;
7445 buf->shape = __Pyx_zeros;
7446 buf->suboffsets = __Pyx_minusones;
7448 static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
7449 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
7450 int nd, int cast, __Pyx_BufFmt_StackElem* stack)
7452 if (obj == Py_None || obj == NULL) {
7453 __Pyx_ZeroBuffer(buf);
7457 if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
7458 if (buf->ndim != nd) {
7459 PyErr_Format(PyExc_ValueError,
7460 "Buffer has wrong number of dimensions (expected %d, got %d)",
7465 __Pyx_BufFmt_Context ctx;
7466 __Pyx_BufFmt_Init(&ctx, stack, dtype);
7467 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
7469 if ((unsigned)buf->itemsize != dtype->size) {
7470 PyErr_Format(PyExc_ValueError,
7471 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
7472 buf->itemsize, (buf->itemsize > 1) ? "s" : "",
7473 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
7476 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
7479 __Pyx_ZeroBuffer(buf);
7482 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
7483 if (info->buf == NULL) return;
7484 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
7485 __Pyx_ReleaseBuffer(info);
7489 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
7490 if (unlikely(!type)) {
7491 PyErr_SetString(PyExc_SystemError, "Missing type object");
7494 if (likely(PyObject_TypeCheck(obj, type)))
7496 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
7497 Py_TYPE(obj)->tp_name, type->tp_name);
7502 #if !CYTHON_COMPILING_IN_PYPY
7503 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
7504 #if PY_MAJOR_VERSION < 3
7505 if (likely(PyInt_CheckExact(op1))) {
7506 const long b = intval;
7508 long a = PyInt_AS_LONG(op1);
7509 x = (long)((unsigned long)a + b);
7510 if (likely((x^a) >= 0 || (x^b) >= 0))
7511 return PyInt_FromLong(x);
7512 return PyLong_Type.tp_as_number->nb_add(op1, op2);
7515 #if CYTHON_USE_PYLONG_INTERNALS
7516 if (likely(PyLong_CheckExact(op1))) {
7517 const long b = intval;
7519 #ifdef HAVE_LONG_LONG
7520 const PY_LONG_LONG llb = intval;
7521 PY_LONG_LONG lla, llx;
7523 const digit* digits = ((PyLongObject*)op1)->ob_digit;
7524 const Py_ssize_t size = Py_SIZE(op1);
7525 if (likely(__Pyx_sst_abs(size) <= 1)) {
7526 a = likely(size) ? digits[0] : 0;
7527 if (size == -1) a = -a;
7531 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
7532 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7534 #ifdef HAVE_LONG_LONG
7535 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
7536 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7541 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
7542 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7544 #ifdef HAVE_LONG_LONG
7545 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
7546 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7551 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
7552 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7554 #ifdef HAVE_LONG_LONG
7555 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
7556 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7561 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
7562 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7564 #ifdef HAVE_LONG_LONG
7565 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
7566 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7571 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
7572 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7574 #ifdef HAVE_LONG_LONG
7575 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
7576 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7581 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
7582 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7584 #ifdef HAVE_LONG_LONG
7585 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
7586 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7590 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
7594 return PyLong_FromLong(x);
7595 #ifdef HAVE_LONG_LONG
7598 return PyLong_FromLongLong(llx);
7604 if (PyFloat_CheckExact(op1)) {
7605 const long b = intval;
7606 double a = PyFloat_AS_DOUBLE(op1);
7608 PyFPE_START_PROTECT("add", return NULL)
7609 result = ((double)a) + (double)b;
7610 PyFPE_END_PROTECT(result)
7611 return PyFloat_FromDouble(result);
7613 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
7617 /* PyCFunctionFastCall */
7618 #if CYTHON_FAST_PYCCALL
7619 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
7620 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
7621 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
7622 PyObject *self = PyCFunction_GET_SELF(func);
7623 assert(PyCFunction_Check(func));
7624 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
7626 assert(nargs == 0 || args != NULL);
7627 /* _PyCFunction_FastCallDict() must not be called with an exception set,
7628 because it may clear it (directly or indirectly) and so the
7629 caller loses its exception */
7630 assert(!PyErr_Occurred());
7631 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
7633 #endif // CYTHON_FAST_PYCCALL
7635 /* PyFunctionFastCall */
7636 #if CYTHON_FAST_PYCALL
7637 #include "frameobject.h"
7638 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
7639 PyObject *globals) {
7641 PyThreadState *tstate = PyThreadState_GET();
7642 PyObject **fastlocals;
7645 assert(globals != NULL);
7646 /* XXX Perhaps we should create a specialized
7647 PyFrame_New() that doesn't take locals, but does
7648 take builtins without sanity checking them.
7650 assert(tstate != NULL);
7651 f = PyFrame_New(tstate, co, globals, NULL);
7655 fastlocals = f->f_localsplus;
7656 for (i = 0; i < na; i++) {
7658 fastlocals[i] = *args++;
7660 result = PyEval_EvalFrameEx(f,0);
7661 ++tstate->recursion_depth;
7663 --tstate->recursion_depth;
7666 #if 1 || PY_VERSION_HEX < 0x030600B1
7667 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
7668 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
7669 PyObject *globals = PyFunction_GET_GLOBALS(func);
7670 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
7672 #if PY_MAJOR_VERSION >= 3
7675 PyObject *kwtuple, **k;
7680 assert(kwargs == NULL || PyDict_Check(kwargs));
7681 nk = kwargs ? PyDict_Size(kwargs) : 0;
7682 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
7686 #if PY_MAJOR_VERSION >= 3
7687 co->co_kwonlyargcount == 0 &&
7689 likely(kwargs == NULL || nk == 0) &&
7690 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
7691 if (argdefs == NULL && co->co_argcount == nargs) {
7692 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
7695 else if (nargs == 0 && argdefs != NULL
7696 && co->co_argcount == Py_SIZE(argdefs)) {
7697 /* function called with no arguments, but all parameters have
7698 a default value: use default values as arguments .*/
7699 args = &PyTuple_GET_ITEM(argdefs, 0);
7700 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
7704 if (kwargs != NULL) {
7706 kwtuple = PyTuple_New(2 * nk);
7707 if (kwtuple == NULL) {
7711 k = &PyTuple_GET_ITEM(kwtuple, 0);
7713 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
7724 closure = PyFunction_GET_CLOSURE(func);
7725 #if PY_MAJOR_VERSION >= 3
7726 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
7728 if (argdefs != NULL) {
7729 d = &PyTuple_GET_ITEM(argdefs, 0);
7730 nd = Py_SIZE(argdefs);
7736 #if PY_MAJOR_VERSION >= 3
7737 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
7740 d, (int)nd, kwdefs, closure);
7742 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
7745 d, (int)nd, closure);
7747 Py_XDECREF(kwtuple);
7749 Py_LeaveRecursiveCall();
7752 #endif // CPython < 3.6
7753 #endif // CYTHON_FAST_PYCALL
7756 #if CYTHON_COMPILING_IN_CPYTHON
7757 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
7759 ternaryfunc call = func->ob_type->tp_call;
7760 if (unlikely(!call))
7761 return PyObject_Call(func, arg, kw);
7762 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7764 result = (*call)(func, arg, kw);
7765 Py_LeaveRecursiveCall();
7766 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7769 "NULL result without error in PyObject_Call");
7775 /* PyObjectCallMethO */
7776 #if CYTHON_COMPILING_IN_CPYTHON
7777 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
7778 PyObject *self, *result;
7780 cfunc = PyCFunction_GET_FUNCTION(func);
7781 self = PyCFunction_GET_SELF(func);
7782 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7784 result = cfunc(self, arg);
7785 Py_LeaveRecursiveCall();
7786 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7789 "NULL result without error in PyObject_Call");
7795 /* PyObjectCallOneArg */
7796 #if CYTHON_COMPILING_IN_CPYTHON
7797 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7799 PyObject *args = PyTuple_New(1);
7800 if (unlikely(!args)) return NULL;
7802 PyTuple_SET_ITEM(args, 0, arg);
7803 result = __Pyx_PyObject_Call(func, args, NULL);
7807 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7808 #if CYTHON_FAST_PYCALL
7809 if (PyFunction_Check(func)) {
7810 return __Pyx_PyFunction_FastCall(func, &arg, 1);
7813 #ifdef __Pyx_CyFunction_USED
7814 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
7816 if (likely(PyCFunction_Check(func))) {
7818 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
7819 return __Pyx_PyObject_CallMethO(func, arg);
7820 #if CYTHON_FAST_PYCCALL
7821 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
7822 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
7826 return __Pyx__PyObject_CallOneArg(func, arg);
7829 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7831 PyObject *args = PyTuple_Pack(1, arg);
7832 if (unlikely(!args)) return NULL;
7833 result = __Pyx_PyObject_Call(func, args, NULL);
7839 /* PyObjectCallNoArg */
7840 #if CYTHON_COMPILING_IN_CPYTHON
7841 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
7842 #if CYTHON_FAST_PYCALL
7843 if (PyFunction_Check(func)) {
7844 return __Pyx_PyFunction_FastCall(func, NULL, 0);
7847 #ifdef __Pyx_CyFunction_USED
7848 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
7850 if (likely(PyCFunction_Check(func))) {
7852 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
7853 return __Pyx_PyObject_CallMethO(func, NULL);
7856 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
7860 /* GetModuleGlobalName */
7861 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
7863 #if !CYTHON_AVOID_BORROWED_REFS
7864 result = PyDict_GetItem(__pyx_d, name);
7865 if (likely(result)) {
7869 result = PyObject_GetItem(__pyx_d, name);
7873 result = __Pyx_GetBuiltinName(name);
7878 /* BufferIndexError */
7879 static void __Pyx_RaiseBufferIndexError(int axis) {
7880 PyErr_Format(PyExc_IndexError,
7881 "Out of bounds on buffer access (axis %d)", axis);
7884 /* PyErrFetchRestore */
7885 #if CYTHON_FAST_THREAD_STATE
7886 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7887 PyObject *tmp_type, *tmp_value, *tmp_tb;
7888 tmp_type = tstate->curexc_type;
7889 tmp_value = tstate->curexc_value;
7890 tmp_tb = tstate->curexc_traceback;
7891 tstate->curexc_type = type;
7892 tstate->curexc_value = value;
7893 tstate->curexc_traceback = tb;
7894 Py_XDECREF(tmp_type);
7895 Py_XDECREF(tmp_value);
7898 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7899 *type = tstate->curexc_type;
7900 *value = tstate->curexc_value;
7901 *tb = tstate->curexc_traceback;
7902 tstate->curexc_type = 0;
7903 tstate->curexc_value = 0;
7904 tstate->curexc_traceback = 0;
7908 /* RaiseException */
7909 #if PY_MAJOR_VERSION < 3
7910 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
7911 CYTHON_UNUSED PyObject *cause) {
7912 __Pyx_PyThreadState_declare
7914 if (!value || value == Py_None)
7918 if (!tb || tb == Py_None)
7922 if (!PyTraceBack_Check(tb)) {
7923 PyErr_SetString(PyExc_TypeError,
7924 "raise: arg 3 must be a traceback or None");
7928 if (PyType_Check(type)) {
7929 #if CYTHON_COMPILING_IN_PYPY
7935 PyErr_NormalizeException(&type, &value, &tb);
7938 PyErr_SetString(PyExc_TypeError,
7939 "instance exception may not have a separate value");
7943 type = (PyObject*) Py_TYPE(type);
7945 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
7946 PyErr_SetString(PyExc_TypeError,
7947 "raise: exception class must be a subclass of BaseException");
7951 __Pyx_PyThreadState_assign
7952 __Pyx_ErrRestore(type, value, tb);
7961 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
7962 PyObject* owned_instance = NULL;
7963 if (tb == Py_None) {
7965 } else if (tb && !PyTraceBack_Check(tb)) {
7966 PyErr_SetString(PyExc_TypeError,
7967 "raise: arg 3 must be a traceback or None");
7970 if (value == Py_None)
7972 if (PyExceptionInstance_Check(type)) {
7974 PyErr_SetString(PyExc_TypeError,
7975 "instance exception may not have a separate value");
7979 type = (PyObject*) Py_TYPE(value);
7980 } else if (PyExceptionClass_Check(type)) {
7981 PyObject *instance_class = NULL;
7982 if (value && PyExceptionInstance_Check(value)) {
7983 instance_class = (PyObject*) Py_TYPE(value);
7984 if (instance_class != type) {
7985 int is_subclass = PyObject_IsSubclass(instance_class, type);
7987 instance_class = NULL;
7988 } else if (unlikely(is_subclass == -1)) {
7991 type = instance_class;
7995 if (!instance_class) {
7998 args = PyTuple_New(0);
7999 else if (PyTuple_Check(value)) {
8003 args = PyTuple_Pack(1, value);
8006 owned_instance = PyObject_Call(type, args, NULL);
8008 if (!owned_instance)
8010 value = owned_instance;
8011 if (!PyExceptionInstance_Check(value)) {
8012 PyErr_Format(PyExc_TypeError,
8013 "calling %R should have returned an instance of "
8014 "BaseException, not %R",
8015 type, Py_TYPE(value));
8020 PyErr_SetString(PyExc_TypeError,
8021 "raise: exception class must be a subclass of BaseException");
8024 #if PY_VERSION_HEX >= 0x03030000
8027 if (cause && cause != Py_None) {
8029 PyObject *fixed_cause;
8030 if (cause == Py_None) {
8032 } else if (PyExceptionClass_Check(cause)) {
8033 fixed_cause = PyObject_CallObject(cause, NULL);
8034 if (fixed_cause == NULL)
8036 } else if (PyExceptionInstance_Check(cause)) {
8037 fixed_cause = cause;
8038 Py_INCREF(fixed_cause);
8040 PyErr_SetString(PyExc_TypeError,
8041 "exception causes must derive from "
8045 PyException_SetCause(value, fixed_cause);
8047 PyErr_SetObject(type, value);
8049 #if CYTHON_COMPILING_IN_PYPY
8050 PyObject *tmp_type, *tmp_value, *tmp_tb;
8051 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
8053 PyErr_Restore(tmp_type, tmp_value, tb);
8056 PyThreadState *tstate = PyThreadState_GET();
8057 PyObject* tmp_tb = tstate->curexc_traceback;
8060 tstate->curexc_traceback = tb;
8066 Py_XDECREF(owned_instance);
8071 /* RaiseTooManyValuesToUnpack */
8072 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
8073 PyErr_Format(PyExc_ValueError,
8074 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
8077 /* RaiseNeedMoreValuesToUnpack */
8078 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
8079 PyErr_Format(PyExc_ValueError,
8080 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
8081 index, (index == 1) ? "" : "s");
8084 /* RaiseNoneIterError */
8085 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
8086 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
8089 /* SaveResetException */
8090 #if CYTHON_FAST_THREAD_STATE
8091 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8092 *type = tstate->exc_type;
8093 *value = tstate->exc_value;
8094 *tb = tstate->exc_traceback;
8099 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8100 PyObject *tmp_type, *tmp_value, *tmp_tb;
8101 tmp_type = tstate->exc_type;
8102 tmp_value = tstate->exc_value;
8103 tmp_tb = tstate->exc_traceback;
8104 tstate->exc_type = type;
8105 tstate->exc_value = value;
8106 tstate->exc_traceback = tb;
8107 Py_XDECREF(tmp_type);
8108 Py_XDECREF(tmp_value);
8113 /* PyErrExceptionMatches */
8114 #if CYTHON_FAST_THREAD_STATE
8115 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8116 PyObject *exc_type = tstate->curexc_type;
8117 if (exc_type == err) return 1;
8118 if (unlikely(!exc_type)) return 0;
8119 return PyErr_GivenExceptionMatches(exc_type, err);
8124 #if CYTHON_FAST_THREAD_STATE
8125 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8127 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
8129 PyObject *local_type, *local_value, *local_tb;
8130 #if CYTHON_FAST_THREAD_STATE
8131 PyObject *tmp_type, *tmp_value, *tmp_tb;
8132 local_type = tstate->curexc_type;
8133 local_value = tstate->curexc_value;
8134 local_tb = tstate->curexc_traceback;
8135 tstate->curexc_type = 0;
8136 tstate->curexc_value = 0;
8137 tstate->curexc_traceback = 0;
8139 PyErr_Fetch(&local_type, &local_value, &local_tb);
8141 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
8142 #if CYTHON_FAST_THREAD_STATE
8143 if (unlikely(tstate->curexc_type))
8145 if (unlikely(PyErr_Occurred()))
8148 #if PY_MAJOR_VERSION >= 3
8150 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
8154 Py_XINCREF(local_tb);
8155 Py_XINCREF(local_type);
8156 Py_XINCREF(local_value);
8158 *value = local_value;
8160 #if CYTHON_FAST_THREAD_STATE
8161 tmp_type = tstate->exc_type;
8162 tmp_value = tstate->exc_value;
8163 tmp_tb = tstate->exc_traceback;
8164 tstate->exc_type = local_type;
8165 tstate->exc_value = local_value;
8166 tstate->exc_traceback = local_tb;
8167 Py_XDECREF(tmp_type);
8168 Py_XDECREF(tmp_value);
8171 PyErr_SetExcInfo(local_type, local_value, local_tb);
8178 Py_XDECREF(local_type);
8179 Py_XDECREF(local_value);
8180 Py_XDECREF(local_tb);
8185 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
8186 PyObject *empty_list = 0;
8187 PyObject *module = 0;
8188 PyObject *global_dict = 0;
8189 PyObject *empty_dict = 0;
8191 #if PY_VERSION_HEX < 0x03030000
8192 PyObject *py_import;
8193 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
8200 empty_list = PyList_New(0);
8205 global_dict = PyModule_GetDict(__pyx_m);
8208 empty_dict = PyDict_New();
8212 #if PY_MAJOR_VERSION >= 3
8214 if (strchr(__Pyx_MODULE_NAME, '.')) {
8215 #if PY_VERSION_HEX < 0x03030000
8216 PyObject *py_level = PyInt_FromLong(1);
8219 module = PyObject_CallFunctionObjArgs(py_import,
8220 name, global_dict, empty_dict, list, py_level, NULL);
8221 Py_DECREF(py_level);
8223 module = PyImport_ImportModuleLevelObject(
8224 name, global_dict, empty_dict, list, 1);
8227 if (!PyErr_ExceptionMatches(PyExc_ImportError))
8236 #if PY_VERSION_HEX < 0x03030000
8237 PyObject *py_level = PyInt_FromLong(level);
8240 module = PyObject_CallFunctionObjArgs(py_import,
8241 name, global_dict, empty_dict, list, py_level, NULL);
8242 Py_DECREF(py_level);
8244 module = PyImport_ImportModuleLevelObject(
8245 name, global_dict, empty_dict, list, level);
8250 #if PY_VERSION_HEX < 0x03030000
8251 Py_XDECREF(py_import);
8253 Py_XDECREF(empty_list);
8254 Py_XDECREF(empty_dict);
8258 /* CodeObjectCache */
8259 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
8260 int start = 0, mid = 0, end = count - 1;
8261 if (end >= 0 && code_line > entries[end].code_line) {
8264 while (start < end) {
8265 mid = start + (end - start) / 2;
8266 if (code_line < entries[mid].code_line) {
8268 } else if (code_line > entries[mid].code_line) {
8274 if (code_line <= entries[mid].code_line) {
8280 static PyCodeObject *__pyx_find_code_object(int code_line) {
8281 PyCodeObject* code_object;
8283 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
8286 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8287 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
8290 code_object = __pyx_code_cache.entries[pos].code_object;
8291 Py_INCREF(code_object);
8294 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
8296 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
8297 if (unlikely(!code_line)) {
8300 if (unlikely(!entries)) {
8301 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
8302 if (likely(entries)) {
8303 __pyx_code_cache.entries = entries;
8304 __pyx_code_cache.max_count = 64;
8305 __pyx_code_cache.count = 1;
8306 entries[0].code_line = code_line;
8307 entries[0].code_object = code_object;
8308 Py_INCREF(code_object);
8312 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8313 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
8314 PyCodeObject* tmp = entries[pos].code_object;
8315 entries[pos].code_object = code_object;
8319 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
8320 int new_max = __pyx_code_cache.max_count + 64;
8321 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
8322 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
8323 if (unlikely(!entries)) {
8326 __pyx_code_cache.entries = entries;
8327 __pyx_code_cache.max_count = new_max;
8329 for (i=__pyx_code_cache.count; i>pos; i--) {
8330 entries[i] = entries[i-1];
8332 entries[pos].code_line = code_line;
8333 entries[pos].code_object = code_object;
8334 __pyx_code_cache.count++;
8335 Py_INCREF(code_object);
8339 #include "compile.h"
8340 #include "frameobject.h"
8341 #include "traceback.h"
8342 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
8343 const char *funcname, int c_line,
8344 int py_line, const char *filename) {
8345 PyCodeObject *py_code = 0;
8346 PyObject *py_srcfile = 0;
8347 PyObject *py_funcname = 0;
8348 #if PY_MAJOR_VERSION < 3
8349 py_srcfile = PyString_FromString(filename);
8351 py_srcfile = PyUnicode_FromString(filename);
8353 if (!py_srcfile) goto bad;
8355 #if PY_MAJOR_VERSION < 3
8356 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8358 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8362 #if PY_MAJOR_VERSION < 3
8363 py_funcname = PyString_FromString(funcname);
8365 py_funcname = PyUnicode_FromString(funcname);
8368 if (!py_funcname) goto bad;
8369 py_code = __Pyx_PyCode_New(
8375 __pyx_empty_bytes, /*PyObject *code,*/
8376 __pyx_empty_tuple, /*PyObject *consts,*/
8377 __pyx_empty_tuple, /*PyObject *names,*/
8378 __pyx_empty_tuple, /*PyObject *varnames,*/
8379 __pyx_empty_tuple, /*PyObject *freevars,*/
8380 __pyx_empty_tuple, /*PyObject *cellvars,*/
8381 py_srcfile, /*PyObject *filename,*/
8382 py_funcname, /*PyObject *name,*/
8384 __pyx_empty_bytes /*PyObject *lnotab*/
8386 Py_DECREF(py_srcfile);
8387 Py_DECREF(py_funcname);
8390 Py_XDECREF(py_srcfile);
8391 Py_XDECREF(py_funcname);
8394 static void __Pyx_AddTraceback(const char *funcname, int c_line,
8395 int py_line, const char *filename) {
8396 PyCodeObject *py_code = 0;
8397 PyFrameObject *py_frame = 0;
8398 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
8400 py_code = __Pyx_CreateCodeObjectForTraceback(
8401 funcname, c_line, py_line, filename);
8402 if (!py_code) goto bad;
8403 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
8405 py_frame = PyFrame_New(
8406 PyThreadState_GET(), /*PyThreadState *tstate,*/
8407 py_code, /*PyCodeObject *code,*/
8408 __pyx_d, /*PyObject *globals,*/
8409 0 /*PyObject *locals*/
8411 if (!py_frame) goto bad;
8412 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
8413 PyTraceBack_Here(py_frame);
8415 Py_XDECREF(py_code);
8416 Py_XDECREF(py_frame);
8419 #if PY_MAJOR_VERSION < 3
8420 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
8421 if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
8422 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
8423 PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
8426 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
8427 PyObject *obj = view->obj;
8429 if (PyObject_CheckBuffer(obj)) {
8430 PyBuffer_Release(view);
8433 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
8441 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
8442 const int neg_one = (int) -1, const_zero = (int) 0;
8443 const int is_unsigned = neg_one > const_zero;
8445 if (sizeof(int) < sizeof(long)) {
8446 return PyInt_FromLong((long) value);
8447 } else if (sizeof(int) <= sizeof(unsigned long)) {
8448 return PyLong_FromUnsignedLong((unsigned long) value);
8449 #ifdef HAVE_LONG_LONG
8450 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
8451 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8455 if (sizeof(int) <= sizeof(long)) {
8456 return PyInt_FromLong((long) value);
8457 #ifdef HAVE_LONG_LONG
8458 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
8459 return PyLong_FromLongLong((PY_LONG_LONG) value);
8464 int one = 1; int little = (int)*(unsigned char *)&one;
8465 unsigned char *bytes = (unsigned char *)&value;
8466 return _PyLong_FromByteArray(bytes, sizeof(int),
8467 little, !is_unsigned);
8471 /* CIntFromPyVerify */
8472 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
8473 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
8474 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
8475 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
8476 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
8478 func_type value = func_value;\
8479 if (sizeof(target_type) < sizeof(func_type)) {\
8480 if (unlikely(value != (func_type) (target_type) value)) {\
8481 func_type zero = 0;\
8482 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
8483 return (target_type) -1;\
8484 if (is_unsigned && unlikely(value < zero))\
8485 goto raise_neg_overflow;\
8487 goto raise_overflow;\
8490 return (target_type) value;\
8494 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
8495 const long neg_one = (long) -1, const_zero = (long) 0;
8496 const int is_unsigned = neg_one > const_zero;
8498 if (sizeof(long) < sizeof(long)) {
8499 return PyInt_FromLong((long) value);
8500 } else if (sizeof(long) <= sizeof(unsigned long)) {
8501 return PyLong_FromUnsignedLong((unsigned long) value);
8502 #ifdef HAVE_LONG_LONG
8503 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
8504 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8508 if (sizeof(long) <= sizeof(long)) {
8509 return PyInt_FromLong((long) value);
8510 #ifdef HAVE_LONG_LONG
8511 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
8512 return PyLong_FromLongLong((PY_LONG_LONG) value);
8517 int one = 1; int little = (int)*(unsigned char *)&one;
8518 unsigned char *bytes = (unsigned char *)&value;
8519 return _PyLong_FromByteArray(bytes, sizeof(long),
8520 little, !is_unsigned);
8527 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
8528 return ::std::complex< float >(x, y);
8531 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
8532 return x + y*(__pyx_t_float_complex)_Complex_I;
8536 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
8537 __pyx_t_float_complex z;
8547 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8548 return (a.real == b.real) && (a.imag == b.imag);
8550 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8551 __pyx_t_float_complex z;
8552 z.real = a.real + b.real;
8553 z.imag = a.imag + b.imag;
8556 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8557 __pyx_t_float_complex z;
8558 z.real = a.real - b.real;
8559 z.imag = a.imag - b.imag;
8562 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8563 __pyx_t_float_complex z;
8564 z.real = a.real * b.real - a.imag * b.imag;
8565 z.imag = a.real * b.imag + a.imag * b.real;
8569 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8571 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
8572 } else if (fabsf(b.real) >= fabsf(b.imag)) {
8573 if (b.real == 0 && b.imag == 0) {
8574 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
8576 float r = b.imag / b.real;
8577 float s = 1.0 / (b.real + b.imag * r);
8578 return __pyx_t_float_complex_from_parts(
8579 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
8582 float r = b.real / b.imag;
8583 float s = 1.0 / (b.imag + b.real * r);
8584 return __pyx_t_float_complex_from_parts(
8585 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
8589 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8591 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
8593 float denom = b.real * b.real + b.imag * b.imag;
8594 return __pyx_t_float_complex_from_parts(
8595 (a.real * b.real + a.imag * b.imag) / denom,
8596 (a.imag * b.real - a.real * b.imag) / denom);
8600 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
8601 __pyx_t_float_complex z;
8606 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
8607 return (a.real == 0) && (a.imag == 0);
8609 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
8610 __pyx_t_float_complex z;
8616 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
8617 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
8618 return sqrtf(z.real*z.real + z.imag*z.imag);
8620 return hypotf(z.real, z.imag);
8623 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8624 __pyx_t_float_complex z;
8625 float r, lnr, theta, z_r, z_theta;
8626 if (b.imag == 0 && b.real == (int)b.real) {
8628 float denom = a.real * a.real + a.imag * a.imag;
8629 a.real = a.real / denom;
8630 a.imag = -a.imag / denom;
8633 switch ((int)b.real) {
8641 z = __Pyx_c_prod_float(a, a);
8642 return __Pyx_c_prod_float(a, a);
8644 z = __Pyx_c_prod_float(a, a);
8645 return __Pyx_c_prod_float(z, a);
8647 z = __Pyx_c_prod_float(a, a);
8648 return __Pyx_c_prod_float(z, z);
8654 } else if (b.imag == 0) {
8655 z.real = powf(a.real, b.real);
8658 } else if (a.real > 0) {
8663 theta = atan2f(0, -1);
8666 r = __Pyx_c_abs_float(a);
8667 theta = atan2f(a.imag, a.real);
8670 z_r = expf(lnr * b.real - theta * b.imag);
8671 z_theta = theta * b.real + lnr * b.imag;
8672 z.real = z_r * cosf(z_theta);
8673 z.imag = z_r * sinf(z_theta);
8682 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
8683 return ::std::complex< double >(x, y);
8686 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
8687 return x + y*(__pyx_t_double_complex)_Complex_I;
8691 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
8692 __pyx_t_double_complex z;
8702 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
8703 return (a.real == b.real) && (a.imag == b.imag);
8705 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
8706 __pyx_t_double_complex z;
8707 z.real = a.real + b.real;
8708 z.imag = a.imag + b.imag;
8711 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
8712 __pyx_t_double_complex z;
8713 z.real = a.real - b.real;
8714 z.imag = a.imag - b.imag;
8717 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
8718 __pyx_t_double_complex z;
8719 z.real = a.real * b.real - a.imag * b.imag;
8720 z.imag = a.real * b.imag + a.imag * b.real;
8724 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
8726 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
8727 } else if (fabs(b.real) >= fabs(b.imag)) {
8728 if (b.real == 0 && b.imag == 0) {
8729 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
8731 double r = b.imag / b.real;
8732 double s = 1.0 / (b.real + b.imag * r);
8733 return __pyx_t_double_complex_from_parts(
8734 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
8737 double r = b.real / b.imag;
8738 double s = 1.0 / (b.imag + b.real * r);
8739 return __pyx_t_double_complex_from_parts(
8740 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
8744 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
8746 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
8748 double denom = b.real * b.real + b.imag * b.imag;
8749 return __pyx_t_double_complex_from_parts(
8750 (a.real * b.real + a.imag * b.imag) / denom,
8751 (a.imag * b.real - a.real * b.imag) / denom);
8755 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
8756 __pyx_t_double_complex z;
8761 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
8762 return (a.real == 0) && (a.imag == 0);
8764 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
8765 __pyx_t_double_complex z;
8771 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
8772 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
8773 return sqrt(z.real*z.real + z.imag*z.imag);
8775 return hypot(z.real, z.imag);
8778 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
8779 __pyx_t_double_complex z;
8780 double r, lnr, theta, z_r, z_theta;
8781 if (b.imag == 0 && b.real == (int)b.real) {
8783 double denom = a.real * a.real + a.imag * a.imag;
8784 a.real = a.real / denom;
8785 a.imag = -a.imag / denom;
8788 switch ((int)b.real) {
8796 z = __Pyx_c_prod_double(a, a);
8797 return __Pyx_c_prod_double(a, a);
8799 z = __Pyx_c_prod_double(a, a);
8800 return __Pyx_c_prod_double(z, a);
8802 z = __Pyx_c_prod_double(a, a);
8803 return __Pyx_c_prod_double(z, z);
8809 } else if (b.imag == 0) {
8810 z.real = pow(a.real, b.real);
8813 } else if (a.real > 0) {
8818 theta = atan2(0, -1);
8821 r = __Pyx_c_abs_double(a);
8822 theta = atan2(a.imag, a.real);
8825 z_r = exp(lnr * b.real - theta * b.imag);
8826 z_theta = theta * b.real + lnr * b.imag;
8827 z.real = z_r * cos(z_theta);
8828 z.imag = z_r * sin(z_theta);
8835 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
8836 const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
8837 const int is_unsigned = neg_one > const_zero;
8839 if (sizeof(enum NPY_TYPES) < sizeof(long)) {
8840 return PyInt_FromLong((long) value);
8841 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
8842 return PyLong_FromUnsignedLong((unsigned long) value);
8843 #ifdef HAVE_LONG_LONG
8844 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
8845 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8849 if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
8850 return PyInt_FromLong((long) value);
8851 #ifdef HAVE_LONG_LONG
8852 } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
8853 return PyLong_FromLongLong((PY_LONG_LONG) value);
8858 int one = 1; int little = (int)*(unsigned char *)&one;
8859 unsigned char *bytes = (unsigned char *)&value;
8860 return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
8861 little, !is_unsigned);
8866 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
8867 const int neg_one = (int) -1, const_zero = (int) 0;
8868 const int is_unsigned = neg_one > const_zero;
8869 #if PY_MAJOR_VERSION < 3
8870 if (likely(PyInt_Check(x))) {
8871 if (sizeof(int) < sizeof(long)) {
8872 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
8874 long val = PyInt_AS_LONG(x);
8875 if (is_unsigned && unlikely(val < 0)) {
8876 goto raise_neg_overflow;
8882 if (likely(PyLong_Check(x))) {
8884 #if CYTHON_USE_PYLONG_INTERNALS
8885 const digit* digits = ((PyLongObject*)x)->ob_digit;
8886 switch (Py_SIZE(x)) {
8887 case 0: return (int) 0;
8888 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
8890 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
8891 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8892 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8893 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
8894 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
8899 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
8900 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8901 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8902 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
8903 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
8908 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
8909 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8910 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8911 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
8912 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
8918 #if CYTHON_COMPILING_IN_CPYTHON
8919 if (unlikely(Py_SIZE(x) < 0)) {
8920 goto raise_neg_overflow;
8924 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
8925 if (unlikely(result < 0))
8927 if (unlikely(result == 1))
8928 goto raise_neg_overflow;
8931 if (sizeof(int) <= sizeof(unsigned long)) {
8932 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
8933 #ifdef HAVE_LONG_LONG
8934 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
8935 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
8939 #if CYTHON_USE_PYLONG_INTERNALS
8940 const digit* digits = ((PyLongObject*)x)->ob_digit;
8941 switch (Py_SIZE(x)) {
8942 case 0: return (int) 0;
8943 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
8944 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
8946 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
8947 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8948 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8949 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
8950 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8955 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
8956 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8957 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8958 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
8959 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8964 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
8965 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8966 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8967 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
8968 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8973 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
8974 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8975 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8976 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
8977 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8982 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
8983 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8984 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8985 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
8986 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8991 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
8992 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8993 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8994 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
8995 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9001 if (sizeof(int) <= sizeof(long)) {
9002 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
9003 #ifdef HAVE_LONG_LONG
9004 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
9005 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
9010 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9011 PyErr_SetString(PyExc_RuntimeError,
9012 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9015 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9016 #if PY_MAJOR_VERSION < 3
9017 if (likely(v) && !PyLong_Check(v)) {
9019 v = PyNumber_Long(tmp);
9024 int one = 1; int is_little = (int)*(unsigned char *)&one;
9025 unsigned char *bytes = (unsigned char *)&val;
9026 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9028 is_little, !is_unsigned);
9038 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9039 if (!tmp) return (int) -1;
9040 val = __Pyx_PyInt_As_int(tmp);
9045 PyErr_SetString(PyExc_OverflowError,
9046 "value too large to convert to int");
9049 PyErr_SetString(PyExc_OverflowError,
9050 "can't convert negative value to int");
9055 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
9056 const long neg_one = (long) -1, const_zero = (long) 0;
9057 const int is_unsigned = neg_one > const_zero;
9058 #if PY_MAJOR_VERSION < 3
9059 if (likely(PyInt_Check(x))) {
9060 if (sizeof(long) < sizeof(long)) {
9061 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
9063 long val = PyInt_AS_LONG(x);
9064 if (is_unsigned && unlikely(val < 0)) {
9065 goto raise_neg_overflow;
9071 if (likely(PyLong_Check(x))) {
9073 #if CYTHON_USE_PYLONG_INTERNALS
9074 const digit* digits = ((PyLongObject*)x)->ob_digit;
9075 switch (Py_SIZE(x)) {
9076 case 0: return (long) 0;
9077 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
9079 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9080 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9081 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9082 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
9083 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9088 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9089 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9090 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9091 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
9092 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9097 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9098 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9099 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9100 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
9101 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9107 #if CYTHON_COMPILING_IN_CPYTHON
9108 if (unlikely(Py_SIZE(x) < 0)) {
9109 goto raise_neg_overflow;
9113 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
9114 if (unlikely(result < 0))
9116 if (unlikely(result == 1))
9117 goto raise_neg_overflow;
9120 if (sizeof(long) <= sizeof(unsigned long)) {
9121 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
9122 #ifdef HAVE_LONG_LONG
9123 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
9124 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9128 #if CYTHON_USE_PYLONG_INTERNALS
9129 const digit* digits = ((PyLongObject*)x)->ob_digit;
9130 switch (Py_SIZE(x)) {
9131 case 0: return (long) 0;
9132 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
9133 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
9135 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
9136 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9137 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9138 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9139 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9144 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9145 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9146 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9147 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9148 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9153 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9154 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9155 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9156 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9157 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9162 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9163 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9164 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9165 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9166 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9171 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9172 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9173 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9174 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9175 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9180 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9181 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9182 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9183 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9184 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9190 if (sizeof(long) <= sizeof(long)) {
9191 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
9192 #ifdef HAVE_LONG_LONG
9193 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
9194 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
9199 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9200 PyErr_SetString(PyExc_RuntimeError,
9201 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9204 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9205 #if PY_MAJOR_VERSION < 3
9206 if (likely(v) && !PyLong_Check(v)) {
9208 v = PyNumber_Long(tmp);
9213 int one = 1; int is_little = (int)*(unsigned char *)&one;
9214 unsigned char *bytes = (unsigned char *)&val;
9215 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9217 is_little, !is_unsigned);
9227 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9228 if (!tmp) return (long) -1;
9229 val = __Pyx_PyInt_As_long(tmp);
9234 PyErr_SetString(PyExc_OverflowError,
9235 "value too large to convert to long");
9238 PyErr_SetString(PyExc_OverflowError,
9239 "can't convert negative value to long");
9243 /* CheckBinaryVersion */
9244 static int __Pyx_check_binary_version(void) {
9245 char ctversion[4], rtversion[4];
9246 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
9247 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
9248 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
9250 PyOS_snprintf(message, sizeof(message),
9251 "compiletime version %s of module '%.100s' "
9252 "does not match runtime version %s",
9253 ctversion, __Pyx_MODULE_NAME, rtversion);
9254 return PyErr_WarnEx(NULL, message, 1);
9260 #ifndef __PYX_HAVE_RT_ImportModule
9261 #define __PYX_HAVE_RT_ImportModule
9262 static PyObject *__Pyx_ImportModule(const char *name) {
9263 PyObject *py_name = 0;
9264 PyObject *py_module = 0;
9265 py_name = __Pyx_PyIdentifier_FromString(name);
9268 py_module = PyImport_Import(py_name);
9272 Py_XDECREF(py_name);
9278 #ifndef __PYX_HAVE_RT_ImportType
9279 #define __PYX_HAVE_RT_ImportType
9280 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
9281 size_t size, int strict)
9283 PyObject *py_module = 0;
9284 PyObject *result = 0;
9285 PyObject *py_name = 0;
9287 Py_ssize_t basicsize;
9288 #ifdef Py_LIMITED_API
9289 PyObject *py_basicsize;
9291 py_module = __Pyx_ImportModule(module_name);
9294 py_name = __Pyx_PyIdentifier_FromString(class_name);
9297 result = PyObject_GetAttr(py_module, py_name);
9300 Py_DECREF(py_module);
9304 if (!PyType_Check(result)) {
9305 PyErr_Format(PyExc_TypeError,
9306 "%.200s.%.200s is not a type object",
9307 module_name, class_name);
9310 #ifndef Py_LIMITED_API
9311 basicsize = ((PyTypeObject *)result)->tp_basicsize;
9313 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
9316 basicsize = PyLong_AsSsize_t(py_basicsize);
9317 Py_DECREF(py_basicsize);
9319 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
9322 if (!strict && (size_t)basicsize > size) {
9323 PyOS_snprintf(warning, sizeof(warning),
9324 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
9325 module_name, class_name, basicsize, size);
9326 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
9328 else if ((size_t)basicsize != size) {
9329 PyErr_Format(PyExc_ValueError,
9330 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
9331 module_name, class_name, basicsize, size);
9334 return (PyTypeObject *)result;
9336 Py_XDECREF(py_module);
9343 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
9345 #if PY_MAJOR_VERSION < 3
9346 if (t->is_unicode) {
9347 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
9348 } else if (t->intern) {
9349 *t->p = PyString_InternFromString(t->s);
9351 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
9354 if (t->is_unicode | t->is_str) {
9356 *t->p = PyUnicode_InternFromString(t->s);
9357 } else if (t->encoding) {
9358 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
9360 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
9363 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
9373 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
9374 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
9376 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
9378 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
9380 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9381 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
9383 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9384 __Pyx_sys_getdefaultencoding_not_ascii &&
9386 PyUnicode_Check(o)) {
9387 #if PY_VERSION_HEX < 0x03030000
9389 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
9390 if (!defenc) return NULL;
9391 defenc_c = PyBytes_AS_STRING(defenc);
9392 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9394 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
9396 for (c = defenc_c; c < end; c++) {
9397 if ((unsigned char) (*c) >= 128) {
9398 PyUnicode_AsASCIIString(o);
9404 *length = PyBytes_GET_SIZE(defenc);
9407 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
9408 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9409 if (PyUnicode_IS_ASCII(o)) {
9410 *length = PyUnicode_GET_LENGTH(o);
9411 return PyUnicode_AsUTF8(o);
9413 PyUnicode_AsASCIIString(o);
9417 return PyUnicode_AsUTF8AndSize(o, length);
9422 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
9423 if (PyByteArray_Check(o)) {
9424 *length = PyByteArray_GET_SIZE(o);
9425 return PyByteArray_AS_STRING(o);
9430 int r = PyBytes_AsStringAndSize(o, &result, length);
9431 if (unlikely(r < 0)) {
9438 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
9439 int is_true = x == Py_True;
9440 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
9441 else return PyObject_IsTrue(x);
9443 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
9444 #if CYTHON_USE_TYPE_SLOTS
9447 const char *name = NULL;
9448 PyObject *res = NULL;
9449 #if PY_MAJOR_VERSION < 3
9450 if (PyInt_Check(x) || PyLong_Check(x))
9452 if (PyLong_Check(x))
9454 return __Pyx_NewRef(x);
9455 #if CYTHON_USE_TYPE_SLOTS
9456 m = Py_TYPE(x)->tp_as_number;
9457 #if PY_MAJOR_VERSION < 3
9458 if (m && m->nb_int) {
9460 res = PyNumber_Int(x);
9462 else if (m && m->nb_long) {
9464 res = PyNumber_Long(x);
9467 if (m && m->nb_int) {
9469 res = PyNumber_Long(x);
9473 res = PyNumber_Int(x);
9476 #if PY_MAJOR_VERSION < 3
9477 if (!PyInt_Check(res) && !PyLong_Check(res)) {
9479 if (!PyLong_Check(res)) {
9481 PyErr_Format(PyExc_TypeError,
9482 "__%.4s__ returned non-%.4s (type %.200s)",
9483 name, name, Py_TYPE(res)->tp_name);
9488 else if (!PyErr_Occurred()) {
9489 PyErr_SetString(PyExc_TypeError,
9490 "an integer is required");
9494 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
9497 #if PY_MAJOR_VERSION < 3
9498 if (likely(PyInt_CheckExact(b))) {
9499 if (sizeof(Py_ssize_t) >= sizeof(long))
9500 return PyInt_AS_LONG(b);
9502 return PyInt_AsSsize_t(x);
9505 if (likely(PyLong_CheckExact(b))) {
9506 #if CYTHON_USE_PYLONG_INTERNALS
9507 const digit* digits = ((PyLongObject*)b)->ob_digit;
9508 const Py_ssize_t size = Py_SIZE(b);
9509 if (likely(__Pyx_sst_abs(size) <= 1)) {
9510 ival = likely(size) ? digits[0] : 0;
9511 if (size == -1) ival = -ival;
9516 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
9517 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9521 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
9522 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9526 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
9527 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9531 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
9532 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9536 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
9537 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9541 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
9542 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9548 return PyLong_AsSsize_t(b);
9550 x = PyNumber_Index(b);
9552 ival = PyInt_AsSsize_t(x);
9556 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
9557 return PyInt_FromSize_t(ival);
9561 #endif /* Py_PYTHON_H */