1 /* Generated by Cython 0.29.12 */
2
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
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 < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_12"
11 #define CYTHON_HEX_VERSION 0x001D0CF0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18 #ifndef __stdcall
19 #define __stdcall
20 #endif
21 #ifndef __cdecl
22 #define __cdecl
23 #endif
24 #ifndef __fastcall
25 #define __fastcall
26 #endif
27 #endif
28 #ifndef DL_IMPORT
29 #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32 #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36 #if PY_VERSION_HEX >= 0x02070000
37 #define HAVE_LONG_LONG
38 #endif
39 #endif
40 #ifndef PY_LONG_LONG
41 #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44 #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47 #define CYTHON_COMPILING_IN_PYPY 1
48 #define CYTHON_COMPILING_IN_PYSTON 0
49 #define CYTHON_COMPILING_IN_CPYTHON 0
50 #undef CYTHON_USE_TYPE_SLOTS
51 #define CYTHON_USE_TYPE_SLOTS 0
52 #undef CYTHON_USE_PYTYPE_LOOKUP
53 #define CYTHON_USE_PYTYPE_LOOKUP 0
54 #if PY_VERSION_HEX < 0x03050000
55 #undef CYTHON_USE_ASYNC_SLOTS
56 #define CYTHON_USE_ASYNC_SLOTS 0
57 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58 #define CYTHON_USE_ASYNC_SLOTS 1
59 #endif
60 #undef CYTHON_USE_PYLIST_INTERNALS
61 #define CYTHON_USE_PYLIST_INTERNALS 0
62 #undef CYTHON_USE_UNICODE_INTERNALS
63 #define CYTHON_USE_UNICODE_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_WRITER
65 #define CYTHON_USE_UNICODE_WRITER 0
66 #undef CYTHON_USE_PYLONG_INTERNALS
67 #define CYTHON_USE_PYLONG_INTERNALS 0
68 #undef CYTHON_AVOID_BORROWED_REFS
69 #define CYTHON_AVOID_BORROWED_REFS 1
70 #undef CYTHON_ASSUME_SAFE_MACROS
71 #define CYTHON_ASSUME_SAFE_MACROS 0
72 #undef CYTHON_UNPACK_METHODS
73 #define CYTHON_UNPACK_METHODS 0
74 #undef CYTHON_FAST_THREAD_STATE
75 #define CYTHON_FAST_THREAD_STATE 0
76 #undef CYTHON_FAST_PYCALL
77 #define CYTHON_FAST_PYCALL 0
78 #undef CYTHON_PEP489_MULTI_PHASE_INIT
79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80 #undef CYTHON_USE_TP_FINALIZE
81 #define CYTHON_USE_TP_FINALIZE 0
82 #undef CYTHON_USE_DICT_VERSIONS
83 #define CYTHON_USE_DICT_VERSIONS 0
84 #undef CYTHON_USE_EXC_INFO_STACK
85 #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87 #define CYTHON_COMPILING_IN_PYPY 0
88 #define CYTHON_COMPILING_IN_PYSTON 1
89 #define CYTHON_COMPILING_IN_CPYTHON 0
90 #ifndef CYTHON_USE_TYPE_SLOTS
91 #define CYTHON_USE_TYPE_SLOTS 1
92 #endif
93 #undef CYTHON_USE_PYTYPE_LOOKUP
94 #define CYTHON_USE_PYTYPE_LOOKUP 0
95 #undef CYTHON_USE_ASYNC_SLOTS
96 #define CYTHON_USE_ASYNC_SLOTS 0
97 #undef CYTHON_USE_PYLIST_INTERNALS
98 #define CYTHON_USE_PYLIST_INTERNALS 0
99 #ifndef CYTHON_USE_UNICODE_INTERNALS
100 #define CYTHON_USE_UNICODE_INTERNALS 1
101 #endif
102 #undef CYTHON_USE_UNICODE_WRITER
103 #define CYTHON_USE_UNICODE_WRITER 0
104 #undef CYTHON_USE_PYLONG_INTERNALS
105 #define CYTHON_USE_PYLONG_INTERNALS 0
106 #ifndef CYTHON_AVOID_BORROWED_REFS
107 #define CYTHON_AVOID_BORROWED_REFS 0
108 #endif
109 #ifndef CYTHON_ASSUME_SAFE_MACROS
110 #define CYTHON_ASSUME_SAFE_MACROS 1
111 #endif
112 #ifndef CYTHON_UNPACK_METHODS
113 #define CYTHON_UNPACK_METHODS 1
114 #endif
115 #undef CYTHON_FAST_THREAD_STATE
116 #define CYTHON_FAST_THREAD_STATE 0
117 #undef CYTHON_FAST_PYCALL
118 #define CYTHON_FAST_PYCALL 0
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_TP_FINALIZE
122 #define CYTHON_USE_TP_FINALIZE 0
123 #undef CYTHON_USE_DICT_VERSIONS
124 #define CYTHON_USE_DICT_VERSIONS 0
125 #undef CYTHON_USE_EXC_INFO_STACK
126 #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128 #define CYTHON_COMPILING_IN_PYPY 0
129 #define CYTHON_COMPILING_IN_PYSTON 0
130 #define CYTHON_COMPILING_IN_CPYTHON 1
131 #ifndef CYTHON_USE_TYPE_SLOTS
132 #define CYTHON_USE_TYPE_SLOTS 1
133 #endif
134 #if PY_VERSION_HEX < 0x02070000
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138 #define CYTHON_USE_PYTYPE_LOOKUP 1
139 #endif
140 #if PY_MAJOR_VERSION < 3
141 #undef CYTHON_USE_ASYNC_SLOTS
142 #define CYTHON_USE_ASYNC_SLOTS 0
143 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144 #define CYTHON_USE_ASYNC_SLOTS 1
145 #endif
146 #if PY_VERSION_HEX < 0x02070000
147 #undef CYTHON_USE_PYLONG_INTERNALS
148 #define CYTHON_USE_PYLONG_INTERNALS 0
149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150 #define CYTHON_USE_PYLONG_INTERNALS 1
151 #endif
152 #ifndef CYTHON_USE_PYLIST_INTERNALS
153 #define CYTHON_USE_PYLIST_INTERNALS 1
154 #endif
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
157 #endif
158 #if PY_VERSION_HEX < 0x030300F0
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #elif !defined(CYTHON_USE_UNICODE_WRITER)
162 #define CYTHON_USE_UNICODE_WRITER 1
163 #endif
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
166 #endif
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
169 #endif
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
172 #endif
173 #ifndef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 1
175 #endif
176 #ifndef CYTHON_FAST_PYCALL
177 #define CYTHON_FAST_PYCALL 1
178 #endif
179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181 #endif
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184 #endif
185 #ifndef CYTHON_USE_DICT_VERSIONS
186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187 #endif
188 #ifndef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190 #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196 #include "longintrepr.h"
197 #undef SHIFT
198 #undef BASE
199 #undef MASK
200 #ifdef SIZEOF_VOID_P
201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202 #endif
203 #endif
204 #ifndef __has_attribute
205 #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208 #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211 #if defined(__GNUC__)
212 #define CYTHON_RESTRICT __restrict__
213 #elif defined(_MSC_VER) && _MSC_VER >= 1400
214 #define CYTHON_RESTRICT __restrict
215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216 #define CYTHON_RESTRICT restrict
217 #else
218 #define CYTHON_RESTRICT
219 #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)236 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250 #ifndef _MSC_STDINT_H_
251 #if _MSC_VER < 1300
252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
254 #else
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
257 #endif
258 #endif
259 #else
260 #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263 #if defined(__cplusplus) && __cplusplus >= 201103L
264 #if __has_cpp_attribute(fallthrough)
265 #define CYTHON_FALLTHROUGH [[fallthrough]]
266 #elif __has_cpp_attribute(clang::fallthrough)
267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268 #elif __has_cpp_attribute(gnu::fallthrough)
269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270 #endif
271 #endif
272 #ifndef CYTHON_FALLTHROUGH
273 #if __has_attribute(fallthrough)
274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275 #else
276 #define CYTHON_FALLTHROUGH
277 #endif
278 #endif
279 #if defined(__clang__ ) && defined(__apple_build_version__)
280 #if __apple_build_version__ < 7000000
281 #undef CYTHON_FALLTHROUGH
282 #define CYTHON_FALLTHROUGH
283 #endif
284 #endif
285 #endif
286
287 #ifndef __cplusplus
288 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
289 #endif
290 #ifndef CYTHON_INLINE
291 #if defined(__clang__)
292 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
293 #else
294 #define CYTHON_INLINE inline
295 #endif
296 #endif
297 template<typename T>
__Pyx_call_destructor(T & x)298 void __Pyx_call_destructor(T& x) {
299 x.~T();
300 }
301 template<typename T>
302 class __Pyx_FakeReference {
303 public:
__Pyx_FakeReference()304 __Pyx_FakeReference() : ptr(NULL) { }
__Pyx_FakeReference(const T & ref)305 __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
operator ->()306 T *operator->() { return ptr; }
operator &()307 T *operator&() { return ptr; }
operator T&()308 operator T&() { return *ptr; }
operator ==(U other)309 template<typename U> bool operator ==(U other) { return *ptr == other; }
operator !=(U other)310 template<typename U> bool operator !=(U other) { return *ptr != other; }
311 private:
312 T *ptr;
313 };
314
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316 #define Py_OptimizeFlag 0
317 #endif
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324 #define __Pyx_DefaultClassType PyClass_Type
325 #else
326 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
328 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
329 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
330 #else
331 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
332 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
333 #endif
334 #define __Pyx_DefaultClassType PyType_Type
335 #endif
336 #ifndef Py_TPFLAGS_CHECKTYPES
337 #define Py_TPFLAGS_CHECKTYPES 0
338 #endif
339 #ifndef Py_TPFLAGS_HAVE_INDEX
340 #define Py_TPFLAGS_HAVE_INDEX 0
341 #endif
342 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
343 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
344 #endif
345 #ifndef Py_TPFLAGS_HAVE_FINALIZE
346 #define Py_TPFLAGS_HAVE_FINALIZE 0
347 #endif
348 #ifndef METH_STACKLESS
349 #define METH_STACKLESS 0
350 #endif
351 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
352 #ifndef METH_FASTCALL
353 #define METH_FASTCALL 0x80
354 #endif
355 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
356 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
357 Py_ssize_t nargs, PyObject *kwnames);
358 #else
359 #define __Pyx_PyCFunctionFast _PyCFunctionFast
360 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
361 #endif
362 #if CYTHON_FAST_PYCCALL
363 #define __Pyx_PyFastCFunction_Check(func)\
364 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
365 #else
366 #define __Pyx_PyFastCFunction_Check(func) 0
367 #endif
368 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
369 #define PyObject_Malloc(s) PyMem_Malloc(s)
370 #define PyObject_Free(p) PyMem_Free(p)
371 #define PyObject_Realloc(p) PyMem_Realloc(p)
372 #endif
373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
374 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
375 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
376 #define PyMem_RawFree(p) PyMem_Free(p)
377 #endif
378 #if CYTHON_COMPILING_IN_PYSTON
379 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
380 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
381 #else
382 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
383 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
384 #endif
385 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
386 #define __Pyx_PyThreadState_Current PyThreadState_GET()
387 #elif PY_VERSION_HEX >= 0x03060000
388 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
389 #elif PY_VERSION_HEX >= 0x03000000
390 #define __Pyx_PyThreadState_Current PyThreadState_GET()
391 #else
392 #define __Pyx_PyThreadState_Current _PyThreadState_Current
393 #endif
394 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
395 #include "pythread.h"
396 #define Py_tss_NEEDS_INIT 0
397 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)398 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
399 *key = PyThread_create_key();
400 return 0;
401 }
PyThread_tss_alloc(void)402 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
403 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
404 *key = Py_tss_NEEDS_INIT;
405 return key;
406 }
PyThread_tss_free(Py_tss_t * key)407 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
408 PyObject_Free(key);
409 }
PyThread_tss_is_created(Py_tss_t * key)410 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
411 return *key != Py_tss_NEEDS_INIT;
412 }
PyThread_tss_delete(Py_tss_t * key)413 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
414 PyThread_delete_key(*key);
415 *key = Py_tss_NEEDS_INIT;
416 }
PyThread_tss_set(Py_tss_t * key,void * value)417 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
418 return PyThread_set_key_value(*key, value);
419 }
PyThread_tss_get(Py_tss_t * key)420 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
421 return PyThread_get_key_value(*key);
422 }
423 #endif
424 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
425 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
426 #else
427 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
428 #endif
429 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
430 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
431 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
432 #else
433 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
434 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
435 #endif
436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
437 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
438 #else
439 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
440 #endif
441 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
442 #define CYTHON_PEP393_ENABLED 1
443 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
444 0 : _PyUnicode_Ready((PyObject *)(op)))
445 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
446 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
447 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
448 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
449 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
450 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
451 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
452 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
453 #else
454 #define CYTHON_PEP393_ENABLED 0
455 #define PyUnicode_1BYTE_KIND 1
456 #define PyUnicode_2BYTE_KIND 2
457 #define PyUnicode_4BYTE_KIND 4
458 #define __Pyx_PyUnicode_READY(op) (0)
459 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
460 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
461 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
462 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
463 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
464 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
465 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
466 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY
469 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
470 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
471 #else
472 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
473 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
474 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
477 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
478 #endif
479 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
480 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
481 #endif
482 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
483 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
484 #endif
485 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
486 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
487 #if PY_MAJOR_VERSION >= 3
488 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
489 #else
490 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
491 #endif
492 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
493 #define PyObject_ASCII(o) PyObject_Repr(o)
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496 #define PyBaseString_Type PyUnicode_Type
497 #define PyStringObject PyUnicodeObject
498 #define PyString_Type PyUnicode_Type
499 #define PyString_Check PyUnicode_Check
500 #define PyString_CheckExact PyUnicode_CheckExact
501 #define PyObject_Unicode PyObject_Str
502 #endif
503 #if PY_MAJOR_VERSION >= 3
504 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
505 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
506 #else
507 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
508 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
509 #endif
510 #ifndef PySet_CheckExact
511 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
512 #endif
513 #if CYTHON_ASSUME_SAFE_MACROS
514 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
515 #else
516 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
517 #endif
518 #if PY_MAJOR_VERSION >= 3
519 #define PyIntObject PyLongObject
520 #define PyInt_Type PyLong_Type
521 #define PyInt_Check(op) PyLong_Check(op)
522 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
523 #define PyInt_FromString PyLong_FromString
524 #define PyInt_FromUnicode PyLong_FromUnicode
525 #define PyInt_FromLong PyLong_FromLong
526 #define PyInt_FromSize_t PyLong_FromSize_t
527 #define PyInt_FromSsize_t PyLong_FromSsize_t
528 #define PyInt_AsLong PyLong_AsLong
529 #define PyInt_AS_LONG PyLong_AS_LONG
530 #define PyInt_AsSsize_t PyLong_AsSsize_t
531 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
532 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
533 #define PyNumber_Int PyNumber_Long
534 #endif
535 #if PY_MAJOR_VERSION >= 3
536 #define PyBoolObject PyLongObject
537 #endif
538 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
539 #ifndef PyUnicode_InternFromString
540 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
541 #endif
542 #endif
543 #if PY_VERSION_HEX < 0x030200A4
544 typedef long Py_hash_t;
545 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
546 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
547 #else
548 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
549 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
550 #endif
551 #if PY_MAJOR_VERSION >= 3
552 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
553 #else
554 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
555 #endif
556 #if CYTHON_USE_ASYNC_SLOTS
557 #if PY_VERSION_HEX >= 0x030500B1
558 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
559 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
560 #else
561 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
562 #endif
563 #else
564 #define __Pyx_PyType_AsAsync(obj) NULL
565 #endif
566 #ifndef __Pyx_PyAsyncMethodsStruct
567 typedef struct {
568 unaryfunc am_await;
569 unaryfunc am_aiter;
570 unaryfunc am_anext;
571 } __Pyx_PyAsyncMethodsStruct;
572 #endif
573
574 #if defined(WIN32) || defined(MS_WINDOWS)
575 #define _USE_MATH_DEFINES
576 #endif
577 #include <math.h>
578 #ifdef NAN
579 #define __PYX_NAN() ((float) NAN)
580 #else
__PYX_NAN()581 static CYTHON_INLINE float __PYX_NAN() {
582 float value;
583 memset(&value, 0xFF, sizeof(value));
584 return value;
585 }
586 #endif
587 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
588 #define __Pyx_truncl trunc
589 #else
590 #define __Pyx_truncl truncl
591 #endif
592
593
594 #define __PYX_ERR(f_index, lineno, Ln_error) \
595 { \
596 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
597 }
598
599 #ifndef __PYX_EXTERN_C
600 #ifdef __cplusplus
601 #define __PYX_EXTERN_C extern "C"
602 #else
603 #define __PYX_EXTERN_C extern
604 #endif
605 #endif
606
607 #define __PYX_HAVE__cylp__cy__CyPEPivot
608 #define __PYX_HAVE_API__cylp__cy__CyPEPivot
609 /* Early includes */
610 #include <string.h>
611 #include <stdio.h>
612 #include "pythread.h"
613 #include "ICoinIndexedVector.hpp"
614 #include "numpy/arrayobject.h"
615 #include "numpy/ufuncobject.h"
616 #include "ClpDualRowPivot.hpp"
617 #include "ClpFactorization.hpp"
618 #include "IClpDualRowPivotBase.h"
619 #include "CoinModel.hpp"
620 #include "ICoinPackedMatrix.hpp"
621 #include "CglAllDifferent.hpp"
622 #include "CglClique.hpp"
623 #include "CglKnapsackCover.hpp"
624 #include "CglOddHole.hpp"
625 #include "CglFlowCover.hpp"
626 #include "CglGomory.hpp"
627 #include "CglRedSplit.hpp"
628 #include "CglLiftAndProject.hpp"
629 #include "CglLandP.hpp"
630 #include "CglMixedIntegerRounding.hpp"
631 #include "CglMixedIntegerRounding2.hpp"
632 #include "CglTwomir.hpp"
633 #include "CglResidualCapacity.hpp"
634 #include "CglPreProcess.hpp"
635 #include "CglProbing.hpp"
636 #include "CglSimpleRounding.hpp"
637 #include "CglCutGenerator.hpp"
638 #include "ICbcNode.hpp"
639 #include "ClpSimplex.hpp"
640 #include "OsiClpSolverInterface.hpp"
641 #include "OsiSolverInterface.hpp"
642 #include "CbcCompareUser.hpp"
643 #include "ICbcModel.hpp"
644 #include "ios"
645 #include "new"
646 #include "stdexcept"
647 #include "typeinfo"
648 #include <string>
649 #include <vector>
650 #include "IClpPrimalColumnPivotBase.h"
651 #include "ClpPrimalColumnPivot.hpp"
652 #include "IClpSimplex.hpp"
653 #ifdef _OPENMP
654 #include <omp.h>
655 #endif /* _OPENMP */
656
657 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
658 #define CYTHON_WITHOUT_ASSERTIONS
659 #endif
660
661 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
662 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
663
664 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
665 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
666 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
667 #define __PYX_DEFAULT_STRING_ENCODING ""
668 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
669 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
670 #define __Pyx_uchar_cast(c) ((unsigned char)c)
671 #define __Pyx_long_cast(x) ((long)x)
672 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
673 (sizeof(type) < sizeof(Py_ssize_t)) ||\
674 (sizeof(type) > sizeof(Py_ssize_t) &&\
675 likely(v < (type)PY_SSIZE_T_MAX ||\
676 v == (type)PY_SSIZE_T_MAX) &&\
677 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
678 v == (type)PY_SSIZE_T_MIN))) ||\
679 (sizeof(type) == sizeof(Py_ssize_t) &&\
680 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
681 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)682 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
683 return (size_t) i < (size_t) limit;
684 }
685 #if defined (__cplusplus) && __cplusplus >= 201103L
686 #include <cstdlib>
687 #define __Pyx_sst_abs(value) std::abs(value)
688 #elif SIZEOF_INT >= SIZEOF_SIZE_T
689 #define __Pyx_sst_abs(value) abs(value)
690 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
691 #define __Pyx_sst_abs(value) labs(value)
692 #elif defined (_MSC_VER)
693 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
694 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
695 #define __Pyx_sst_abs(value) llabs(value)
696 #elif defined (__GNUC__)
697 #define __Pyx_sst_abs(value) __builtin_llabs(value)
698 #else
699 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
700 #endif
701 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
702 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
703 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
704 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
705 #define __Pyx_PyBytes_FromString PyBytes_FromString
706 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
707 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
708 #if PY_MAJOR_VERSION < 3
709 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
710 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
711 #else
712 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
713 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
714 #endif
715 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
716 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
717 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
718 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
719 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
720 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
721 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
722 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
723 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
724 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
725 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
726 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
727 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
728 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
729 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
730 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)731 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
732 const Py_UNICODE *u_end = u;
733 while (*u_end++) ;
734 return (size_t)(u_end - u - 1);
735 }
736 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
737 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
738 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
739 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
740 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
741 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
742 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
743 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
744 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
745 #define __Pyx_PySequence_Tuple(obj)\
746 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
747 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
748 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
749 #if CYTHON_ASSUME_SAFE_MACROS
750 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
751 #else
752 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
753 #endif
754 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
755 #if PY_MAJOR_VERSION >= 3
756 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
757 #else
758 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
759 #endif
760 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
761 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
762 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)763 static int __Pyx_init_sys_getdefaultencoding_params(void) {
764 PyObject* sys;
765 PyObject* default_encoding = NULL;
766 PyObject* ascii_chars_u = NULL;
767 PyObject* ascii_chars_b = NULL;
768 const char* default_encoding_c;
769 sys = PyImport_ImportModule("sys");
770 if (!sys) goto bad;
771 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
772 Py_DECREF(sys);
773 if (!default_encoding) goto bad;
774 default_encoding_c = PyBytes_AsString(default_encoding);
775 if (!default_encoding_c) goto bad;
776 if (strcmp(default_encoding_c, "ascii") == 0) {
777 __Pyx_sys_getdefaultencoding_not_ascii = 0;
778 } else {
779 char ascii_chars[128];
780 int c;
781 for (c = 0; c < 128; c++) {
782 ascii_chars[c] = c;
783 }
784 __Pyx_sys_getdefaultencoding_not_ascii = 1;
785 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
786 if (!ascii_chars_u) goto bad;
787 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
788 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
789 PyErr_Format(
790 PyExc_ValueError,
791 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
792 default_encoding_c);
793 goto bad;
794 }
795 Py_DECREF(ascii_chars_u);
796 Py_DECREF(ascii_chars_b);
797 }
798 Py_DECREF(default_encoding);
799 return 0;
800 bad:
801 Py_XDECREF(default_encoding);
802 Py_XDECREF(ascii_chars_u);
803 Py_XDECREF(ascii_chars_b);
804 return -1;
805 }
806 #endif
807 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
808 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
809 #else
810 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
811 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
812 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)813 static int __Pyx_init_sys_getdefaultencoding_params(void) {
814 PyObject* sys;
815 PyObject* default_encoding = NULL;
816 char* default_encoding_c;
817 sys = PyImport_ImportModule("sys");
818 if (!sys) goto bad;
819 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
820 Py_DECREF(sys);
821 if (!default_encoding) goto bad;
822 default_encoding_c = PyBytes_AsString(default_encoding);
823 if (!default_encoding_c) goto bad;
824 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
825 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
826 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
827 Py_DECREF(default_encoding);
828 return 0;
829 bad:
830 Py_XDECREF(default_encoding);
831 return -1;
832 }
833 #endif
834 #endif
835
836
837 /* Test for GCC > 2.95 */
838 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
839 #define likely(x) __builtin_expect(!!(x), 1)
840 #define unlikely(x) __builtin_expect(!!(x), 0)
841 #else /* !__GNUC__ or GCC < 2.95 */
842 #define likely(x) (x)
843 #define unlikely(x) (x)
844 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)845 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
846
847 static PyObject *__pyx_m = NULL;
848 static PyObject *__pyx_d;
849 static PyObject *__pyx_b;
850 static PyObject *__pyx_cython_runtime = NULL;
851 static PyObject *__pyx_empty_tuple;
852 static PyObject *__pyx_empty_bytes;
853 static PyObject *__pyx_empty_unicode;
854 static int __pyx_lineno;
855 static int __pyx_clineno = 0;
856 static const char * __pyx_cfilenm= __FILE__;
857 static const char *__pyx_filename;
858
859 /* Header.proto */
860 #if !defined(CYTHON_CCOMPLEX)
861 #if defined(__cplusplus)
862 #define CYTHON_CCOMPLEX 1
863 #elif defined(_Complex_I)
864 #define CYTHON_CCOMPLEX 1
865 #else
866 #define CYTHON_CCOMPLEX 0
867 #endif
868 #endif
869 #if CYTHON_CCOMPLEX
870 #ifdef __cplusplus
871 #include <complex>
872 #else
873 #include <complex.h>
874 #endif
875 #endif
876 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
877 #undef _Complex_I
878 #define _Complex_I 1.0fj
879 #endif
880
881
882 static const char *__pyx_f[] = {
883 "cylp\\cy\\CyPEPivot.pyx",
884 "stringsource",
885 "__init__.pxd",
886 "type.pxd",
887 "bool.pxd",
888 "complex.pxd",
889 "cylp\\cy\\CyCoinIndexedVector.pxd",
890 "cylp\\cy\\CyClpDualRowPivotBase.pxd",
891 "cylp\\cy\\CyCoinModel.pxd",
892 "cylp\\cy\\CyCoinPackedMatrix.pxd",
893 "cylp\\cy\\CyCgl.pxd",
894 "cylp\\cy\\CyCbcNode.pxd",
895 "cylp\\cy\\CyOsiSolverInterface.pxd",
896 "cylp\\cy\\CyCbcModel.pxd",
897 "cylp\\cy\\CyClpSimplex.pxd",
898 };
899
900 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":776
901 * # in Cython to enable them only on the right systems.
902 *
903 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
904 * ctypedef npy_int16 int16_t
905 * ctypedef npy_int32 int32_t
906 */
907 typedef npy_int8 __pyx_t_5numpy_int8_t;
908
909 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":777
910 *
911 * ctypedef npy_int8 int8_t
912 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
913 * ctypedef npy_int32 int32_t
914 * ctypedef npy_int64 int64_t
915 */
916 typedef npy_int16 __pyx_t_5numpy_int16_t;
917
918 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":778
919 * ctypedef npy_int8 int8_t
920 * ctypedef npy_int16 int16_t
921 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
922 * ctypedef npy_int64 int64_t
923 * #ctypedef npy_int96 int96_t
924 */
925 typedef npy_int32 __pyx_t_5numpy_int32_t;
926
927 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":779
928 * ctypedef npy_int16 int16_t
929 * ctypedef npy_int32 int32_t
930 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
931 * #ctypedef npy_int96 int96_t
932 * #ctypedef npy_int128 int128_t
933 */
934 typedef npy_int64 __pyx_t_5numpy_int64_t;
935
936 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":783
937 * #ctypedef npy_int128 int128_t
938 *
939 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
940 * ctypedef npy_uint16 uint16_t
941 * ctypedef npy_uint32 uint32_t
942 */
943 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
944
945 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":784
946 *
947 * ctypedef npy_uint8 uint8_t
948 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
949 * ctypedef npy_uint32 uint32_t
950 * ctypedef npy_uint64 uint64_t
951 */
952 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
953
954 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":785
955 * ctypedef npy_uint8 uint8_t
956 * ctypedef npy_uint16 uint16_t
957 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
958 * ctypedef npy_uint64 uint64_t
959 * #ctypedef npy_uint96 uint96_t
960 */
961 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
962
963 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":786
964 * ctypedef npy_uint16 uint16_t
965 * ctypedef npy_uint32 uint32_t
966 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
967 * #ctypedef npy_uint96 uint96_t
968 * #ctypedef npy_uint128 uint128_t
969 */
970 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
971
972 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":790
973 * #ctypedef npy_uint128 uint128_t
974 *
975 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
976 * ctypedef npy_float64 float64_t
977 * #ctypedef npy_float80 float80_t
978 */
979 typedef npy_float32 __pyx_t_5numpy_float32_t;
980
981 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":791
982 *
983 * ctypedef npy_float32 float32_t
984 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
985 * #ctypedef npy_float80 float80_t
986 * #ctypedef npy_float128 float128_t
987 */
988 typedef npy_float64 __pyx_t_5numpy_float64_t;
989
990 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":800
991 * # The int types are mapped a bit surprising --
992 * # numpy.int corresponds to 'l' and numpy.long to 'q'
993 * ctypedef npy_long int_t # <<<<<<<<<<<<<<
994 * ctypedef npy_longlong long_t
995 * ctypedef npy_longlong longlong_t
996 */
997 typedef npy_long __pyx_t_5numpy_int_t;
998
999 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
1000 * # numpy.int corresponds to 'l' and numpy.long to 'q'
1001 * ctypedef npy_long int_t
1002 * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1003 * ctypedef npy_longlong longlong_t
1004 *
1005 */
1006 typedef npy_longlong __pyx_t_5numpy_long_t;
1007
1008 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":802
1009 * ctypedef npy_long int_t
1010 * ctypedef npy_longlong long_t
1011 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1012 *
1013 * ctypedef npy_ulong uint_t
1014 */
1015 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1016
1017 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":804
1018 * ctypedef npy_longlong longlong_t
1019 *
1020 * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1021 * ctypedef npy_ulonglong ulong_t
1022 * ctypedef npy_ulonglong ulonglong_t
1023 */
1024 typedef npy_ulong __pyx_t_5numpy_uint_t;
1025
1026 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":805
1027 *
1028 * ctypedef npy_ulong uint_t
1029 * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1030 * ctypedef npy_ulonglong ulonglong_t
1031 *
1032 */
1033 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1034
1035 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":806
1036 * ctypedef npy_ulong uint_t
1037 * ctypedef npy_ulonglong ulong_t
1038 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1039 *
1040 * ctypedef npy_intp intp_t
1041 */
1042 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1043
1044 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":808
1045 * ctypedef npy_ulonglong ulonglong_t
1046 *
1047 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1048 * ctypedef npy_uintp uintp_t
1049 *
1050 */
1051 typedef npy_intp __pyx_t_5numpy_intp_t;
1052
1053 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":809
1054 *
1055 * ctypedef npy_intp intp_t
1056 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1057 *
1058 * ctypedef npy_double float_t
1059 */
1060 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1061
1062 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":811
1063 * ctypedef npy_uintp uintp_t
1064 *
1065 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1066 * ctypedef npy_double double_t
1067 * ctypedef npy_longdouble longdouble_t
1068 */
1069 typedef npy_double __pyx_t_5numpy_float_t;
1070
1071 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":812
1072 *
1073 * ctypedef npy_double float_t
1074 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1075 * ctypedef npy_longdouble longdouble_t
1076 *
1077 */
1078 typedef npy_double __pyx_t_5numpy_double_t;
1079
1080 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":813
1081 * ctypedef npy_double float_t
1082 * ctypedef npy_double double_t
1083 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1084 *
1085 * ctypedef npy_cfloat cfloat_t
1086 */
1087 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1088 /* Declarations.proto */
1089 #if CYTHON_CCOMPLEX
1090 #ifdef __cplusplus
1091 typedef ::std::complex< float > __pyx_t_float_complex;
1092 #else
1093 typedef float _Complex __pyx_t_float_complex;
1094 #endif
1095 #else
1096 typedef struct { float real, imag; } __pyx_t_float_complex;
1097 #endif
1098 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1099
1100 /* Declarations.proto */
1101 #if CYTHON_CCOMPLEX
1102 #ifdef __cplusplus
1103 typedef ::std::complex< double > __pyx_t_double_complex;
1104 #else
1105 typedef double _Complex __pyx_t_double_complex;
1106 #endif
1107 #else
1108 typedef struct { double real, imag; } __pyx_t_double_complex;
1109 #endif
1110 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1111
1112
1113 /*--- Type declarations ---*/
1114 struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector;
1115 struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase;
1116 struct __pyx_obj_4cylp_2cy_11CyCoinModel_CyCoinModel;
1117 struct __pyx_obj_4cylp_2cy_18CyCoinPackedMatrix_CyCoinPackedMatrix;
1118 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator;
1119 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglAllDifferent;
1120 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglClique;
1121 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglKnapsackCover;
1122 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglOddHole;
1123 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglFlowCover;
1124 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglGomory;
1125 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglRedSplit;
1126 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglLiftAndProject;
1127 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglLandP;
1128 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding;
1129 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding2;
1130 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglTwomir;
1131 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglResidualCapacity;
1132 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglPreProcess;
1133 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglProbing;
1134 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglSimpleRounding;
1135 struct __pyx_obj_4cylp_2cy_9CyCbcNode_CyCbcNode;
1136 struct __pyx_obj_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface;
1137 struct __pyx_obj_4cylp_2cy_10CyCbcModel_CyCbcModel;
1138 struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex;
1139 struct __pyx_obj_4cylp_2cy_12CyClpSimplex_VarStatus;
1140 struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase;
1141 struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot;
1142
1143 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":815
1144 * ctypedef npy_longdouble longdouble_t
1145 *
1146 * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1147 * ctypedef npy_cdouble cdouble_t
1148 * ctypedef npy_clongdouble clongdouble_t
1149 */
1150 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1151
1152 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":816
1153 *
1154 * ctypedef npy_cfloat cfloat_t
1155 * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1156 * ctypedef npy_clongdouble clongdouble_t
1157 *
1158 */
1159 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1160
1161 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":817
1162 * ctypedef npy_cfloat cfloat_t
1163 * ctypedef npy_cdouble cdouble_t
1164 * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1165 *
1166 * ctypedef npy_cdouble complex_t
1167 */
1168 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1169
1170 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":819
1171 * ctypedef npy_clongdouble clongdouble_t
1172 *
1173 * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1174 *
1175 * cdef inline object PyArray_MultiIterNew1(a):
1176 */
1177 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1178 struct __pyx_opt_args_4cylp_2cy_10CyCbcModel_10CyCbcModel_addCutGenerator;
1179
1180 /* "cylp/cy/CyCbcModel.pxd":89
1181 * cdef setCppSelf(self, CppICbcModel* cppmodel)
1182 * cdef setClpModel(self, clpmodel)
1183 * cpdef addCutGenerator(self, CyCglCutGenerator generator, # <<<<<<<<<<<<<<
1184 * howOften=*, name=*, normal=*, atSolution=*,
1185 * infeasible=*, howOftenInSub=*, whatDepth=*,
1186 */
1187 struct __pyx_opt_args_4cylp_2cy_10CyCbcModel_10CyCbcModel_addCutGenerator {
1188 int __pyx_n;
1189 PyObject *howOften;
1190 PyObject *name;
1191 PyObject *normal;
1192 PyObject *atSolution;
1193 PyObject *infeasible;
1194 PyObject *howOftenInSub;
1195 PyObject *whatDepth;
1196 PyObject *whatDepthInSub;
1197 };
1198 struct __pyx_opt_args_4cylp_2cy_12CyClpSimplex_12CyClpSimplex_readMps;
1199
1200 /* "CyClpSimplex.pxd":326
1201 * #cdef object isPivotAcceptable_func
1202 *
1203 * cpdef int readMps(self, filename, int keepNames=*, # <<<<<<<<<<<<<<
1204 * int ignoreErrors=*) except *
1205 *
1206 */
1207 struct __pyx_opt_args_4cylp_2cy_12CyClpSimplex_12CyClpSimplex_readMps {
1208 int __pyx_n;
1209 int keepNames;
1210 int ignoreErrors;
1211 };
1212
1213 /* "cylp/cy/CyCoinIndexedVector.pxd":22
1214 *
1215 *
1216 * cdef class CyCoinIndexedVector: # <<<<<<<<<<<<<<
1217 * cpdef CppCoinIndexedVector *CppSelf
1218 * cpdef reserve(self, n)
1219 */
1220 struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector {
1221 PyObject_HEAD
1222 struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *__pyx_vtab;
1223 ICoinIndexedVector *CppSelf;
1224 };
1225
1226
1227 /* "cylp/cy/CyClpDualRowPivotBase.pxd":72
1228 *
1229 *
1230 * cdef class CyClpDualRowPivotBase: # <<<<<<<<<<<<<<
1231 * cdef CppClpDualRowPivotBase* CppSelf
1232 * cdef CyClpSimplex.CyClpSimplex cyModel
1233 */
1234 struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase {
1235 PyObject_HEAD
1236 struct __pyx_vtabstruct_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *__pyx_vtab;
1237 CppClpDualRowPivotBase *CppSelf;
1238 struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *cyModel;
1239 };
1240
1241
1242 /* "cylp/cy/CyCoinModel.pxd":34
1243 *
1244 *
1245 * cdef class CyCoinModel: # <<<<<<<<<<<<<<
1246 * cdef CppCoinModel* CppSelf
1247 *
1248 */
1249 struct __pyx_obj_4cylp_2cy_11CyCoinModel_CyCoinModel {
1250 PyObject_HEAD
1251 struct __pyx_vtabstruct_4cylp_2cy_11CyCoinModel_CyCoinModel *__pyx_vtab;
1252 CoinModel *CppSelf;
1253 };
1254
1255
1256 /* "cylp/cy/CyCoinPackedMatrix.pxd":27
1257 *
1258 *
1259 * cdef class CyCoinPackedMatrix: # <<<<<<<<<<<<<<
1260 * cpdef CppCoinPackedMatrix* CppSelf
1261 * #cpdef getIndices(self)
1262 */
1263 struct __pyx_obj_4cylp_2cy_18CyCoinPackedMatrix_CyCoinPackedMatrix {
1264 PyObject_HEAD
1265 ICoinPackedMatrix *CppSelf;
1266 };
1267
1268
1269 /* "cylp/cy/CyCgl.pxd":103
1270 *
1271 *
1272 * cdef class CyCglCutGenerator: # <<<<<<<<<<<<<<
1273 * cdef CppCglCutGenerator* CppSelf
1274 *
1275 */
1276 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator {
1277 PyObject_HEAD
1278 CglCutGenerator *CppSelf;
1279 };
1280
1281
1282 /* "cylp/cy/CyCgl.pxd":108
1283 * ###########
1284 *
1285 * cdef class CyCglAllDifferent(CyCglCutGenerator): # <<<<<<<<<<<<<<
1286 * pass
1287 *
1288 */
1289 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglAllDifferent {
1290 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1291 };
1292
1293
1294 /* "cylp/cy/CyCgl.pxd":111
1295 * pass
1296 *
1297 * cdef class CyCglClique(CyCglCutGenerator): # <<<<<<<<<<<<<<
1298 * pass
1299 *
1300 */
1301 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglClique {
1302 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1303 };
1304
1305
1306 /* "cylp/cy/CyCgl.pxd":114
1307 * pass
1308 *
1309 * cdef class CyCglKnapsackCover(CyCglCutGenerator): # <<<<<<<<<<<<<<
1310 * cdef CppCglKnapsackCover* realCppSelf(self)
1311 *
1312 */
1313 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglKnapsackCover {
1314 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1315 struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglKnapsackCover *__pyx_vtab;
1316 };
1317
1318
1319 /* "cylp/cy/CyCgl.pxd":117
1320 * cdef CppCglKnapsackCover* realCppSelf(self)
1321 *
1322 * cdef class CyCglOddHole(CyCglCutGenerator): # <<<<<<<<<<<<<<
1323 * pass
1324 *
1325 */
1326 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglOddHole {
1327 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1328 };
1329
1330
1331 /* "cylp/cy/CyCgl.pxd":122
1332 * ##################
1333 *
1334 * cdef class CyCglFlowCover(CyCglCutGenerator): # <<<<<<<<<<<<<<
1335 * pass
1336 *
1337 */
1338 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglFlowCover {
1339 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1340 };
1341
1342
1343 /* "cylp/cy/CyCgl.pxd":127
1344 * ##################
1345 *
1346 * cdef class CyCglGomory(CyCglCutGenerator): # <<<<<<<<<<<<<<
1347 * cdef CppCglGomory* realCppSelf(self)
1348 * #cdef CppCglGomory* CppSelf
1349 */
1350 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglGomory {
1351 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1352 struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglGomory *__pyx_vtab;
1353 };
1354
1355
1356 /* "cylp/cy/CyCgl.pxd":132
1357 * #cdef CppCglCutGenerator* CppSelf
1358 *
1359 * cdef class CyCglRedSplit(CyCglCutGenerator): # <<<<<<<<<<<<<<
1360 * pass
1361 *
1362 */
1363 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglRedSplit {
1364 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1365 };
1366
1367
1368 /* "cylp/cy/CyCgl.pxd":137
1369 * ###################
1370 *
1371 * cdef class CyCglLiftAndProject(CyCglCutGenerator): # <<<<<<<<<<<<<<
1372 * pass
1373 *
1374 */
1375 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglLiftAndProject {
1376 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1377 };
1378
1379
1380 /* "cylp/cy/CyCgl.pxd":140
1381 * pass
1382 *
1383 * cdef class CyCglLandP(CyCglCutGenerator): # <<<<<<<<<<<<<<
1384 * pass
1385 *
1386 */
1387 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglLandP {
1388 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1389 };
1390
1391
1392 /* "cylp/cy/CyCgl.pxd":145
1393 * ###################
1394 *
1395 * cdef class CyCglMixedIntegerRounding(CyCglCutGenerator): # <<<<<<<<<<<<<<
1396 * pass
1397 *
1398 */
1399 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding {
1400 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1401 };
1402
1403
1404 /* "cylp/cy/CyCgl.pxd":148
1405 * pass
1406 *
1407 * cdef class CyCglMixedIntegerRounding2(CyCglCutGenerator): # <<<<<<<<<<<<<<
1408 * pass
1409 *
1410 */
1411 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding2 {
1412 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1413 };
1414
1415
1416 /* "cylp/cy/CyCgl.pxd":151
1417 * pass
1418 *
1419 * cdef class CyCglTwomir(CyCglCutGenerator): # <<<<<<<<<<<<<<
1420 * pass
1421 *
1422 */
1423 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglTwomir {
1424 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1425 };
1426
1427
1428 /* "cylp/cy/CyCgl.pxd":154
1429 * pass
1430 *
1431 * cdef class CyCglResidualCapacity(CyCglCutGenerator): # <<<<<<<<<<<<<<
1432 * pass
1433 *
1434 */
1435 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglResidualCapacity {
1436 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1437 };
1438
1439
1440 /* "cylp/cy/CyCgl.pxd":162
1441 * # pass
1442 *
1443 * cdef class CyCglPreProcess(CyCglCutGenerator): # <<<<<<<<<<<<<<
1444 * pass
1445 *
1446 */
1447 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglPreProcess {
1448 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1449 };
1450
1451
1452 /* "cylp/cy/CyCgl.pxd":165
1453 * pass
1454 *
1455 * cdef class CyCglProbing(CyCglCutGenerator): # <<<<<<<<<<<<<<
1456 * pass
1457 *
1458 */
1459 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglProbing {
1460 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1461 };
1462
1463
1464 /* "cylp/cy/CyCgl.pxd":168
1465 * pass
1466 *
1467 * cdef class CyCglSimpleRounding(CyCglCutGenerator): # <<<<<<<<<<<<<<
1468 * pass
1469 *
1470 */
1471 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglSimpleRounding {
1472 struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator __pyx_base;
1473 };
1474
1475
1476 /* "cylp/cy/CyCbcNode.pxd":13
1477 * bint breakTie(CppICbcNode* y)
1478 *
1479 * cdef class CyCbcNode: # <<<<<<<<<<<<<<
1480 * cdef CppICbcNode* CppSelf
1481 * cdef setCppSelf(self, CppICbcNode* cbcnode)
1482 */
1483 struct __pyx_obj_4cylp_2cy_9CyCbcNode_CyCbcNode {
1484 PyObject_HEAD
1485 struct __pyx_vtabstruct_4cylp_2cy_9CyCbcNode_CyCbcNode *__pyx_vtab;
1486 ICbcNode *CppSelf;
1487 };
1488
1489
1490 /* "cylp/cy/CyOsiSolverInterface.pxd":15
1491 * pass
1492 *
1493 * cdef class CyOsiSolverInterface: # <<<<<<<<<<<<<<
1494 * cdef CppOsiSolverInterface* CppSelf
1495 * cdef setCppSelf(self, CppOsiSolverInterface* s)
1496 */
1497 struct __pyx_obj_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface {
1498 PyObject_HEAD
1499 struct __pyx_vtabstruct_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface *__pyx_vtab;
1500 OsiSolverInterface *CppSelf;
1501 };
1502
1503
1504 /* "cylp/cy/CyCbcModel.pxd":82
1505 * CppOsiSolverInterface* solver()
1506 *
1507 * cdef class CyCbcModel: # <<<<<<<<<<<<<<
1508 * cdef CppICbcModel* CppSelf
1509 * cdef object cyLPModel
1510 */
1511 struct __pyx_obj_4cylp_2cy_10CyCbcModel_CyCbcModel {
1512 PyObject_HEAD
1513 struct __pyx_vtabstruct_4cylp_2cy_10CyCbcModel_CyCbcModel *__pyx_vtab;
1514 ICbcModel *CppSelf;
1515 PyObject *cyLPModel;
1516 PyObject *clpModel;
1517 PyObject *cutGenerators;
1518 };
1519
1520
1521 /* "CyClpSimplex.pxd":302
1522 * void setOptimizationDirection(double value)
1523 *
1524 * cdef class CyClpSimplex: # <<<<<<<<<<<<<<
1525 * '''
1526 * This is the documentation of CyClpSimpelx in the pyx class
1527 */
1528 struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex {
1529 PyObject_HEAD
1530 struct __pyx_vtabstruct_4cylp_2cy_12CyClpSimplex_CyClpSimplex *__pyx_vtab;
1531 IClpSimplex *CppSelf;
1532 PyObject *vars;
1533 PyObject *varSelCriteria;
1534 struct __pyx_obj_4cylp_2cy_11CyCoinModel_CyCoinModel *coinModel;
1535 PyObject *cyLPModel;
1536 struct __pyx_obj_4cylp_2cy_10CyCbcModel_CyCbcModel *cbcModel;
1537 PyObject *_Hessian;
1538 struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *cyPivot;
1539 struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *cyDualPivot;
1540 };
1541
1542
1543 /* "CyClpSimplex.pxd":377
1544 * cpdef setConstraintName(self, constInd, name)
1545 *
1546 * cdef class VarStatus: # <<<<<<<<<<<<<<
1547 * pass
1548 * cpdef cydot(CyCoinIndexedVector v1, CyCoinIndexedVector v2)
1549 */
1550 struct __pyx_obj_4cylp_2cy_12CyClpSimplex_VarStatus {
1551 PyObject_HEAD
1552 };
1553
1554
1555 /* "CyClpPrimalColumnPivotBase.pxd":67
1556 *
1557 *
1558 * cdef class CyClpPrimalColumnPivotBase: # <<<<<<<<<<<<<<
1559 * cdef CppClpPrimalColumnPivotBase* CppSelf
1560 * cdef CyClpSimplex.CyClpSimplex cyModel
1561 */
1562 struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase {
1563 PyObject_HEAD
1564 struct __pyx_vtabstruct_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *__pyx_vtab;
1565 CppClpPrimalColumnPivotBase *CppSelf;
1566 struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *cyModel;
1567 };
1568
1569
1570 /* "cylp/cy/CyPEPivot.pxd":7
1571 *
1572 *
1573 * cdef class CyPEPivot(CyClpPrimalColumnPivotBase): # <<<<<<<<<<<<<<
1574 * cdef pivotColumn(self, CppCoinIndexedVector* v1,
1575 * CppCoinIndexedVector* v2, CppCoinIndexedVector* v3,
1576 */
1577 struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot {
1578 struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase __pyx_base;
1579 };
1580
1581
1582
1583 /* "cylp/cy/CyCoinIndexedVector.pxd":22
1584 *
1585 *
1586 * cdef class CyCoinIndexedVector: # <<<<<<<<<<<<<<
1587 * cpdef CppCoinIndexedVector *CppSelf
1588 * cpdef reserve(self, n)
1589 */
1590
1591 struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector {
1592 PyObject *(*reserve)(struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *, PyObject *, int __pyx_skip_dispatch);
1593 PyObject *(*assign)(struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1594 PyObject *(*setCppSelf)(struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *, ICoinIndexedVector *);
1595 };
1596 static struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *__pyx_vtabptr_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector;
1597
1598
1599 /* "cylp/cy/CyClpDualRowPivotBase.pxd":72
1600 *
1601 *
1602 * cdef class CyClpDualRowPivotBase: # <<<<<<<<<<<<<<
1603 * cdef CppClpDualRowPivotBase* CppSelf
1604 * cdef CyClpSimplex.CyClpSimplex cyModel
1605 */
1606
1607 struct __pyx_vtabstruct_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase {
1608 PyObject *(*pivotRow)(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *);
1609 ClpDualRowPivot *(*clone)(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *, int);
1610 double (*updateWeights)(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *);
1611 void (*updatePrimalSolution)(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *, ICoinIndexedVector *, double, PyArrayObject *);
1612 IClpSimplex *(*model)(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *);
1613 void (*setModel)(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *, IClpSimplex *);
1614 double *(*getReducedCosts)(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *);
1615 };
1616 static struct __pyx_vtabstruct_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase *__pyx_vtabptr_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase;
1617
1618
1619 /* "cylp/cy/CyCoinModel.pxd":34
1620 *
1621 *
1622 * cdef class CyCoinModel: # <<<<<<<<<<<<<<
1623 * cdef CppCoinModel* CppSelf
1624 *
1625 */
1626
1627 struct __pyx_vtabstruct_4cylp_2cy_11CyCoinModel_CyCoinModel {
1628 void (*CLP_addColumn)(struct __pyx_obj_4cylp_2cy_11CyCoinModel_CyCoinModel *, int, int *, double *, double, double, double);
1629 void (*CLP_addRow)(struct __pyx_obj_4cylp_2cy_11CyCoinModel_CyCoinModel *, int, int *, double *, double, double);
1630 };
1631 static struct __pyx_vtabstruct_4cylp_2cy_11CyCoinModel_CyCoinModel *__pyx_vtabptr_4cylp_2cy_11CyCoinModel_CyCoinModel;
1632
1633
1634 /* "cylp/cy/CyCgl.pxd":114
1635 * pass
1636 *
1637 * cdef class CyCglKnapsackCover(CyCglCutGenerator): # <<<<<<<<<<<<<<
1638 * cdef CppCglKnapsackCover* realCppSelf(self)
1639 *
1640 */
1641
1642 struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglKnapsackCover {
1643 CglKnapsackCover *(*realCppSelf)(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglKnapsackCover *);
1644 };
1645 static struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglKnapsackCover *__pyx_vtabptr_4cylp_2cy_5CyCgl_CyCglKnapsackCover;
1646
1647
1648 /* "cylp/cy/CyCgl.pxd":127
1649 * ##################
1650 *
1651 * cdef class CyCglGomory(CyCglCutGenerator): # <<<<<<<<<<<<<<
1652 * cdef CppCglGomory* realCppSelf(self)
1653 * #cdef CppCglGomory* CppSelf
1654 */
1655
1656 struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglGomory {
1657 CglGomory *(*realCppSelf)(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglGomory *);
1658 };
1659 static struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglGomory *__pyx_vtabptr_4cylp_2cy_5CyCgl_CyCglGomory;
1660
1661
1662 /* "cylp/cy/CyCbcNode.pxd":13
1663 * bint breakTie(CppICbcNode* y)
1664 *
1665 * cdef class CyCbcNode: # <<<<<<<<<<<<<<
1666 * cdef CppICbcNode* CppSelf
1667 * cdef setCppSelf(self, CppICbcNode* cbcnode)
1668 */
1669
1670 struct __pyx_vtabstruct_4cylp_2cy_9CyCbcNode_CyCbcNode {
1671 PyObject *(*setCppSelf)(struct __pyx_obj_4cylp_2cy_9CyCbcNode_CyCbcNode *, ICbcNode *);
1672 };
1673 static struct __pyx_vtabstruct_4cylp_2cy_9CyCbcNode_CyCbcNode *__pyx_vtabptr_4cylp_2cy_9CyCbcNode_CyCbcNode;
1674
1675
1676 /* "cylp/cy/CyOsiSolverInterface.pxd":15
1677 * pass
1678 *
1679 * cdef class CyOsiSolverInterface: # <<<<<<<<<<<<<<
1680 * cdef CppOsiSolverInterface* CppSelf
1681 * cdef setCppSelf(self, CppOsiSolverInterface* s)
1682 */
1683
1684 struct __pyx_vtabstruct_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface {
1685 PyObject *(*setCppSelf)(struct __pyx_obj_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface *, OsiSolverInterface *);
1686 };
1687 static struct __pyx_vtabstruct_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface *__pyx_vtabptr_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface;
1688
1689
1690 /* "cylp/cy/CyCbcModel.pxd":82
1691 * CppOsiSolverInterface* solver()
1692 *
1693 * cdef class CyCbcModel: # <<<<<<<<<<<<<<
1694 * cdef CppICbcModel* CppSelf
1695 * cdef object cyLPModel
1696 */
1697
1698 struct __pyx_vtabstruct_4cylp_2cy_10CyCbcModel_CyCbcModel {
1699 PyObject *(*setCppSelf)(struct __pyx_obj_4cylp_2cy_10CyCbcModel_CyCbcModel *, ICbcModel *);
1700 PyObject *(*setClpModel)(struct __pyx_obj_4cylp_2cy_10CyCbcModel_CyCbcModel *, PyObject *);
1701 PyObject *(*addCutGenerator)(struct __pyx_obj_4cylp_2cy_10CyCbcModel_CyCbcModel *, struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator *, int __pyx_skip_dispatch, struct __pyx_opt_args_4cylp_2cy_10CyCbcModel_10CyCbcModel_addCutGenerator *__pyx_optional_args);
1702 };
1703 static struct __pyx_vtabstruct_4cylp_2cy_10CyCbcModel_CyCbcModel *__pyx_vtabptr_4cylp_2cy_10CyCbcModel_CyCbcModel;
1704
1705
1706 /* "CyClpSimplex.pxd":302
1707 * void setOptimizationDirection(double value)
1708 *
1709 * cdef class CyClpSimplex: # <<<<<<<<<<<<<<
1710 * '''
1711 * This is the documentation of CyClpSimpelx in the pyx class
1712 */
1713
1714 struct __pyx_vtabstruct_4cylp_2cy_12CyClpSimplex_CyClpSimplex {
1715 PyObject *(*setCppSelf)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, IClpSimplex *);
1716 int (*readMps)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4cylp_2cy_12CyClpSimplex_12CyClpSimplex_readMps *__pyx_optional_args);
1717 PyObject *(*setPrimalColumnPivotAlgorithm)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, void *);
1718 PyObject *(*setDualRowPivotAlgorithm)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, void *);
1719 double *(*primalColumnSolution)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1720 double *(*dualColumnSolution)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1721 double *(*primalRowSolution)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1722 double *(*dualRowSolution)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1723 double *(*rowLower)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1724 double *(*rowUpper)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1725 PyObject *(*getReducedCosts)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, int __pyx_skip_dispatch);
1726 PyObject *(*getStatusArray)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, int __pyx_skip_dispatch);
1727 PyObject *(*getComplementarityList)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, int __pyx_skip_dispatch);
1728 PyObject *(*getPivotVariable)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, int __pyx_skip_dispatch);
1729 PyObject *(*filterVars)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, PyObject *, int __pyx_skip_dispatch);
1730 PyObject *(*CLP_getVarStatus)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, int, int __pyx_skip_dispatch);
1731 PyObject *(*CLP_setVarStatus)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, int, int, int __pyx_skip_dispatch);
1732 PyObject *(*primalRow)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, int);
1733 PyObject *(*getACol)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, int, struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *, int __pyx_skip_dispatch);
1734 int *(*ComplementarityList)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1735 int *(*pivotVariable)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *);
1736 PyObject *(*vectorTimesB_1)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *, int __pyx_skip_dispatch);
1737 PyObject *(*setVariableName)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1738 PyObject *(*setConstraintName)(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1739 };
1740 static struct __pyx_vtabstruct_4cylp_2cy_12CyClpSimplex_CyClpSimplex *__pyx_vtabptr_4cylp_2cy_12CyClpSimplex_CyClpSimplex;
1741
1742
1743 /* "CyClpPrimalColumnPivotBase.pxd":67
1744 *
1745 *
1746 * cdef class CyClpPrimalColumnPivotBase: # <<<<<<<<<<<<<<
1747 * cdef CppClpPrimalColumnPivotBase* CppSelf
1748 * cdef CyClpSimplex.CyClpSimplex cyModel
1749 */
1750
1751 struct __pyx_vtabstruct_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase {
1752 PyObject *(*pivotColumn)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *);
1753 ClpPrimalColumnPivot *(*clone)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *, int);
1754 void (*saveWeights)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *, IClpSimplex *, int);
1755 IClpSimplex *(*model)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *);
1756 void (*setModel)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *, IClpSimplex *);
1757 double *(*getReducedCosts)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *);
1758 };
1759 static struct __pyx_vtabstruct_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *__pyx_vtabptr_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase;
1760
1761
1762 /* "cylp/cy/CyPEPivot.pyx":11
1763 * #cimport cython.operator.dereference as deref
1764 *
1765 * cdef class CyPEPivot(CyClpPrimalColumnPivotBase): # <<<<<<<<<<<<<<
1766 * def __init__(self, cyModel):
1767 * self.cyModel = cyModel
1768 */
1769
1770 struct __pyx_vtabstruct_4cylp_2cy_9CyPEPivot_CyPEPivot {
1771 struct __pyx_vtabstruct_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase __pyx_base;
1772 };
1773 static struct __pyx_vtabstruct_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_vtabptr_4cylp_2cy_9CyPEPivot_CyPEPivot;
1774
1775 /* --- Runtime support code (head) --- */
1776 /* Refnanny.proto */
1777 #ifndef CYTHON_REFNANNY
1778 #define CYTHON_REFNANNY 0
1779 #endif
1780 #if CYTHON_REFNANNY
1781 typedef struct {
1782 void (*INCREF)(void*, PyObject*, int);
1783 void (*DECREF)(void*, PyObject*, int);
1784 void (*GOTREF)(void*, PyObject*, int);
1785 void (*GIVEREF)(void*, PyObject*, int);
1786 void* (*SetupContext)(const char*, int, const char*);
1787 void (*FinishContext)(void**);
1788 } __Pyx_RefNannyAPIStruct;
1789 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1790 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1791 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1792 #ifdef WITH_THREAD
1793 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1794 if (acquire_gil) {\
1795 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1796 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1797 PyGILState_Release(__pyx_gilstate_save);\
1798 } else {\
1799 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1800 }
1801 #else
1802 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1803 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1804 #endif
1805 #define __Pyx_RefNannyFinishContext()\
1806 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1807 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1808 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1809 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1810 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1811 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1812 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1813 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1814 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1815 #else
1816 #define __Pyx_RefNannyDeclarations
1817 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1818 #define __Pyx_RefNannyFinishContext()
1819 #define __Pyx_INCREF(r) Py_INCREF(r)
1820 #define __Pyx_DECREF(r) Py_DECREF(r)
1821 #define __Pyx_GOTREF(r)
1822 #define __Pyx_GIVEREF(r)
1823 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1824 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1825 #define __Pyx_XGOTREF(r)
1826 #define __Pyx_XGIVEREF(r)
1827 #endif
1828 #define __Pyx_XDECREF_SET(r, v) do {\
1829 PyObject *tmp = (PyObject *) r;\
1830 r = v; __Pyx_XDECREF(tmp);\
1831 } while (0)
1832 #define __Pyx_DECREF_SET(r, v) do {\
1833 PyObject *tmp = (PyObject *) r;\
1834 r = v; __Pyx_DECREF(tmp);\
1835 } while (0)
1836 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1837 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1838
1839 /* PyObjectGetAttrStr.proto */
1840 #if CYTHON_USE_TYPE_SLOTS
1841 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1842 #else
1843 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1844 #endif
1845
1846 /* GetBuiltinName.proto */
1847 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1848
1849 /* RaiseDoubleKeywords.proto */
1850 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1851
1852 /* ParseKeywords.proto */
1853 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1854 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1855 const char* function_name);
1856
1857 /* RaiseArgTupleInvalid.proto */
1858 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1859 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1860
1861 /* ExtTypeTest.proto */
1862 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1863
1864 /* PyCFunctionFastCall.proto */
1865 #if CYTHON_FAST_PYCCALL
1866 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1867 #else
1868 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1869 #endif
1870
1871 /* PyFunctionFastCall.proto */
1872 #if CYTHON_FAST_PYCALL
1873 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1874 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1875 #if 1 || PY_VERSION_HEX < 0x030600B1
1876 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1877 #else
1878 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1879 #endif
1880 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1881 (sizeof(char [1 - 2*!(cond)]) - 1)
1882 #ifndef Py_MEMBER_SIZE
1883 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1884 #endif
1885 static size_t __pyx_pyframe_localsplus_offset = 0;
1886 #include "frameobject.h"
1887 #define __Pxy_PyFrame_Initialize_Offsets()\
1888 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1889 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1890 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1891 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1892 #endif
1893
1894 /* PyObjectCall.proto */
1895 #if CYTHON_COMPILING_IN_CPYTHON
1896 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1897 #else
1898 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1899 #endif
1900
1901 /* PyObjectCall2Args.proto */
1902 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1903
1904 /* PyObjectCallMethO.proto */
1905 #if CYTHON_COMPILING_IN_CPYTHON
1906 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1907 #endif
1908
1909 /* PyObjectCallOneArg.proto */
1910 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1911
1912 /* PyObjectCallNoArg.proto */
1913 #if CYTHON_COMPILING_IN_CPYTHON
1914 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1915 #else
1916 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1917 #endif
1918
1919 /* SliceObject.proto */
1920 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1921 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1922 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1923 int has_cstart, int has_cstop, int wraparound);
1924
1925 /* GetItemInt.proto */
1926 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1927 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1928 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1929 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1930 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1931 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1932 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1933 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1934 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1935 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1936 int wraparound, int boundscheck);
1937 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1938 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1939 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1940 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1941 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1942 int wraparound, int boundscheck);
1943 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1944 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1945 int is_list, int wraparound, int boundscheck);
1946
1947 /* ObjectGetItem.proto */
1948 #if CYTHON_USE_TYPE_SLOTS
1949 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1950 #else
1951 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1952 #endif
1953
1954 /* PyDictVersioning.proto */
1955 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1956 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1957 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1958 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1959 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1960 (cache_var) = (value);
1961 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1962 static PY_UINT64_T __pyx_dict_version = 0;\
1963 static PyObject *__pyx_dict_cached_value = NULL;\
1964 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1965 (VAR) = __pyx_dict_cached_value;\
1966 } else {\
1967 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1968 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1969 }\
1970 }
1971 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1972 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1973 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1974 #else
1975 #define __PYX_GET_DICT_VERSION(dict) (0)
1976 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1977 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1978 #endif
1979
1980 /* GetModuleGlobalName.proto */
1981 #if CYTHON_USE_DICT_VERSIONS
1982 #define __Pyx_GetModuleGlobalName(var, name) {\
1983 static PY_UINT64_T __pyx_dict_version = 0;\
1984 static PyObject *__pyx_dict_cached_value = NULL;\
1985 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1986 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1987 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1988 }
1989 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1990 PY_UINT64_T __pyx_dict_version;\
1991 PyObject *__pyx_dict_cached_value;\
1992 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1993 }
1994 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1995 #else
1996 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1997 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1998 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1999 #endif
2000
2001 /* py_abs.proto */
2002 #if CYTHON_USE_PYLONG_INTERNALS
2003 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
2004 #define __Pyx_PyNumber_Absolute(x)\
2005 ((likely(PyLong_CheckExact(x))) ?\
2006 (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
2007 PyNumber_Absolute(x))
2008 #else
2009 #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
2010 #endif
2011
2012 /* PyThreadStateGet.proto */
2013 #if CYTHON_FAST_THREAD_STATE
2014 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2015 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2016 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
2017 #else
2018 #define __Pyx_PyThreadState_declare
2019 #define __Pyx_PyThreadState_assign
2020 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
2021 #endif
2022
2023 /* PyErrFetchRestore.proto */
2024 #if CYTHON_FAST_THREAD_STATE
2025 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2026 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2027 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2028 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2029 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2030 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2031 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2032 #if CYTHON_COMPILING_IN_CPYTHON
2033 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2034 #else
2035 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2036 #endif
2037 #else
2038 #define __Pyx_PyErr_Clear() PyErr_Clear()
2039 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2040 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2041 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2042 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2043 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2044 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2045 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2046 #endif
2047
2048 /* RaiseException.proto */
2049 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2050
2051 /* DictGetItem.proto */
2052 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2053 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2054 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2055 (likely(PyDict_CheckExact(obj)) ?\
2056 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2057 #else
2058 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2059 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2060 #endif
2061
2062 /* RaiseTooManyValuesToUnpack.proto */
2063 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2064
2065 /* RaiseNeedMoreValuesToUnpack.proto */
2066 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2067
2068 /* RaiseNoneIterError.proto */
2069 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2070
2071 /* GetTopmostException.proto */
2072 #if CYTHON_USE_EXC_INFO_STACK
2073 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2074 #endif
2075
2076 /* SaveResetException.proto */
2077 #if CYTHON_FAST_THREAD_STATE
2078 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2079 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2080 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2081 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2082 #else
2083 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2084 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2085 #endif
2086
2087 /* PyErrExceptionMatches.proto */
2088 #if CYTHON_FAST_THREAD_STATE
2089 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2090 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2091 #else
2092 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2093 #endif
2094
2095 /* GetException.proto */
2096 #if CYTHON_FAST_THREAD_STATE
2097 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2098 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2099 #else
2100 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2101 #endif
2102
2103 /* CallNextTpDealloc.proto */
2104 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2105
2106 /* CallNextTpTraverse.proto */
2107 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2108
2109 /* CallNextTpClear.proto */
2110 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2111
2112 /* TypeImport.proto */
2113 #ifndef __PYX_HAVE_RT_ImportType_proto
2114 #define __PYX_HAVE_RT_ImportType_proto
2115 enum __Pyx_ImportType_CheckSize {
2116 __Pyx_ImportType_CheckSize_Error = 0,
2117 __Pyx_ImportType_CheckSize_Warn = 1,
2118 __Pyx_ImportType_CheckSize_Ignore = 2
2119 };
2120 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2121 #endif
2122
2123 /* GetVTable.proto */
2124 static void* __Pyx_GetVtable(PyObject *dict);
2125
2126 /* PyObject_GenericGetAttrNoDict.proto */
2127 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2128 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2129 #else
2130 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2131 #endif
2132
2133 /* PyObject_GenericGetAttr.proto */
2134 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2135 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2136 #else
2137 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2138 #endif
2139
2140 /* SetVTable.proto */
2141 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2142
2143 /* SetupReduce.proto */
2144 static int __Pyx_setup_reduce(PyObject* type_obj);
2145
2146 /* Import.proto */
2147 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2148
2149 /* CLineInTraceback.proto */
2150 #ifdef CYTHON_CLINE_IN_TRACEBACK
2151 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2152 #else
2153 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2154 #endif
2155
2156 /* CodeObjectCache.proto */
2157 typedef struct {
2158 PyCodeObject* code_object;
2159 int code_line;
2160 } __Pyx_CodeObjectCacheEntry;
2161 struct __Pyx_CodeObjectCache {
2162 int count;
2163 int max_count;
2164 __Pyx_CodeObjectCacheEntry* entries;
2165 };
2166 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2167 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2168 static PyCodeObject *__pyx_find_code_object(int code_line);
2169 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2170
2171 /* AddTraceback.proto */
2172 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2173 int py_line, const char *filename);
2174
2175 /* CIntToPy.proto */
2176 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2177
2178 /* CIntToPy.proto */
2179 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2180
2181 /* RealImag.proto */
2182 #if CYTHON_CCOMPLEX
2183 #ifdef __cplusplus
2184 #define __Pyx_CREAL(z) ((z).real())
2185 #define __Pyx_CIMAG(z) ((z).imag())
2186 #else
2187 #define __Pyx_CREAL(z) (__real__(z))
2188 #define __Pyx_CIMAG(z) (__imag__(z))
2189 #endif
2190 #else
2191 #define __Pyx_CREAL(z) ((z).real)
2192 #define __Pyx_CIMAG(z) ((z).imag)
2193 #endif
2194 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2195 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2196 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2197 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2198 #else
2199 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2200 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2201 #endif
2202
2203 /* Arithmetic.proto */
2204 #if CYTHON_CCOMPLEX
2205 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2206 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2207 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2208 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2209 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2210 #define __Pyx_c_neg_float(a) (-(a))
2211 #ifdef __cplusplus
2212 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2213 #define __Pyx_c_conj_float(z) (::std::conj(z))
2214 #if 1
2215 #define __Pyx_c_abs_float(z) (::std::abs(z))
2216 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2217 #endif
2218 #else
2219 #define __Pyx_c_is_zero_float(z) ((z)==0)
2220 #define __Pyx_c_conj_float(z) (conjf(z))
2221 #if 1
2222 #define __Pyx_c_abs_float(z) (cabsf(z))
2223 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2224 #endif
2225 #endif
2226 #else
2227 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2228 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2229 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2230 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2231 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2232 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2233 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2234 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2235 #if 1
2236 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2237 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2238 #endif
2239 #endif
2240
2241 /* Arithmetic.proto */
2242 #if CYTHON_CCOMPLEX
2243 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2244 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2245 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2246 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2247 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2248 #define __Pyx_c_neg_double(a) (-(a))
2249 #ifdef __cplusplus
2250 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2251 #define __Pyx_c_conj_double(z) (::std::conj(z))
2252 #if 1
2253 #define __Pyx_c_abs_double(z) (::std::abs(z))
2254 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2255 #endif
2256 #else
2257 #define __Pyx_c_is_zero_double(z) ((z)==0)
2258 #define __Pyx_c_conj_double(z) (conj(z))
2259 #if 1
2260 #define __Pyx_c_abs_double(z) (cabs(z))
2261 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2262 #endif
2263 #endif
2264 #else
2265 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2266 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2267 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2268 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2269 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2270 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2271 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2272 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2273 #if 1
2274 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2275 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2276 #endif
2277 #endif
2278
2279 /* CIntToPy.proto */
2280 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2281
2282 /* CIntFromPy.proto */
2283 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2284
2285 /* CIntFromPy.proto */
2286 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2287
2288 /* FastTypeChecks.proto */
2289 #if CYTHON_COMPILING_IN_CPYTHON
2290 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2291 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2292 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2293 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2294 #else
2295 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2296 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2297 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2298 #endif
2299 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2300
2301 /* CheckBinaryVersion.proto */
2302 static int __Pyx_check_binary_version(void);
2303
2304 /* FunctionImport.proto */
2305 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2306
2307 /* InitStrings.proto */
2308 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2309
2310 static PyObject *__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_pivotColumn(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, ICoinIndexedVector *__pyx_v_cppupdates, ICoinIndexedVector *__pyx_v_cppspareRow1, ICoinIndexedVector *__pyx_v_cppspareRow2, ICoinIndexedVector *__pyx_v_cppspareCol1, ICoinIndexedVector *__pyx_v_cppspareCol2); /* proto*/
2311 static ClpPrimalColumnPivot *__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_clone(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, CYTHON_UNUSED int __pyx_v_copyData); /* proto*/
2312 static void __pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_saveWeights(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, IClpSimplex *__pyx_v_model, CYTHON_UNUSED int __pyx_v_mode); /* proto*/
2313
2314 /* Module declarations from 'libc.string' */
2315
2316 /* Module declarations from 'libc.stdio' */
2317
2318 /* Module declarations from '__builtin__' */
2319
2320 /* Module declarations from 'cpython.type' */
2321 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2322
2323 /* Module declarations from 'cpython.version' */
2324
2325 /* Module declarations from 'cpython.exc' */
2326
2327 /* Module declarations from 'cpython.module' */
2328
2329 /* Module declarations from 'cpython.mem' */
2330
2331 /* Module declarations from 'cpython.tuple' */
2332
2333 /* Module declarations from 'cpython.list' */
2334
2335 /* Module declarations from 'cpython.sequence' */
2336
2337 /* Module declarations from 'cpython.mapping' */
2338
2339 /* Module declarations from 'cpython.iterator' */
2340
2341 /* Module declarations from 'cpython.number' */
2342
2343 /* Module declarations from 'cpython.int' */
2344
2345 /* Module declarations from '__builtin__' */
2346
2347 /* Module declarations from 'cpython.bool' */
2348 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
2349
2350 /* Module declarations from 'cpython.long' */
2351
2352 /* Module declarations from 'cpython.float' */
2353
2354 /* Module declarations from '__builtin__' */
2355
2356 /* Module declarations from 'cpython.complex' */
2357 static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
2358
2359 /* Module declarations from 'cpython.string' */
2360
2361 /* Module declarations from 'cpython.unicode' */
2362
2363 /* Module declarations from 'cpython.dict' */
2364
2365 /* Module declarations from 'cpython.instance' */
2366
2367 /* Module declarations from 'cpython.function' */
2368
2369 /* Module declarations from 'cpython.method' */
2370
2371 /* Module declarations from 'cpython.weakref' */
2372
2373 /* Module declarations from 'cpython.getargs' */
2374
2375 /* Module declarations from 'cpython.pythread' */
2376
2377 /* Module declarations from 'cpython.pystate' */
2378
2379 /* Module declarations from 'cpython.cobject' */
2380
2381 /* Module declarations from 'cpython.oldbuffer' */
2382
2383 /* Module declarations from 'cpython.set' */
2384
2385 /* Module declarations from 'cpython.buffer' */
2386
2387 /* Module declarations from 'cpython.bytes' */
2388
2389 /* Module declarations from 'cpython.pycapsule' */
2390
2391 /* Module declarations from 'cpython' */
2392
2393 /* Module declarations from 'cpython.object' */
2394
2395 /* Module declarations from 'cpython.ref' */
2396
2397 /* Module declarations from 'cylp.cy' */
2398
2399 /* Module declarations from 'cylp.cy.CyCoinIndexedVector' */
2400 static PyTypeObject *__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector = 0;
2401
2402 /* Module declarations from 'numpy' */
2403
2404 /* Module declarations from 'numpy' */
2405 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2406 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2407 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2408 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2409 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2410 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2411
2412 /* Module declarations from 'cylp.cy.CyClpDualRowPivotBase' */
2413 static PyTypeObject *__pyx_ptype_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase = 0;
2414
2415 /* Module declarations from 'cylp.cy.CyCoinModel' */
2416 static PyTypeObject *__pyx_ptype_4cylp_2cy_11CyCoinModel_CyCoinModel = 0;
2417
2418 /* Module declarations from 'cylp.cy.CyCoinPackedMatrix' */
2419 static PyTypeObject *__pyx_ptype_4cylp_2cy_18CyCoinPackedMatrix_CyCoinPackedMatrix = 0;
2420
2421 /* Module declarations from 'cylp.cy.CyCgl' */
2422 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglCutGenerator = 0;
2423 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglAllDifferent = 0;
2424 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglClique = 0;
2425 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglKnapsackCover = 0;
2426 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglOddHole = 0;
2427 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglFlowCover = 0;
2428 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglGomory = 0;
2429 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglRedSplit = 0;
2430 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglLiftAndProject = 0;
2431 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglLandP = 0;
2432 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding = 0;
2433 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding2 = 0;
2434 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglTwomir = 0;
2435 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglResidualCapacity = 0;
2436 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglPreProcess = 0;
2437 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglProbing = 0;
2438 static PyTypeObject *__pyx_ptype_4cylp_2cy_5CyCgl_CyCglSimpleRounding = 0;
2439
2440 /* Module declarations from 'cylp.cy.CyCbcNode' */
2441 static PyTypeObject *__pyx_ptype_4cylp_2cy_9CyCbcNode_CyCbcNode = 0;
2442
2443 /* Module declarations from 'cylp.cy.CyOsiSolverInterface' */
2444 static PyTypeObject *__pyx_ptype_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface = 0;
2445
2446 /* Module declarations from 'cylp.cy.CyCbcModel' */
2447 static PyTypeObject *__pyx_ptype_4cylp_2cy_10CyCbcModel_CyCbcModel = 0;
2448
2449 /* Module declarations from 'libcpp.string' */
2450
2451 /* Module declarations from 'libcpp.vector' */
2452
2453 /* Module declarations from 'cylp.cy.CyClpSimplex' */
2454 static PyTypeObject *__pyx_ptype_4cylp_2cy_12CyClpSimplex_CyClpSimplex = 0;
2455 static PyTypeObject *__pyx_ptype_4cylp_2cy_12CyClpSimplex_VarStatus = 0;
2456
2457 /* Module declarations from 'cylp.cy.CyClpPrimalColumnPivotBase' */
2458 static PyTypeObject *__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase = 0;
2459 static int (*__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunPivotColumn)(void *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *); /*proto*/
2460 static ClpPrimalColumnPivot *(*__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunClone)(void *, int); /*proto*/
2461 static void (*__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunSaveWeights)(void *, IClpSimplex *, int); /*proto*/
2462
2463 /* Module declarations from 'cylp.cy.CyPEPivot' */
2464 static PyTypeObject *__pyx_ptype_4cylp_2cy_9CyPEPivot_CyPEPivot = 0;
2465 #define __Pyx_MODULE_NAME "cylp.cy.CyPEPivot"
2466 extern int __pyx_module_is_main_cylp__cy__CyPEPivot;
2467 int __pyx_module_is_main_cylp__cy__CyPEPivot = 0;
2468
2469 /* Implementation of 'cylp.cy.CyPEPivot' */
2470 static PyObject *__pyx_builtin_xrange;
2471 static PyObject *__pyx_builtin_print;
2472 static PyObject *__pyx_builtin_TypeError;
2473 static PyObject *__pyx_builtin_ValueError;
2474 static PyObject *__pyx_builtin_range;
2475 static PyObject *__pyx_builtin_RuntimeError;
2476 static PyObject *__pyx_builtin_ImportError;
2477 static const char __pyx_k_np[] = "np";
2478 static const char __pyx_k_init[] = "__init__";
2479 static const char __pyx_k_main[] = "__main__";
2480 static const char __pyx_k_name[] = "__name__";
2481 static const char __pyx_k_test[] = "__test__";
2482 static const char __pyx_k_clear[] = "clear";
2483 static const char __pyx_k_numpy[] = "numpy";
2484 static const char __pyx_k_print[] = "print";
2485 static const char __pyx_k_range[] = "range";
2486 static const char __pyx_k_where[] = "where";
2487 static const char __pyx_k_import[] = "__import__";
2488 static const char __pyx_k_reduce[] = "__reduce__";
2489 static const char __pyx_k_xrange[] = "xrange";
2490 static const char __pyx_k_cyModel[] = "cyModel";
2491 static const char __pyx_k_indices[] = "indices";
2492 static const char __pyx_k_updateP[] = "updateP";
2493 static const char __pyx_k_updateW[] = "updateW";
2494 static const char __pyx_k_elements[] = "elements";
2495 static const char __pyx_k_getstate[] = "__getstate__";
2496 static const char __pyx_k_setstate[] = "__setstate__";
2497 static const char __pyx_k_CyPEPivot[] = "CyPEPivot";
2498 static const char __pyx_k_TypeError[] = "TypeError";
2499 static const char __pyx_k_iteration[] = "iteration";
2500 static const char __pyx_k_nElements[] = "nElements";
2501 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2502 static const char __pyx_k_varIsFree[] = "varIsFree";
2503 static const char __pyx_k_ValueError[] = "ValueError";
2504 static const char __pyx_k_nVariables[] = "nVariables";
2505 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2506 static const char __pyx_k_ImportError[] = "ImportError";
2507 static const char __pyx_k_varNotBasic[] = "varNotBasic";
2508 static const char __pyx_k_varNotFixed[] = "varNotFixed";
2509 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2510 static const char __pyx_k_isCompatible[] = "isCompatible";
2511 static const char __pyx_k_reducedCosts[] = "reducedCosts";
2512 static const char __pyx_k_comp_selected[] = " : comp selected";
2513 static const char __pyx_k_dualTolerance[] = "dualTolerance";
2514 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2515 static const char __pyx_k_varNotFlagged[] = "varNotFlagged";
2516 static const char __pyx_k_transposeTimes[] = "transposeTimes";
2517 static const char __pyx_k_incomp_selected[] = " : incomp selected";
2518 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2519 static const char __pyx_k_varIsAtLowerBound[] = "varIsAtLowerBound";
2520 static const char __pyx_k_varIsAtUpperBound[] = "varIsAtUpperBound";
2521 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2522 static const char __pyx_k_updateColumnTranspose[] = "updateColumnTranspose";
2523 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2524 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2525 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2526 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2527 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2528 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2529 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2530 static const char __pyx_k_self_CppSelf_cannot_be_converted[] = "self.CppSelf cannot be converted to a Python object for pickling";
2531 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2532 static PyObject *__pyx_n_s_CyPEPivot;
2533 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2534 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2535 static PyObject *__pyx_n_s_ImportError;
2536 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2537 static PyObject *__pyx_n_s_RuntimeError;
2538 static PyObject *__pyx_n_s_TypeError;
2539 static PyObject *__pyx_n_s_ValueError;
2540 static PyObject *__pyx_n_s_clear;
2541 static PyObject *__pyx_n_s_cline_in_traceback;
2542 static PyObject *__pyx_kp_s_comp_selected;
2543 static PyObject *__pyx_n_s_cyModel;
2544 static PyObject *__pyx_n_s_dualTolerance;
2545 static PyObject *__pyx_n_s_elements;
2546 static PyObject *__pyx_n_s_getstate;
2547 static PyObject *__pyx_n_s_import;
2548 static PyObject *__pyx_kp_s_incomp_selected;
2549 static PyObject *__pyx_n_s_indices;
2550 static PyObject *__pyx_n_s_init;
2551 static PyObject *__pyx_n_s_isCompatible;
2552 static PyObject *__pyx_n_s_iteration;
2553 static PyObject *__pyx_n_s_main;
2554 static PyObject *__pyx_n_s_nElements;
2555 static PyObject *__pyx_n_s_nVariables;
2556 static PyObject *__pyx_n_s_name;
2557 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2558 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2559 static PyObject *__pyx_n_s_np;
2560 static PyObject *__pyx_n_s_numpy;
2561 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2562 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2563 static PyObject *__pyx_n_s_print;
2564 static PyObject *__pyx_n_s_pyx_vtable;
2565 static PyObject *__pyx_n_s_range;
2566 static PyObject *__pyx_n_s_reduce;
2567 static PyObject *__pyx_n_s_reduce_cython;
2568 static PyObject *__pyx_n_s_reduce_ex;
2569 static PyObject *__pyx_n_s_reducedCosts;
2570 static PyObject *__pyx_kp_s_self_CppSelf_cannot_be_converted;
2571 static PyObject *__pyx_n_s_setstate;
2572 static PyObject *__pyx_n_s_setstate_cython;
2573 static PyObject *__pyx_n_s_test;
2574 static PyObject *__pyx_n_s_transposeTimes;
2575 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2576 static PyObject *__pyx_n_s_updateColumnTranspose;
2577 static PyObject *__pyx_n_s_updateP;
2578 static PyObject *__pyx_n_s_updateW;
2579 static PyObject *__pyx_n_s_varIsAtLowerBound;
2580 static PyObject *__pyx_n_s_varIsAtUpperBound;
2581 static PyObject *__pyx_n_s_varIsFree;
2582 static PyObject *__pyx_n_s_varNotBasic;
2583 static PyObject *__pyx_n_s_varNotFixed;
2584 static PyObject *__pyx_n_s_varNotFlagged;
2585 static PyObject *__pyx_n_s_where;
2586 static PyObject *__pyx_n_s_xrange;
2587 static int __pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot___init__(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, PyObject *__pyx_v_cyModel); /* proto */
2588 static PyObject *__pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self); /* proto */
2589 static PyObject *__pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2590 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2591 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2592 static PyObject *__pyx_tp_new_4cylp_2cy_9CyPEPivot_CyPEPivot(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2593 static PyObject *__pyx_int_neg_1;
2594 static PyObject *__pyx_tuple_;
2595 static PyObject *__pyx_tuple__2;
2596 static PyObject *__pyx_tuple__3;
2597 static PyObject *__pyx_tuple__4;
2598 static PyObject *__pyx_tuple__5;
2599 static PyObject *__pyx_tuple__6;
2600 static PyObject *__pyx_tuple__7;
2601 static PyObject *__pyx_tuple__8;
2602 static PyObject *__pyx_tuple__9;
2603 /* Late includes */
2604
2605 /* "cylp/cy/CyPEPivot.pyx":12
2606 *
2607 * cdef class CyPEPivot(CyClpPrimalColumnPivotBase):
2608 * def __init__(self, cyModel): # <<<<<<<<<<<<<<
2609 * self.cyModel = cyModel
2610 * CyClpPrimalColumnPivotBase.__init__(self)
2611 */
2612
2613 /* Python wrapper */
2614 static int __pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2615 static int __pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2616 PyObject *__pyx_v_cyModel = 0;
2617 int __pyx_r;
2618 __Pyx_RefNannyDeclarations
2619 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2620 {
2621 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cyModel,0};
2622 PyObject* values[1] = {0};
2623 if (unlikely(__pyx_kwds)) {
2624 Py_ssize_t kw_args;
2625 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2626 switch (pos_args) {
2627 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2628 CYTHON_FALLTHROUGH;
2629 case 0: break;
2630 default: goto __pyx_L5_argtuple_error;
2631 }
2632 kw_args = PyDict_Size(__pyx_kwds);
2633 switch (pos_args) {
2634 case 0:
2635 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cyModel)) != 0)) kw_args--;
2636 else goto __pyx_L5_argtuple_error;
2637 }
2638 if (unlikely(kw_args > 0)) {
2639 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 12, __pyx_L3_error)
2640 }
2641 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2642 goto __pyx_L5_argtuple_error;
2643 } else {
2644 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2645 }
2646 __pyx_v_cyModel = values[0];
2647 }
2648 goto __pyx_L4_argument_unpacking_done;
2649 __pyx_L5_argtuple_error:;
2650 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 12, __pyx_L3_error)
2651 __pyx_L3_error:;
2652 __Pyx_AddTraceback("cylp.cy.CyPEPivot.CyPEPivot.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2653 __Pyx_RefNannyFinishContext();
2654 return -1;
2655 __pyx_L4_argument_unpacking_done:;
2656 __pyx_r = __pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot___init__(((struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *)__pyx_v_self), __pyx_v_cyModel);
2657
2658 /* function exit code */
2659 __Pyx_RefNannyFinishContext();
2660 return __pyx_r;
2661 }
2662
__pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot___init__(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot * __pyx_v_self,PyObject * __pyx_v_cyModel)2663 static int __pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot___init__(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, PyObject *__pyx_v_cyModel) {
2664 int __pyx_r;
2665 __Pyx_RefNannyDeclarations
2666 PyObject *__pyx_t_1 = NULL;
2667 PyObject *__pyx_t_2 = NULL;
2668 PyObject *__pyx_t_3 = NULL;
2669 __Pyx_RefNannySetupContext("__init__", 0);
2670
2671 /* "cylp/cy/CyPEPivot.pyx":13
2672 * cdef class CyPEPivot(CyClpPrimalColumnPivotBase):
2673 * def __init__(self, cyModel):
2674 * self.cyModel = cyModel # <<<<<<<<<<<<<<
2675 * CyClpPrimalColumnPivotBase.__init__(self)
2676 *
2677 */
2678 if (!(likely(((__pyx_v_cyModel) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cyModel, __pyx_ptype_4cylp_2cy_12CyClpSimplex_CyClpSimplex))))) __PYX_ERR(0, 13, __pyx_L1_error)
2679 __pyx_t_1 = __pyx_v_cyModel;
2680 __Pyx_INCREF(__pyx_t_1);
2681 __Pyx_GIVEREF(__pyx_t_1);
2682 __Pyx_GOTREF(__pyx_v_self->__pyx_base.cyModel);
2683 __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.cyModel));
2684 __pyx_v_self->__pyx_base.cyModel = ((struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *)__pyx_t_1);
2685 __pyx_t_1 = 0;
2686
2687 /* "cylp/cy/CyPEPivot.pyx":14
2688 * def __init__(self, cyModel):
2689 * self.cyModel = cyModel
2690 * CyClpPrimalColumnPivotBase.__init__(self) # <<<<<<<<<<<<<<
2691 *
2692 * cdef pivotColumn(self, CppCoinIndexedVector* cppupdates, CppCoinIndexedVector* cppspareRow1,
2693 */
2694 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
2695 __Pyx_GOTREF(__pyx_t_2);
2696 __pyx_t_3 = NULL;
2697 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2698 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2699 if (likely(__pyx_t_3)) {
2700 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2701 __Pyx_INCREF(__pyx_t_3);
2702 __Pyx_INCREF(function);
2703 __Pyx_DECREF_SET(__pyx_t_2, function);
2704 }
2705 }
2706 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
2707 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2708 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
2709 __Pyx_GOTREF(__pyx_t_1);
2710 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2712
2713 /* "cylp/cy/CyPEPivot.pyx":12
2714 *
2715 * cdef class CyPEPivot(CyClpPrimalColumnPivotBase):
2716 * def __init__(self, cyModel): # <<<<<<<<<<<<<<
2717 * self.cyModel = cyModel
2718 * CyClpPrimalColumnPivotBase.__init__(self)
2719 */
2720
2721 /* function exit code */
2722 __pyx_r = 0;
2723 goto __pyx_L0;
2724 __pyx_L1_error:;
2725 __Pyx_XDECREF(__pyx_t_1);
2726 __Pyx_XDECREF(__pyx_t_2);
2727 __Pyx_XDECREF(__pyx_t_3);
2728 __Pyx_AddTraceback("cylp.cy.CyPEPivot.CyPEPivot.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2729 __pyx_r = -1;
2730 __pyx_L0:;
2731 __Pyx_RefNannyFinishContext();
2732 return __pyx_r;
2733 }
2734
2735 /* "cylp/cy/CyPEPivot.pyx":16
2736 * CyClpPrimalColumnPivotBase.__init__(self)
2737 *
2738 * cdef pivotColumn(self, CppCoinIndexedVector* cppupdates, CppCoinIndexedVector* cppspareRow1, # <<<<<<<<<<<<<<
2739 * CppCoinIndexedVector* cppspareRow2, CppCoinIndexedVector* cppspareCol1,
2740 * CppCoinIndexedVector* cppspareCol2):
2741 */
2742
__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_pivotColumn(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot * __pyx_v_self,ICoinIndexedVector * __pyx_v_cppupdates,ICoinIndexedVector * __pyx_v_cppspareRow1,ICoinIndexedVector * __pyx_v_cppspareRow2,ICoinIndexedVector * __pyx_v_cppspareCol1,ICoinIndexedVector * __pyx_v_cppspareCol2)2743 static PyObject *__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_pivotColumn(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, ICoinIndexedVector *__pyx_v_cppupdates, ICoinIndexedVector *__pyx_v_cppspareRow1, ICoinIndexedVector *__pyx_v_cppspareRow2, ICoinIndexedVector *__pyx_v_cppspareCol1, ICoinIndexedVector *__pyx_v_cppspareCol2) {
2744 struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *__pyx_v_updates = NULL;
2745 struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *__pyx_v_spareRow1 = NULL;
2746 struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *__pyx_v_spareRow2 = NULL;
2747 struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *__pyx_v_spareCol1 = NULL;
2748 struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *__pyx_v_spareCol2 = NULL;
2749 struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *__pyx_v_s = NULL;
2750 PyObject *__pyx_v_rc = NULL;
2751 double __pyx_v_tol;
2752 PyObject *__pyx_v_indicesToConsider = NULL;
2753 PyObject *__pyx_v_rc2 = NULL;
2754 double __pyx_v_maxRc;
2755 int __pyx_v_maxInd;
2756 double __pyx_v_maxCompRc;
2757 int __pyx_v_maxCompInd;
2758 int __pyx_v_ind;
2759 Py_ssize_t __pyx_v_i;
2760 PyObject *__pyx_r = NULL;
2761 __Pyx_RefNannyDeclarations
2762 PyObject *__pyx_t_1 = NULL;
2763 int __pyx_t_2;
2764 PyObject *__pyx_t_3 = NULL;
2765 PyObject *__pyx_t_4 = NULL;
2766 int __pyx_t_5;
2767 PyObject *__pyx_t_6 = NULL;
2768 PyObject *__pyx_t_7 = NULL;
2769 PyObject *__pyx_t_8 = NULL;
2770 double __pyx_t_9;
2771 PyObject *__pyx_t_10 = NULL;
2772 Py_ssize_t __pyx_t_11;
2773 Py_ssize_t __pyx_t_12;
2774 Py_ssize_t __pyx_t_13;
2775 int __pyx_t_14;
2776 __Pyx_RefNannySetupContext("pivotColumn", 0);
2777
2778 /* "cylp/cy/CyPEPivot.pyx":19
2779 * CppCoinIndexedVector* cppspareRow2, CppCoinIndexedVector* cppspareCol1,
2780 * CppCoinIndexedVector* cppspareCol2):
2781 * updates = CyCoinIndexedVector() # <<<<<<<<<<<<<<
2782 * updates.setCppSelf(cppupdates)
2783 * spareRow1 = CyCoinIndexedVector()
2784 */
2785 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
2786 __Pyx_GOTREF(__pyx_t_1);
2787 __pyx_v_updates = ((struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_t_1);
2788 __pyx_t_1 = 0;
2789
2790 /* "cylp/cy/CyPEPivot.pyx":20
2791 * CppCoinIndexedVector* cppspareCol2):
2792 * updates = CyCoinIndexedVector()
2793 * updates.setCppSelf(cppupdates) # <<<<<<<<<<<<<<
2794 * spareRow1 = CyCoinIndexedVector()
2795 * spareRow1.setCppSelf(cppspareRow1)
2796 */
2797 __pyx_t_1 = ((struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_v_updates->__pyx_vtab)->setCppSelf(__pyx_v_updates, __pyx_v_cppupdates); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
2798 __Pyx_GOTREF(__pyx_t_1);
2799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2800
2801 /* "cylp/cy/CyPEPivot.pyx":21
2802 * updates = CyCoinIndexedVector()
2803 * updates.setCppSelf(cppupdates)
2804 * spareRow1 = CyCoinIndexedVector() # <<<<<<<<<<<<<<
2805 * spareRow1.setCppSelf(cppspareRow1)
2806 * spareRow2 = CyCoinIndexedVector()
2807 */
2808 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
2809 __Pyx_GOTREF(__pyx_t_1);
2810 __pyx_v_spareRow1 = ((struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_t_1);
2811 __pyx_t_1 = 0;
2812
2813 /* "cylp/cy/CyPEPivot.pyx":22
2814 * updates.setCppSelf(cppupdates)
2815 * spareRow1 = CyCoinIndexedVector()
2816 * spareRow1.setCppSelf(cppspareRow1) # <<<<<<<<<<<<<<
2817 * spareRow2 = CyCoinIndexedVector()
2818 * spareRow2.setCppSelf(cppspareRow2)
2819 */
2820 __pyx_t_1 = ((struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_v_spareRow1->__pyx_vtab)->setCppSelf(__pyx_v_spareRow1, __pyx_v_cppspareRow1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
2821 __Pyx_GOTREF(__pyx_t_1);
2822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2823
2824 /* "cylp/cy/CyPEPivot.pyx":23
2825 * spareRow1 = CyCoinIndexedVector()
2826 * spareRow1.setCppSelf(cppspareRow1)
2827 * spareRow2 = CyCoinIndexedVector() # <<<<<<<<<<<<<<
2828 * spareRow2.setCppSelf(cppspareRow2)
2829 * spareCol1 = CyCoinIndexedVector()
2830 */
2831 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
2832 __Pyx_GOTREF(__pyx_t_1);
2833 __pyx_v_spareRow2 = ((struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_t_1);
2834 __pyx_t_1 = 0;
2835
2836 /* "cylp/cy/CyPEPivot.pyx":24
2837 * spareRow1.setCppSelf(cppspareRow1)
2838 * spareRow2 = CyCoinIndexedVector()
2839 * spareRow2.setCppSelf(cppspareRow2) # <<<<<<<<<<<<<<
2840 * spareCol1 = CyCoinIndexedVector()
2841 * spareCol1.setCppSelf(cppspareCol1)
2842 */
2843 __pyx_t_1 = ((struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_v_spareRow2->__pyx_vtab)->setCppSelf(__pyx_v_spareRow2, __pyx_v_cppspareRow2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
2844 __Pyx_GOTREF(__pyx_t_1);
2845 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2846
2847 /* "cylp/cy/CyPEPivot.pyx":25
2848 * spareRow2 = CyCoinIndexedVector()
2849 * spareRow2.setCppSelf(cppspareRow2)
2850 * spareCol1 = CyCoinIndexedVector() # <<<<<<<<<<<<<<
2851 * spareCol1.setCppSelf(cppspareCol1)
2852 * spareCol2 = CyCoinIndexedVector()
2853 */
2854 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
2855 __Pyx_GOTREF(__pyx_t_1);
2856 __pyx_v_spareCol1 = ((struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_t_1);
2857 __pyx_t_1 = 0;
2858
2859 /* "cylp/cy/CyPEPivot.pyx":26
2860 * spareRow2.setCppSelf(cppspareRow2)
2861 * spareCol1 = CyCoinIndexedVector()
2862 * spareCol1.setCppSelf(cppspareCol1) # <<<<<<<<<<<<<<
2863 * spareCol2 = CyCoinIndexedVector()
2864 * spareCol2.setCppSelf(cppspareCol2)
2865 */
2866 __pyx_t_1 = ((struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_v_spareCol1->__pyx_vtab)->setCppSelf(__pyx_v_spareCol1, __pyx_v_cppspareCol1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
2867 __Pyx_GOTREF(__pyx_t_1);
2868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2869
2870 /* "cylp/cy/CyPEPivot.pyx":27
2871 * spareCol1 = CyCoinIndexedVector()
2872 * spareCol1.setCppSelf(cppspareCol1)
2873 * spareCol2 = CyCoinIndexedVector() # <<<<<<<<<<<<<<
2874 * spareCol2.setCppSelf(cppspareCol2)
2875 *
2876 */
2877 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
2878 __Pyx_GOTREF(__pyx_t_1);
2879 __pyx_v_spareCol2 = ((struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_t_1);
2880 __pyx_t_1 = 0;
2881
2882 /* "cylp/cy/CyPEPivot.pyx":28
2883 * spareCol1.setCppSelf(cppspareCol1)
2884 * spareCol2 = CyCoinIndexedVector()
2885 * spareCol2.setCppSelf(cppspareCol2) # <<<<<<<<<<<<<<
2886 *
2887 * s = self.cyModel
2888 */
2889 __pyx_t_1 = ((struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector *)__pyx_v_spareCol2->__pyx_vtab)->setCppSelf(__pyx_v_spareCol2, __pyx_v_cppspareCol2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2890 __Pyx_GOTREF(__pyx_t_1);
2891 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2892
2893 /* "cylp/cy/CyPEPivot.pyx":30
2894 * spareCol2.setCppSelf(cppspareCol2)
2895 *
2896 * s = self.cyModel # <<<<<<<<<<<<<<
2897 *
2898 * # Update the reduced costs, for both the original and the slack variables
2899 */
2900 __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.cyModel);
2901 __Pyx_INCREF(__pyx_t_1);
2902 __pyx_v_s = ((struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex *)__pyx_t_1);
2903 __pyx_t_1 = 0;
2904
2905 /* "cylp/cy/CyPEPivot.pyx":33
2906 *
2907 * # Update the reduced costs, for both the original and the slack variables
2908 * if updates.nElements: # <<<<<<<<<<<<<<
2909 * s.updateColumnTranspose(spareRow2, updates)
2910 * s.transposeTimes(-1, updates, spareCol2, spareCol1)
2911 */
2912 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_updates), __pyx_n_s_nElements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
2913 __Pyx_GOTREF(__pyx_t_1);
2914 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 33, __pyx_L1_error)
2915 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2916 if (__pyx_t_2) {
2917
2918 /* "cylp/cy/CyPEPivot.pyx":34
2919 * # Update the reduced costs, for both the original and the slack variables
2920 * if updates.nElements:
2921 * s.updateColumnTranspose(spareRow2, updates) # <<<<<<<<<<<<<<
2922 * s.transposeTimes(-1, updates, spareCol2, spareCol1)
2923 * s.reducedCosts[s.nVariables:][updates.indices] -= updates.elements[:updates.nElements]
2924 */
2925 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_updateColumnTranspose); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
2926 __Pyx_GOTREF(__pyx_t_3);
2927 __pyx_t_4 = NULL;
2928 __pyx_t_5 = 0;
2929 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2930 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2931 if (likely(__pyx_t_4)) {
2932 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2933 __Pyx_INCREF(__pyx_t_4);
2934 __Pyx_INCREF(function);
2935 __Pyx_DECREF_SET(__pyx_t_3, function);
2936 __pyx_t_5 = 1;
2937 }
2938 }
2939 #if CYTHON_FAST_PYCALL
2940 if (PyFunction_Check(__pyx_t_3)) {
2941 PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_spareRow2), ((PyObject *)__pyx_v_updates)};
2942 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
2943 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2944 __Pyx_GOTREF(__pyx_t_1);
2945 } else
2946 #endif
2947 #if CYTHON_FAST_PYCCALL
2948 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2949 PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_spareRow2), ((PyObject *)__pyx_v_updates)};
2950 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
2951 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2952 __Pyx_GOTREF(__pyx_t_1);
2953 } else
2954 #endif
2955 {
2956 __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error)
2957 __Pyx_GOTREF(__pyx_t_6);
2958 if (__pyx_t_4) {
2959 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
2960 }
2961 __Pyx_INCREF(((PyObject *)__pyx_v_spareRow2));
2962 __Pyx_GIVEREF(((PyObject *)__pyx_v_spareRow2));
2963 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_spareRow2));
2964 __Pyx_INCREF(((PyObject *)__pyx_v_updates));
2965 __Pyx_GIVEREF(((PyObject *)__pyx_v_updates));
2966 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_updates));
2967 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
2968 __Pyx_GOTREF(__pyx_t_1);
2969 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2970 }
2971 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2972 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2973
2974 /* "cylp/cy/CyPEPivot.pyx":35
2975 * if updates.nElements:
2976 * s.updateColumnTranspose(spareRow2, updates)
2977 * s.transposeTimes(-1, updates, spareCol2, spareCol1) # <<<<<<<<<<<<<<
2978 * s.reducedCosts[s.nVariables:][updates.indices] -= updates.elements[:updates.nElements]
2979 * s.reducedCosts[:s.nVariables][spareCol1.indices] -= spareCol1.elements[:spareCol1.nElements]
2980 */
2981 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_transposeTimes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
2982 __Pyx_GOTREF(__pyx_t_3);
2983 __pyx_t_6 = NULL;
2984 __pyx_t_5 = 0;
2985 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2986 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
2987 if (likely(__pyx_t_6)) {
2988 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2989 __Pyx_INCREF(__pyx_t_6);
2990 __Pyx_INCREF(function);
2991 __Pyx_DECREF_SET(__pyx_t_3, function);
2992 __pyx_t_5 = 1;
2993 }
2994 }
2995 #if CYTHON_FAST_PYCALL
2996 if (PyFunction_Check(__pyx_t_3)) {
2997 PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_int_neg_1, ((PyObject *)__pyx_v_updates), ((PyObject *)__pyx_v_spareCol2), ((PyObject *)__pyx_v_spareCol1)};
2998 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
2999 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3000 __Pyx_GOTREF(__pyx_t_1);
3001 } else
3002 #endif
3003 #if CYTHON_FAST_PYCCALL
3004 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3005 PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_int_neg_1, ((PyObject *)__pyx_v_updates), ((PyObject *)__pyx_v_spareCol2), ((PyObject *)__pyx_v_spareCol1)};
3006 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
3007 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3008 __Pyx_GOTREF(__pyx_t_1);
3009 } else
3010 #endif
3011 {
3012 __pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3013 __Pyx_GOTREF(__pyx_t_4);
3014 if (__pyx_t_6) {
3015 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
3016 }
3017 __Pyx_INCREF(__pyx_int_neg_1);
3018 __Pyx_GIVEREF(__pyx_int_neg_1);
3019 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_int_neg_1);
3020 __Pyx_INCREF(((PyObject *)__pyx_v_updates));
3021 __Pyx_GIVEREF(((PyObject *)__pyx_v_updates));
3022 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, ((PyObject *)__pyx_v_updates));
3023 __Pyx_INCREF(((PyObject *)__pyx_v_spareCol2));
3024 __Pyx_GIVEREF(((PyObject *)__pyx_v_spareCol2));
3025 PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, ((PyObject *)__pyx_v_spareCol2));
3026 __Pyx_INCREF(((PyObject *)__pyx_v_spareCol1));
3027 __Pyx_GIVEREF(((PyObject *)__pyx_v_spareCol1));
3028 PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, ((PyObject *)__pyx_v_spareCol1));
3029 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
3030 __Pyx_GOTREF(__pyx_t_1);
3031 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3032 }
3033 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3035
3036 /* "cylp/cy/CyPEPivot.pyx":36
3037 * s.updateColumnTranspose(spareRow2, updates)
3038 * s.transposeTimes(-1, updates, spareCol2, spareCol1)
3039 * s.reducedCosts[s.nVariables:][updates.indices] -= updates.elements[:updates.nElements] # <<<<<<<<<<<<<<
3040 * s.reducedCosts[:s.nVariables][spareCol1.indices] -= spareCol1.elements[:spareCol1.nElements]
3041 * updates.clear()
3042 */
3043 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_reducedCosts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
3044 __Pyx_GOTREF(__pyx_t_1);
3045 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_nVariables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
3046 __Pyx_GOTREF(__pyx_t_3);
3047 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_t_3, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
3048 __Pyx_GOTREF(__pyx_t_4);
3049 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3050 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3051 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_updates), __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
3052 __Pyx_GOTREF(__pyx_t_3);
3053 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
3054 __Pyx_GOTREF(__pyx_t_1);
3055 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_updates), __pyx_n_s_elements); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error)
3056 __Pyx_GOTREF(__pyx_t_6);
3057 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_updates), __pyx_n_s_nElements); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error)
3058 __Pyx_GOTREF(__pyx_t_7);
3059 __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, 0, NULL, &__pyx_t_7, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error)
3060 __Pyx_GOTREF(__pyx_t_8);
3061 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3062 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3063 __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error)
3064 __Pyx_GOTREF(__pyx_t_7);
3065 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3066 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3067 if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_t_3, __pyx_t_7) < 0)) __PYX_ERR(0, 36, __pyx_L1_error)
3068 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3069 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3070 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3071
3072 /* "cylp/cy/CyPEPivot.pyx":37
3073 * s.transposeTimes(-1, updates, spareCol2, spareCol1)
3074 * s.reducedCosts[s.nVariables:][updates.indices] -= updates.elements[:updates.nElements]
3075 * s.reducedCosts[:s.nVariables][spareCol1.indices] -= spareCol1.elements[:spareCol1.nElements] # <<<<<<<<<<<<<<
3076 * updates.clear()
3077 * spareCol1.clear()
3078 */
3079 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_reducedCosts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error)
3080 __Pyx_GOTREF(__pyx_t_4);
3081 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_nVariables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
3082 __Pyx_GOTREF(__pyx_t_3);
3083 __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, &__pyx_t_3, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 37, __pyx_L1_error)
3084 __Pyx_GOTREF(__pyx_t_7);
3085 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3086 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3087 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spareCol1), __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
3088 __Pyx_GOTREF(__pyx_t_3);
3089 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error)
3090 __Pyx_GOTREF(__pyx_t_4);
3091 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spareCol1), __pyx_n_s_elements); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 37, __pyx_L1_error)
3092 __Pyx_GOTREF(__pyx_t_8);
3093 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spareCol1), __pyx_n_s_nElements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
3094 __Pyx_GOTREF(__pyx_t_1);
3095 __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error)
3096 __Pyx_GOTREF(__pyx_t_6);
3097 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3098 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3099 __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
3100 __Pyx_GOTREF(__pyx_t_1);
3101 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3102 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3103 if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 37, __pyx_L1_error)
3104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3106 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3107
3108 /* "cylp/cy/CyPEPivot.pyx":33
3109 *
3110 * # Update the reduced costs, for both the original and the slack variables
3111 * if updates.nElements: # <<<<<<<<<<<<<<
3112 * s.updateColumnTranspose(spareRow2, updates)
3113 * s.transposeTimes(-1, updates, spareCol2, spareCol1)
3114 */
3115 }
3116
3117 /* "cylp/cy/CyPEPivot.pyx":38
3118 * s.reducedCosts[s.nVariables:][updates.indices] -= updates.elements[:updates.nElements]
3119 * s.reducedCosts[:s.nVariables][spareCol1.indices] -= spareCol1.elements[:spareCol1.nElements]
3120 * updates.clear() # <<<<<<<<<<<<<<
3121 * spareCol1.clear()
3122 *
3123 */
3124 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_updates), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
3125 __Pyx_GOTREF(__pyx_t_3);
3126 __pyx_t_1 = NULL;
3127 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3128 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3129 if (likely(__pyx_t_1)) {
3130 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3131 __Pyx_INCREF(__pyx_t_1);
3132 __Pyx_INCREF(function);
3133 __Pyx_DECREF_SET(__pyx_t_3, function);
3134 }
3135 }
3136 __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3137 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3138 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error)
3139 __Pyx_GOTREF(__pyx_t_7);
3140 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3141 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3142
3143 /* "cylp/cy/CyPEPivot.pyx":39
3144 * s.reducedCosts[:s.nVariables][spareCol1.indices] -= spareCol1.elements[:spareCol1.nElements]
3145 * updates.clear()
3146 * spareCol1.clear() # <<<<<<<<<<<<<<
3147 *
3148 * rc = s.reducedCosts
3149 */
3150 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spareCol1), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
3151 __Pyx_GOTREF(__pyx_t_3);
3152 __pyx_t_1 = NULL;
3153 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3154 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3155 if (likely(__pyx_t_1)) {
3156 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3157 __Pyx_INCREF(__pyx_t_1);
3158 __Pyx_INCREF(function);
3159 __Pyx_DECREF_SET(__pyx_t_3, function);
3160 }
3161 }
3162 __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3163 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3164 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 39, __pyx_L1_error)
3165 __Pyx_GOTREF(__pyx_t_7);
3166 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3167 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3168
3169 /* "cylp/cy/CyPEPivot.pyx":41
3170 * spareCol1.clear()
3171 *
3172 * rc = s.reducedCosts # <<<<<<<<<<<<<<
3173 *
3174 * cdef double tol = s.dualTolerance
3175 */
3176 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_reducedCosts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error)
3177 __Pyx_GOTREF(__pyx_t_7);
3178 __pyx_v_rc = __pyx_t_7;
3179 __pyx_t_7 = 0;
3180
3181 /* "cylp/cy/CyPEPivot.pyx":43
3182 * rc = s.reducedCosts
3183 *
3184 * cdef double tol = s.dualTolerance # <<<<<<<<<<<<<<
3185 *
3186 * indicesToConsider = np.where(s.varNotFlagged & s.varNotFixed &
3187 */
3188 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_dualTolerance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3189 __Pyx_GOTREF(__pyx_t_7);
3190 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
3191 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3192 __pyx_v_tol = __pyx_t_9;
3193
3194 /* "cylp/cy/CyPEPivot.pyx":45
3195 * cdef double tol = s.dualTolerance
3196 *
3197 * indicesToConsider = np.where(s.varNotFlagged & s.varNotFixed & # <<<<<<<<<<<<<<
3198 * s.varNotBasic &
3199 * (((rc > tol) & s.varIsAtUpperBound) |
3200 */
3201 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
3202 __Pyx_GOTREF(__pyx_t_3);
3203 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
3204 __Pyx_GOTREF(__pyx_t_1);
3205 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3206 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_varNotFlagged); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
3207 __Pyx_GOTREF(__pyx_t_3);
3208 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_varNotFixed); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
3209 __Pyx_GOTREF(__pyx_t_6);
3210 __pyx_t_4 = PyNumber_And(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
3211 __Pyx_GOTREF(__pyx_t_4);
3212 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3213 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3214
3215 /* "cylp/cy/CyPEPivot.pyx":46
3216 *
3217 * indicesToConsider = np.where(s.varNotFlagged & s.varNotFixed &
3218 * s.varNotBasic & # <<<<<<<<<<<<<<
3219 * (((rc > tol) & s.varIsAtUpperBound) |
3220 * ((rc < -tol) & s.varIsAtLowerBound) |
3221 */
3222 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_varNotBasic); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error)
3223 __Pyx_GOTREF(__pyx_t_6);
3224
3225 /* "cylp/cy/CyPEPivot.pyx":45
3226 * cdef double tol = s.dualTolerance
3227 *
3228 * indicesToConsider = np.where(s.varNotFlagged & s.varNotFixed & # <<<<<<<<<<<<<<
3229 * s.varNotBasic &
3230 * (((rc > tol) & s.varIsAtUpperBound) |
3231 */
3232 __pyx_t_3 = PyNumber_And(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
3233 __Pyx_GOTREF(__pyx_t_3);
3234 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3235 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3236
3237 /* "cylp/cy/CyPEPivot.pyx":47
3238 * indicesToConsider = np.where(s.varNotFlagged & s.varNotFixed &
3239 * s.varNotBasic &
3240 * (((rc > tol) & s.varIsAtUpperBound) | # <<<<<<<<<<<<<<
3241 * ((rc < -tol) & s.varIsAtLowerBound) |
3242 * s.varIsFree))[0]
3243 */
3244 __pyx_t_6 = PyFloat_FromDouble(__pyx_v_tol); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error)
3245 __Pyx_GOTREF(__pyx_t_6);
3246 __pyx_t_4 = PyObject_RichCompare(__pyx_v_rc, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
3247 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3248 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_varIsAtUpperBound); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error)
3249 __Pyx_GOTREF(__pyx_t_6);
3250 __pyx_t_8 = PyNumber_And(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error)
3251 __Pyx_GOTREF(__pyx_t_8);
3252 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3253 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3254
3255 /* "cylp/cy/CyPEPivot.pyx":48
3256 * s.varNotBasic &
3257 * (((rc > tol) & s.varIsAtUpperBound) |
3258 * ((rc < -tol) & s.varIsAtLowerBound) | # <<<<<<<<<<<<<<
3259 * s.varIsFree))[0]
3260 *
3261 */
3262 __pyx_t_6 = PyFloat_FromDouble((-__pyx_v_tol)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error)
3263 __Pyx_GOTREF(__pyx_t_6);
3264 __pyx_t_4 = PyObject_RichCompare(__pyx_v_rc, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
3265 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3266 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_varIsAtLowerBound); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error)
3267 __Pyx_GOTREF(__pyx_t_6);
3268 __pyx_t_10 = PyNumber_And(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
3269 __Pyx_GOTREF(__pyx_t_10);
3270 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3271 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3272
3273 /* "cylp/cy/CyPEPivot.pyx":47
3274 * indicesToConsider = np.where(s.varNotFlagged & s.varNotFixed &
3275 * s.varNotBasic &
3276 * (((rc > tol) & s.varIsAtUpperBound) | # <<<<<<<<<<<<<<
3277 * ((rc < -tol) & s.varIsAtLowerBound) |
3278 * s.varIsFree))[0]
3279 */
3280 __pyx_t_6 = PyNumber_Or(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error)
3281 __Pyx_GOTREF(__pyx_t_6);
3282 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3283 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3284
3285 /* "cylp/cy/CyPEPivot.pyx":49
3286 * (((rc > tol) & s.varIsAtUpperBound) |
3287 * ((rc < -tol) & s.varIsAtLowerBound) |
3288 * s.varIsFree))[0] # <<<<<<<<<<<<<<
3289 *
3290 * rc2 = abs(rc[indicesToConsider])
3291 */
3292 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_varIsFree); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error)
3293 __Pyx_GOTREF(__pyx_t_10);
3294
3295 /* "cylp/cy/CyPEPivot.pyx":48
3296 * s.varNotBasic &
3297 * (((rc > tol) & s.varIsAtUpperBound) |
3298 * ((rc < -tol) & s.varIsAtLowerBound) | # <<<<<<<<<<<<<<
3299 * s.varIsFree))[0]
3300 *
3301 */
3302 __pyx_t_8 = PyNumber_Or(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error)
3303 __Pyx_GOTREF(__pyx_t_8);
3304 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3305 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3306
3307 /* "cylp/cy/CyPEPivot.pyx":46
3308 *
3309 * indicesToConsider = np.where(s.varNotFlagged & s.varNotFixed &
3310 * s.varNotBasic & # <<<<<<<<<<<<<<
3311 * (((rc > tol) & s.varIsAtUpperBound) |
3312 * ((rc < -tol) & s.varIsAtLowerBound) |
3313 */
3314 __pyx_t_10 = PyNumber_And(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
3315 __Pyx_GOTREF(__pyx_t_10);
3316 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3317 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3318 __pyx_t_8 = NULL;
3319 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3320 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
3321 if (likely(__pyx_t_8)) {
3322 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3323 __Pyx_INCREF(__pyx_t_8);
3324 __Pyx_INCREF(function);
3325 __Pyx_DECREF_SET(__pyx_t_1, function);
3326 }
3327 }
3328 __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
3329 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3330 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3331 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
3332 __Pyx_GOTREF(__pyx_t_7);
3333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3334
3335 /* "cylp/cy/CyPEPivot.pyx":49
3336 * (((rc > tol) & s.varIsAtUpperBound) |
3337 * ((rc < -tol) & s.varIsAtLowerBound) |
3338 * s.varIsFree))[0] # <<<<<<<<<<<<<<
3339 *
3340 * rc2 = abs(rc[indicesToConsider])
3341 */
3342 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
3343 __Pyx_GOTREF(__pyx_t_1);
3344 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3345 __pyx_v_indicesToConsider = __pyx_t_1;
3346 __pyx_t_1 = 0;
3347
3348 /* "cylp/cy/CyPEPivot.pyx":51
3349 * s.varIsFree))[0]
3350 *
3351 * rc2 = abs(rc[indicesToConsider]) # <<<<<<<<<<<<<<
3352 *
3353 * cdef double maxRc = -1
3354 */
3355 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_rc, __pyx_v_indicesToConsider); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
3356 __Pyx_GOTREF(__pyx_t_1);
3357 __pyx_t_7 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error)
3358 __Pyx_GOTREF(__pyx_t_7);
3359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3360 __pyx_v_rc2 = __pyx_t_7;
3361 __pyx_t_7 = 0;
3362
3363 /* "cylp/cy/CyPEPivot.pyx":53
3364 * rc2 = abs(rc[indicesToConsider])
3365 *
3366 * cdef double maxRc = -1 # <<<<<<<<<<<<<<
3367 * cdef int maxInd = -1
3368 * cdef double maxCompRc = -1
3369 */
3370 __pyx_v_maxRc = -1.0;
3371
3372 /* "cylp/cy/CyPEPivot.pyx":54
3373 *
3374 * cdef double maxRc = -1
3375 * cdef int maxInd = -1 # <<<<<<<<<<<<<<
3376 * cdef double maxCompRc = -1
3377 * cdef int maxCompInd = -1
3378 */
3379 __pyx_v_maxInd = -1;
3380
3381 /* "cylp/cy/CyPEPivot.pyx":55
3382 * cdef double maxRc = -1
3383 * cdef int maxInd = -1
3384 * cdef double maxCompRc = -1 # <<<<<<<<<<<<<<
3385 * cdef int maxCompInd = -1
3386 * cdef int ind
3387 */
3388 __pyx_v_maxCompRc = -1.0;
3389
3390 /* "cylp/cy/CyPEPivot.pyx":56
3391 * cdef int maxInd = -1
3392 * cdef double maxCompRc = -1
3393 * cdef int maxCompInd = -1 # <<<<<<<<<<<<<<
3394 * cdef int ind
3395 * for i in xrange(len(rc2)):
3396 */
3397 __pyx_v_maxCompInd = -1;
3398
3399 /* "cylp/cy/CyPEPivot.pyx":58
3400 * cdef int maxCompInd = -1
3401 * cdef int ind
3402 * for i in xrange(len(rc2)): # <<<<<<<<<<<<<<
3403 * ind = indicesToConsider[i]
3404 * if rc2[i] > maxCompRc:
3405 */
3406 __pyx_t_11 = PyObject_Length(__pyx_v_rc2); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 58, __pyx_L1_error)
3407 __pyx_t_12 = __pyx_t_11;
3408 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
3409 __pyx_v_i = __pyx_t_13;
3410
3411 /* "cylp/cy/CyPEPivot.pyx":59
3412 * cdef int ind
3413 * for i in xrange(len(rc2)):
3414 * ind = indicesToConsider[i] # <<<<<<<<<<<<<<
3415 * if rc2[i] > maxCompRc:
3416 * if self.isCompatible(ind):
3417 */
3418 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_indicesToConsider, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
3419 __Pyx_GOTREF(__pyx_t_7);
3420 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
3421 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3422 __pyx_v_ind = __pyx_t_5;
3423
3424 /* "cylp/cy/CyPEPivot.pyx":60
3425 * for i in xrange(len(rc2)):
3426 * ind = indicesToConsider[i]
3427 * if rc2[i] > maxCompRc: # <<<<<<<<<<<<<<
3428 * if self.isCompatible(ind):
3429 * maxCompRc = rc2[i]
3430 */
3431 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_rc2, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
3432 __Pyx_GOTREF(__pyx_t_7);
3433 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_maxCompRc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3434 __Pyx_GOTREF(__pyx_t_1);
3435 __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
3436 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3437 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3438 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 60, __pyx_L1_error)
3439 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3440 if (__pyx_t_2) {
3441
3442 /* "cylp/cy/CyPEPivot.pyx":61
3443 * ind = indicesToConsider[i]
3444 * if rc2[i] > maxCompRc:
3445 * if self.isCompatible(ind): # <<<<<<<<<<<<<<
3446 * maxCompRc = rc2[i]
3447 * maxCompInd = ind
3448 */
3449 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isCompatible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3450 __Pyx_GOTREF(__pyx_t_1);
3451 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
3452 __Pyx_GOTREF(__pyx_t_7);
3453 __pyx_t_8 = NULL;
3454 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
3455 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
3456 if (likely(__pyx_t_8)) {
3457 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3458 __Pyx_INCREF(__pyx_t_8);
3459 __Pyx_INCREF(function);
3460 __Pyx_DECREF_SET(__pyx_t_1, function);
3461 }
3462 }
3463 __pyx_t_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7);
3464 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3465 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3466 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
3467 __Pyx_GOTREF(__pyx_t_10);
3468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3469 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3470 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3471 if (__pyx_t_2) {
3472
3473 /* "cylp/cy/CyPEPivot.pyx":62
3474 * if rc2[i] > maxCompRc:
3475 * if self.isCompatible(ind):
3476 * maxCompRc = rc2[i] # <<<<<<<<<<<<<<
3477 * maxCompInd = ind
3478 * else:
3479 */
3480 __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_rc2, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
3481 __Pyx_GOTREF(__pyx_t_10);
3482 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
3483 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3484 __pyx_v_maxCompRc = __pyx_t_9;
3485
3486 /* "cylp/cy/CyPEPivot.pyx":63
3487 * if self.isCompatible(ind):
3488 * maxCompRc = rc2[i]
3489 * maxCompInd = ind # <<<<<<<<<<<<<<
3490 * else:
3491 * pass
3492 */
3493 __pyx_v_maxCompInd = __pyx_v_ind;
3494
3495 /* "cylp/cy/CyPEPivot.pyx":61
3496 * ind = indicesToConsider[i]
3497 * if rc2[i] > maxCompRc:
3498 * if self.isCompatible(ind): # <<<<<<<<<<<<<<
3499 * maxCompRc = rc2[i]
3500 * maxCompInd = ind
3501 */
3502 goto __pyx_L7;
3503 }
3504
3505 /* "cylp/cy/CyPEPivot.pyx":65
3506 * maxCompInd = ind
3507 * else:
3508 * pass # <<<<<<<<<<<<<<
3509 * if rc2[i] > maxRc:
3510 * maxRc = rc2[i]
3511 */
3512 /*else*/ {
3513 }
3514 __pyx_L7:;
3515
3516 /* "cylp/cy/CyPEPivot.pyx":66
3517 * else:
3518 * pass
3519 * if rc2[i] > maxRc: # <<<<<<<<<<<<<<
3520 * maxRc = rc2[i]
3521 * maxInd = ind
3522 */
3523 __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_rc2, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error)
3524 __Pyx_GOTREF(__pyx_t_10);
3525 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_maxRc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
3526 __Pyx_GOTREF(__pyx_t_1);
3527 __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error)
3528 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3530 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3531 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3532 if (__pyx_t_2) {
3533
3534 /* "cylp/cy/CyPEPivot.pyx":67
3535 * pass
3536 * if rc2[i] > maxRc:
3537 * maxRc = rc2[i] # <<<<<<<<<<<<<<
3538 * maxInd = ind
3539 *
3540 */
3541 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_rc2, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 67, __pyx_L1_error)
3542 __Pyx_GOTREF(__pyx_t_7);
3543 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3544 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3545 __pyx_v_maxRc = __pyx_t_9;
3546
3547 /* "cylp/cy/CyPEPivot.pyx":68
3548 * if rc2[i] > maxRc:
3549 * maxRc = rc2[i]
3550 * maxInd = ind # <<<<<<<<<<<<<<
3551 *
3552 * if maxCompInd != -1 and maxCompRc > 0.4 * maxRc:
3553 */
3554 __pyx_v_maxInd = __pyx_v_ind;
3555
3556 /* "cylp/cy/CyPEPivot.pyx":66
3557 * else:
3558 * pass
3559 * if rc2[i] > maxRc: # <<<<<<<<<<<<<<
3560 * maxRc = rc2[i]
3561 * maxInd = ind
3562 */
3563 }
3564
3565 /* "cylp/cy/CyPEPivot.pyx":60
3566 * for i in xrange(len(rc2)):
3567 * ind = indicesToConsider[i]
3568 * if rc2[i] > maxCompRc: # <<<<<<<<<<<<<<
3569 * if self.isCompatible(ind):
3570 * maxCompRc = rc2[i]
3571 */
3572 }
3573 }
3574
3575 /* "cylp/cy/CyPEPivot.pyx":70
3576 * maxInd = ind
3577 *
3578 * if maxCompInd != -1 and maxCompRc > 0.4 * maxRc: # <<<<<<<<<<<<<<
3579 * print(s.iteration, ' : comp selected', maxCompInd)
3580 * return maxCompInd
3581 */
3582 __pyx_t_14 = ((__pyx_v_maxCompInd != -1L) != 0);
3583 if (__pyx_t_14) {
3584 } else {
3585 __pyx_t_2 = __pyx_t_14;
3586 goto __pyx_L10_bool_binop_done;
3587 }
3588 __pyx_t_14 = ((__pyx_v_maxCompRc > (0.4 * __pyx_v_maxRc)) != 0);
3589 __pyx_t_2 = __pyx_t_14;
3590 __pyx_L10_bool_binop_done:;
3591 if (__pyx_t_2) {
3592
3593 /* "cylp/cy/CyPEPivot.pyx":71
3594 *
3595 * if maxCompInd != -1 and maxCompRc > 0.4 * maxRc:
3596 * print(s.iteration, ' : comp selected', maxCompInd) # <<<<<<<<<<<<<<
3597 * return maxCompInd
3598 *
3599 */
3600 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_iteration); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 71, __pyx_L1_error)
3601 __Pyx_GOTREF(__pyx_t_7);
3602 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_maxCompInd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3603 __Pyx_GOTREF(__pyx_t_1);
3604 __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error)
3605 __Pyx_GOTREF(__pyx_t_10);
3606 __Pyx_GIVEREF(__pyx_t_7);
3607 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
3608 __Pyx_INCREF(__pyx_kp_s_comp_selected);
3609 __Pyx_GIVEREF(__pyx_kp_s_comp_selected);
3610 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_s_comp_selected);
3611 __Pyx_GIVEREF(__pyx_t_1);
3612 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
3613 __pyx_t_7 = 0;
3614 __pyx_t_1 = 0;
3615 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3616 __Pyx_GOTREF(__pyx_t_1);
3617 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3618 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3619
3620 /* "cylp/cy/CyPEPivot.pyx":72
3621 * if maxCompInd != -1 and maxCompRc > 0.4 * maxRc:
3622 * print(s.iteration, ' : comp selected', maxCompInd)
3623 * return maxCompInd # <<<<<<<<<<<<<<
3624 *
3625 * print(s.iteration, ' : incomp selected', maxInd)
3626 */
3627 __Pyx_XDECREF(__pyx_r);
3628 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_maxCompInd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
3629 __Pyx_GOTREF(__pyx_t_1);
3630 __pyx_r = __pyx_t_1;
3631 __pyx_t_1 = 0;
3632 goto __pyx_L0;
3633
3634 /* "cylp/cy/CyPEPivot.pyx":70
3635 * maxInd = ind
3636 *
3637 * if maxCompInd != -1 and maxCompRc > 0.4 * maxRc: # <<<<<<<<<<<<<<
3638 * print(s.iteration, ' : comp selected', maxCompInd)
3639 * return maxCompInd
3640 */
3641 }
3642
3643 /* "cylp/cy/CyPEPivot.pyx":74
3644 * return maxCompInd
3645 *
3646 * print(s.iteration, ' : incomp selected', maxInd) # <<<<<<<<<<<<<<
3647 * self.updateP()
3648 * self.updateW()
3649 */
3650 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_s), __pyx_n_s_iteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
3651 __Pyx_GOTREF(__pyx_t_1);
3652 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_maxInd); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error)
3653 __Pyx_GOTREF(__pyx_t_10);
3654 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
3655 __Pyx_GOTREF(__pyx_t_7);
3656 __Pyx_GIVEREF(__pyx_t_1);
3657 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
3658 __Pyx_INCREF(__pyx_kp_s_incomp_selected);
3659 __Pyx_GIVEREF(__pyx_kp_s_incomp_selected);
3660 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_s_incomp_selected);
3661 __Pyx_GIVEREF(__pyx_t_10);
3662 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_10);
3663 __pyx_t_1 = 0;
3664 __pyx_t_10 = 0;
3665 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error)
3666 __Pyx_GOTREF(__pyx_t_10);
3667 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3668 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3669
3670 /* "cylp/cy/CyPEPivot.pyx":75
3671 *
3672 * print(s.iteration, ' : incomp selected', maxInd)
3673 * self.updateP() # <<<<<<<<<<<<<<
3674 * self.updateW()
3675 * #print('updated')
3676 */
3677 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_updateP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error)
3678 __Pyx_GOTREF(__pyx_t_7);
3679 __pyx_t_1 = NULL;
3680 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
3681 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
3682 if (likely(__pyx_t_1)) {
3683 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
3684 __Pyx_INCREF(__pyx_t_1);
3685 __Pyx_INCREF(function);
3686 __Pyx_DECREF_SET(__pyx_t_7, function);
3687 }
3688 }
3689 __pyx_t_10 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
3690 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3691 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 75, __pyx_L1_error)
3692 __Pyx_GOTREF(__pyx_t_10);
3693 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3694 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3695
3696 /* "cylp/cy/CyPEPivot.pyx":76
3697 * print(s.iteration, ' : incomp selected', maxInd)
3698 * self.updateP()
3699 * self.updateW() # <<<<<<<<<<<<<<
3700 * #print('updated')
3701 * return maxInd
3702 */
3703 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_updateW); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L1_error)
3704 __Pyx_GOTREF(__pyx_t_7);
3705 __pyx_t_1 = NULL;
3706 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
3707 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
3708 if (likely(__pyx_t_1)) {
3709 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
3710 __Pyx_INCREF(__pyx_t_1);
3711 __Pyx_INCREF(function);
3712 __Pyx_DECREF_SET(__pyx_t_7, function);
3713 }
3714 }
3715 __pyx_t_10 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
3716 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3717 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
3718 __Pyx_GOTREF(__pyx_t_10);
3719 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3720 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3721
3722 /* "cylp/cy/CyPEPivot.pyx":78
3723 * self.updateW()
3724 * #print('updated')
3725 * return maxInd # <<<<<<<<<<<<<<
3726 *
3727 * cdef CyClpPrimalColumnPivot* clone(self, bint copyData):
3728 */
3729 __Pyx_XDECREF(__pyx_r);
3730 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_maxInd); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
3731 __Pyx_GOTREF(__pyx_t_10);
3732 __pyx_r = __pyx_t_10;
3733 __pyx_t_10 = 0;
3734 goto __pyx_L0;
3735
3736 /* "cylp/cy/CyPEPivot.pyx":16
3737 * CyClpPrimalColumnPivotBase.__init__(self)
3738 *
3739 * cdef pivotColumn(self, CppCoinIndexedVector* cppupdates, CppCoinIndexedVector* cppspareRow1, # <<<<<<<<<<<<<<
3740 * CppCoinIndexedVector* cppspareRow2, CppCoinIndexedVector* cppspareCol1,
3741 * CppCoinIndexedVector* cppspareCol2):
3742 */
3743
3744 /* function exit code */
3745 __pyx_L1_error:;
3746 __Pyx_XDECREF(__pyx_t_1);
3747 __Pyx_XDECREF(__pyx_t_3);
3748 __Pyx_XDECREF(__pyx_t_4);
3749 __Pyx_XDECREF(__pyx_t_6);
3750 __Pyx_XDECREF(__pyx_t_7);
3751 __Pyx_XDECREF(__pyx_t_8);
3752 __Pyx_XDECREF(__pyx_t_10);
3753 __Pyx_AddTraceback("cylp.cy.CyPEPivot.CyPEPivot.pivotColumn", __pyx_clineno, __pyx_lineno, __pyx_filename);
3754 __pyx_r = 0;
3755 __pyx_L0:;
3756 __Pyx_XDECREF((PyObject *)__pyx_v_updates);
3757 __Pyx_XDECREF((PyObject *)__pyx_v_spareRow1);
3758 __Pyx_XDECREF((PyObject *)__pyx_v_spareRow2);
3759 __Pyx_XDECREF((PyObject *)__pyx_v_spareCol1);
3760 __Pyx_XDECREF((PyObject *)__pyx_v_spareCol2);
3761 __Pyx_XDECREF((PyObject *)__pyx_v_s);
3762 __Pyx_XDECREF(__pyx_v_rc);
3763 __Pyx_XDECREF(__pyx_v_indicesToConsider);
3764 __Pyx_XDECREF(__pyx_v_rc2);
3765 __Pyx_XGIVEREF(__pyx_r);
3766 __Pyx_RefNannyFinishContext();
3767 return __pyx_r;
3768 }
3769
3770 /* "cylp/cy/CyPEPivot.pyx":80
3771 * return maxInd
3772 *
3773 * cdef CyClpPrimalColumnPivot* clone(self, bint copyData): # <<<<<<<<<<<<<<
3774 * cdef CyClpPrimalColumnPivot* ret = \
3775 * <CyClpPrimalColumnPivot*> new CppClpPrimalColumnPivotBase(
3776 */
3777
__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_clone(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot * __pyx_v_self,CYTHON_UNUSED int __pyx_v_copyData)3778 static ClpPrimalColumnPivot *__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_clone(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, CYTHON_UNUSED int __pyx_v_copyData) {
3779 ClpPrimalColumnPivot *__pyx_v_ret;
3780 ClpPrimalColumnPivot *__pyx_r;
3781 __Pyx_RefNannyDeclarations
3782 __Pyx_RefNannySetupContext("clone", 0);
3783
3784 /* "cylp/cy/CyPEPivot.pyx":82
3785 * cdef CyClpPrimalColumnPivot* clone(self, bint copyData):
3786 * cdef CyClpPrimalColumnPivot* ret = \
3787 * <CyClpPrimalColumnPivot*> new CppClpPrimalColumnPivotBase( # <<<<<<<<<<<<<<
3788 * <cpy_ref.PyObject*>self,
3789 * <runPivotColumn_t>RunPivotColumn,
3790 */
3791 __pyx_v_ret = ((ClpPrimalColumnPivot *)new CppClpPrimalColumnPivotBase(((PyObject *)__pyx_v_self), ((runPivotColumn_t)__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunPivotColumn), ((runClone_t)__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunClone), ((runSaveWeights_t)__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunSaveWeights)));
3792
3793 /* "cylp/cy/CyPEPivot.pyx":87
3794 * <runClone_t>RunClone,
3795 * <runSaveWeights_t>RunSaveWeights)
3796 * return ret # <<<<<<<<<<<<<<
3797 * cdef void saveWeights(self, CyClpSimplex.CppIClpSimplex * model, int mode):
3798 * self.CppSelf.setModel(model)
3799 */
3800 __pyx_r = __pyx_v_ret;
3801 goto __pyx_L0;
3802
3803 /* "cylp/cy/CyPEPivot.pyx":80
3804 * return maxInd
3805 *
3806 * cdef CyClpPrimalColumnPivot* clone(self, bint copyData): # <<<<<<<<<<<<<<
3807 * cdef CyClpPrimalColumnPivot* ret = \
3808 * <CyClpPrimalColumnPivot*> new CppClpPrimalColumnPivotBase(
3809 */
3810
3811 /* function exit code */
3812 __pyx_L0:;
3813 __Pyx_RefNannyFinishContext();
3814 return __pyx_r;
3815 }
3816
3817 /* "cylp/cy/CyPEPivot.pyx":88
3818 * <runSaveWeights_t>RunSaveWeights)
3819 * return ret
3820 * cdef void saveWeights(self, CyClpSimplex.CppIClpSimplex * model, int mode): # <<<<<<<<<<<<<<
3821 * self.CppSelf.setModel(model)
3822 */
3823
__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_saveWeights(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot * __pyx_v_self,IClpSimplex * __pyx_v_model,CYTHON_UNUSED int __pyx_v_mode)3824 static void __pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_saveWeights(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, IClpSimplex *__pyx_v_model, CYTHON_UNUSED int __pyx_v_mode) {
3825 __Pyx_RefNannyDeclarations
3826 __Pyx_RefNannySetupContext("saveWeights", 0);
3827
3828 /* "cylp/cy/CyPEPivot.pyx":89
3829 * return ret
3830 * cdef void saveWeights(self, CyClpSimplex.CppIClpSimplex * model, int mode):
3831 * self.CppSelf.setModel(model) # <<<<<<<<<<<<<<
3832 */
3833 __pyx_v_self->__pyx_base.CppSelf->setModel(__pyx_v_model);
3834
3835 /* "cylp/cy/CyPEPivot.pyx":88
3836 * <runSaveWeights_t>RunSaveWeights)
3837 * return ret
3838 * cdef void saveWeights(self, CyClpSimplex.CppIClpSimplex * model, int mode): # <<<<<<<<<<<<<<
3839 * self.CppSelf.setModel(model)
3840 */
3841
3842 /* function exit code */
3843 __Pyx_RefNannyFinishContext();
3844 }
3845
3846 /* "(tree fragment)":1
3847 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3848 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3849 * def __setstate_cython__(self, __pyx_state):
3850 */
3851
3852 /* Python wrapper */
3853 static PyObject *__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3854 static char __pyx_doc_4cylp_2cy_9CyPEPivot_9CyPEPivot_2__reduce_cython__[] = "CyPEPivot.__reduce_cython__(self)";
__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3855 static PyObject *__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3856 PyObject *__pyx_r = 0;
3857 __Pyx_RefNannyDeclarations
3858 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3859 __pyx_r = __pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_2__reduce_cython__(((struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *)__pyx_v_self));
3860
3861 /* function exit code */
3862 __Pyx_RefNannyFinishContext();
3863 return __pyx_r;
3864 }
3865
__pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot * __pyx_v_self)3866 static PyObject *__pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self) {
3867 PyObject *__pyx_r = NULL;
3868 __Pyx_RefNannyDeclarations
3869 PyObject *__pyx_t_1 = NULL;
3870 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3871
3872 /* "(tree fragment)":2
3873 * def __reduce_cython__(self):
3874 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
3875 * def __setstate_cython__(self, __pyx_state):
3876 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3877 */
3878 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_1);
3880 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3881 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3882 __PYX_ERR(1, 2, __pyx_L1_error)
3883
3884 /* "(tree fragment)":1
3885 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3886 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3887 * def __setstate_cython__(self, __pyx_state):
3888 */
3889
3890 /* function exit code */
3891 __pyx_L1_error:;
3892 __Pyx_XDECREF(__pyx_t_1);
3893 __Pyx_AddTraceback("cylp.cy.CyPEPivot.CyPEPivot.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3894 __pyx_r = NULL;
3895 __Pyx_XGIVEREF(__pyx_r);
3896 __Pyx_RefNannyFinishContext();
3897 return __pyx_r;
3898 }
3899
3900 /* "(tree fragment)":3
3901 * def __reduce_cython__(self):
3902 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3903 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3904 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3905 */
3906
3907 /* Python wrapper */
3908 static PyObject *__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3909 static char __pyx_doc_4cylp_2cy_9CyPEPivot_9CyPEPivot_4__setstate_cython__[] = "CyPEPivot.__setstate_cython__(self, __pyx_state)";
__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3910 static PyObject *__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3911 PyObject *__pyx_r = 0;
3912 __Pyx_RefNannyDeclarations
3913 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3914 __pyx_r = __pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_4__setstate_cython__(((struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3915
3916 /* function exit code */
3917 __Pyx_RefNannyFinishContext();
3918 return __pyx_r;
3919 }
3920
__pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)3921 static PyObject *__pyx_pf_4cylp_2cy_9CyPEPivot_9CyPEPivot_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3922 PyObject *__pyx_r = NULL;
3923 __Pyx_RefNannyDeclarations
3924 PyObject *__pyx_t_1 = NULL;
3925 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3926
3927 /* "(tree fragment)":4
3928 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3929 * def __setstate_cython__(self, __pyx_state):
3930 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
3931 */
3932 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_1);
3934 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3935 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3936 __PYX_ERR(1, 4, __pyx_L1_error)
3937
3938 /* "(tree fragment)":3
3939 * def __reduce_cython__(self):
3940 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3941 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3942 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
3943 */
3944
3945 /* function exit code */
3946 __pyx_L1_error:;
3947 __Pyx_XDECREF(__pyx_t_1);
3948 __Pyx_AddTraceback("cylp.cy.CyPEPivot.CyPEPivot.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3949 __pyx_r = NULL;
3950 __Pyx_XGIVEREF(__pyx_r);
3951 __Pyx_RefNannyFinishContext();
3952 return __pyx_r;
3953 }
3954
3955 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":258
3956 * # experimental exception made for __getbuffer__ and __releasebuffer__
3957 * # -- the details of this may change.
3958 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
3959 * # This implementation of getbuffer is geared towards Cython
3960 * # requirements, and does not yet fulfill the PEP.
3961 */
3962
3963 /* Python wrapper */
3964 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)3965 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3966 int __pyx_r;
3967 __Pyx_RefNannyDeclarations
3968 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
3969 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
3970
3971 /* function exit code */
3972 __Pyx_RefNannyFinishContext();
3973 return __pyx_r;
3974 }
3975
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)3976 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3977 int __pyx_v_i;
3978 int __pyx_v_ndim;
3979 int __pyx_v_endian_detector;
3980 int __pyx_v_little_endian;
3981 int __pyx_v_t;
3982 char *__pyx_v_f;
3983 PyArray_Descr *__pyx_v_descr = 0;
3984 int __pyx_v_offset;
3985 int __pyx_r;
3986 __Pyx_RefNannyDeclarations
3987 int __pyx_t_1;
3988 int __pyx_t_2;
3989 PyObject *__pyx_t_3 = NULL;
3990 int __pyx_t_4;
3991 int __pyx_t_5;
3992 int __pyx_t_6;
3993 PyArray_Descr *__pyx_t_7;
3994 PyObject *__pyx_t_8 = NULL;
3995 char *__pyx_t_9;
3996 if (__pyx_v_info == NULL) {
3997 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
3998 return -1;
3999 }
4000 __Pyx_RefNannySetupContext("__getbuffer__", 0);
4001 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
4002 __Pyx_GIVEREF(__pyx_v_info->obj);
4003
4004 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":265
4005 *
4006 * cdef int i, ndim
4007 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
4008 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4009 *
4010 */
4011 __pyx_v_endian_detector = 1;
4012
4013 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":266
4014 * cdef int i, ndim
4015 * cdef int endian_detector = 1
4016 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
4017 *
4018 * ndim = PyArray_NDIM(self)
4019 */
4020 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
4021
4022 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":268
4023 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4024 *
4025 * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
4026 *
4027 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4028 */
4029 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
4030
4031 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":270
4032 * ndim = PyArray_NDIM(self)
4033 *
4034 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
4035 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4036 * raise ValueError(u"ndarray is not C contiguous")
4037 */
4038 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
4039 if (__pyx_t_2) {
4040 } else {
4041 __pyx_t_1 = __pyx_t_2;
4042 goto __pyx_L4_bool_binop_done;
4043 }
4044
4045 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":271
4046 *
4047 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4048 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
4049 * raise ValueError(u"ndarray is not C contiguous")
4050 *
4051 */
4052 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
4053 __pyx_t_1 = __pyx_t_2;
4054 __pyx_L4_bool_binop_done:;
4055
4056 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":270
4057 * ndim = PyArray_NDIM(self)
4058 *
4059 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
4060 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4061 * raise ValueError(u"ndarray is not C contiguous")
4062 */
4063 if (unlikely(__pyx_t_1)) {
4064
4065 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":272
4066 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4067 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4068 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
4069 *
4070 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4071 */
4072 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
4073 __Pyx_GOTREF(__pyx_t_3);
4074 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4076 __PYX_ERR(2, 272, __pyx_L1_error)
4077
4078 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":270
4079 * ndim = PyArray_NDIM(self)
4080 *
4081 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
4082 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4083 * raise ValueError(u"ndarray is not C contiguous")
4084 */
4085 }
4086
4087 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":274
4088 * raise ValueError(u"ndarray is not C contiguous")
4089 *
4090 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
4091 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4092 * raise ValueError(u"ndarray is not Fortran contiguous")
4093 */
4094 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
4095 if (__pyx_t_2) {
4096 } else {
4097 __pyx_t_1 = __pyx_t_2;
4098 goto __pyx_L7_bool_binop_done;
4099 }
4100
4101 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":275
4102 *
4103 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4104 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
4105 * raise ValueError(u"ndarray is not Fortran contiguous")
4106 *
4107 */
4108 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
4109 __pyx_t_1 = __pyx_t_2;
4110 __pyx_L7_bool_binop_done:;
4111
4112 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":274
4113 * raise ValueError(u"ndarray is not C contiguous")
4114 *
4115 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
4116 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4117 * raise ValueError(u"ndarray is not Fortran contiguous")
4118 */
4119 if (unlikely(__pyx_t_1)) {
4120
4121 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":276
4122 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4123 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4124 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
4125 *
4126 * info.buf = PyArray_DATA(self)
4127 */
4128 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
4129 __Pyx_GOTREF(__pyx_t_3);
4130 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4131 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4132 __PYX_ERR(2, 276, __pyx_L1_error)
4133
4134 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":274
4135 * raise ValueError(u"ndarray is not C contiguous")
4136 *
4137 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
4138 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4139 * raise ValueError(u"ndarray is not Fortran contiguous")
4140 */
4141 }
4142
4143 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":278
4144 * raise ValueError(u"ndarray is not Fortran contiguous")
4145 *
4146 * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
4147 * info.ndim = ndim
4148 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4149 */
4150 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
4151
4152 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":279
4153 *
4154 * info.buf = PyArray_DATA(self)
4155 * info.ndim = ndim # <<<<<<<<<<<<<<
4156 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4157 * # Allocate new buffer for strides and shape info.
4158 */
4159 __pyx_v_info->ndim = __pyx_v_ndim;
4160
4161 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":280
4162 * info.buf = PyArray_DATA(self)
4163 * info.ndim = ndim
4164 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4165 * # Allocate new buffer for strides and shape info.
4166 * # This is allocated as one block, strides first.
4167 */
4168 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4169 if (__pyx_t_1) {
4170
4171 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":283
4172 * # Allocate new buffer for strides and shape info.
4173 * # This is allocated as one block, strides first.
4174 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
4175 * info.shape = info.strides + ndim
4176 * for i in range(ndim):
4177 */
4178 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
4179
4180 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":284
4181 * # This is allocated as one block, strides first.
4182 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
4183 * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
4184 * for i in range(ndim):
4185 * info.strides[i] = PyArray_STRIDES(self)[i]
4186 */
4187 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
4188
4189 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":285
4190 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
4191 * info.shape = info.strides + ndim
4192 * for i in range(ndim): # <<<<<<<<<<<<<<
4193 * info.strides[i] = PyArray_STRIDES(self)[i]
4194 * info.shape[i] = PyArray_DIMS(self)[i]
4195 */
4196 __pyx_t_4 = __pyx_v_ndim;
4197 __pyx_t_5 = __pyx_t_4;
4198 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4199 __pyx_v_i = __pyx_t_6;
4200
4201 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":286
4202 * info.shape = info.strides + ndim
4203 * for i in range(ndim):
4204 * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
4205 * info.shape[i] = PyArray_DIMS(self)[i]
4206 * else:
4207 */
4208 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
4209
4210 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":287
4211 * for i in range(ndim):
4212 * info.strides[i] = PyArray_STRIDES(self)[i]
4213 * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
4214 * else:
4215 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4216 */
4217 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
4218 }
4219
4220 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":280
4221 * info.buf = PyArray_DATA(self)
4222 * info.ndim = ndim
4223 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4224 * # Allocate new buffer for strides and shape info.
4225 * # This is allocated as one block, strides first.
4226 */
4227 goto __pyx_L9;
4228 }
4229
4230 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":289
4231 * info.shape[i] = PyArray_DIMS(self)[i]
4232 * else:
4233 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
4234 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4235 * info.suboffsets = NULL
4236 */
4237 /*else*/ {
4238 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
4239
4240 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":290
4241 * else:
4242 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4243 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
4244 * info.suboffsets = NULL
4245 * info.itemsize = PyArray_ITEMSIZE(self)
4246 */
4247 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
4248 }
4249 __pyx_L9:;
4250
4251 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":291
4252 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4253 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4254 * info.suboffsets = NULL # <<<<<<<<<<<<<<
4255 * info.itemsize = PyArray_ITEMSIZE(self)
4256 * info.readonly = not PyArray_ISWRITEABLE(self)
4257 */
4258 __pyx_v_info->suboffsets = NULL;
4259
4260 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":292
4261 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4262 * info.suboffsets = NULL
4263 * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
4264 * info.readonly = not PyArray_ISWRITEABLE(self)
4265 *
4266 */
4267 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
4268
4269 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":293
4270 * info.suboffsets = NULL
4271 * info.itemsize = PyArray_ITEMSIZE(self)
4272 * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
4273 *
4274 * cdef int t
4275 */
4276 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
4277
4278 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":296
4279 *
4280 * cdef int t
4281 * cdef char* f = NULL # <<<<<<<<<<<<<<
4282 * cdef dtype descr = <dtype>PyArray_DESCR(self)
4283 * cdef int offset
4284 */
4285 __pyx_v_f = NULL;
4286
4287 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":297
4288 * cdef int t
4289 * cdef char* f = NULL
4290 * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
4291 * cdef int offset
4292 *
4293 */
4294 __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
4295 __pyx_t_3 = ((PyObject *)__pyx_t_7);
4296 __Pyx_INCREF(__pyx_t_3);
4297 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
4298 __pyx_t_3 = 0;
4299
4300 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":300
4301 * cdef int offset
4302 *
4303 * info.obj = self # <<<<<<<<<<<<<<
4304 *
4305 * if not PyDataType_HASFIELDS(descr):
4306 */
4307 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4308 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4309 __Pyx_GOTREF(__pyx_v_info->obj);
4310 __Pyx_DECREF(__pyx_v_info->obj);
4311 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
4312
4313 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":302
4314 * info.obj = self
4315 *
4316 * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
4317 * t = descr.type_num
4318 * if ((descr.byteorder == c'>' and little_endian) or
4319 */
4320 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
4321 if (__pyx_t_1) {
4322
4323 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":303
4324 *
4325 * if not PyDataType_HASFIELDS(descr):
4326 * t = descr.type_num # <<<<<<<<<<<<<<
4327 * if ((descr.byteorder == c'>' and little_endian) or
4328 * (descr.byteorder == c'<' and not little_endian)):
4329 */
4330 __pyx_t_4 = __pyx_v_descr->type_num;
4331 __pyx_v_t = __pyx_t_4;
4332
4333 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":304
4334 * if not PyDataType_HASFIELDS(descr):
4335 * t = descr.type_num
4336 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4337 * (descr.byteorder == c'<' and not little_endian)):
4338 * raise ValueError(u"Non-native byte order not supported")
4339 */
4340 __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
4341 if (!__pyx_t_2) {
4342 goto __pyx_L15_next_or;
4343 } else {
4344 }
4345 __pyx_t_2 = (__pyx_v_little_endian != 0);
4346 if (!__pyx_t_2) {
4347 } else {
4348 __pyx_t_1 = __pyx_t_2;
4349 goto __pyx_L14_bool_binop_done;
4350 }
4351 __pyx_L15_next_or:;
4352
4353 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":305
4354 * t = descr.type_num
4355 * if ((descr.byteorder == c'>' and little_endian) or
4356 * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
4357 * raise ValueError(u"Non-native byte order not supported")
4358 * if t == NPY_BYTE: f = "b"
4359 */
4360 __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
4361 if (__pyx_t_2) {
4362 } else {
4363 __pyx_t_1 = __pyx_t_2;
4364 goto __pyx_L14_bool_binop_done;
4365 }
4366 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
4367 __pyx_t_1 = __pyx_t_2;
4368 __pyx_L14_bool_binop_done:;
4369
4370 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":304
4371 * if not PyDataType_HASFIELDS(descr):
4372 * t = descr.type_num
4373 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4374 * (descr.byteorder == c'<' and not little_endian)):
4375 * raise ValueError(u"Non-native byte order not supported")
4376 */
4377 if (unlikely(__pyx_t_1)) {
4378
4379 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":306
4380 * if ((descr.byteorder == c'>' and little_endian) or
4381 * (descr.byteorder == c'<' and not little_endian)):
4382 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
4383 * if t == NPY_BYTE: f = "b"
4384 * elif t == NPY_UBYTE: f = "B"
4385 */
4386 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
4387 __Pyx_GOTREF(__pyx_t_3);
4388 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4389 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4390 __PYX_ERR(2, 306, __pyx_L1_error)
4391
4392 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":304
4393 * if not PyDataType_HASFIELDS(descr):
4394 * t = descr.type_num
4395 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4396 * (descr.byteorder == c'<' and not little_endian)):
4397 * raise ValueError(u"Non-native byte order not supported")
4398 */
4399 }
4400
4401 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":307
4402 * (descr.byteorder == c'<' and not little_endian)):
4403 * raise ValueError(u"Non-native byte order not supported")
4404 * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
4405 * elif t == NPY_UBYTE: f = "B"
4406 * elif t == NPY_SHORT: f = "h"
4407 */
4408 switch (__pyx_v_t) {
4409 case NPY_BYTE:
4410 __pyx_v_f = ((char *)"b");
4411 break;
4412 case NPY_UBYTE:
4413
4414 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":308
4415 * raise ValueError(u"Non-native byte order not supported")
4416 * if t == NPY_BYTE: f = "b"
4417 * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
4418 * elif t == NPY_SHORT: f = "h"
4419 * elif t == NPY_USHORT: f = "H"
4420 */
4421 __pyx_v_f = ((char *)"B");
4422 break;
4423 case NPY_SHORT:
4424
4425 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":309
4426 * if t == NPY_BYTE: f = "b"
4427 * elif t == NPY_UBYTE: f = "B"
4428 * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
4429 * elif t == NPY_USHORT: f = "H"
4430 * elif t == NPY_INT: f = "i"
4431 */
4432 __pyx_v_f = ((char *)"h");
4433 break;
4434 case NPY_USHORT:
4435
4436 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":310
4437 * elif t == NPY_UBYTE: f = "B"
4438 * elif t == NPY_SHORT: f = "h"
4439 * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
4440 * elif t == NPY_INT: f = "i"
4441 * elif t == NPY_UINT: f = "I"
4442 */
4443 __pyx_v_f = ((char *)"H");
4444 break;
4445 case NPY_INT:
4446
4447 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":311
4448 * elif t == NPY_SHORT: f = "h"
4449 * elif t == NPY_USHORT: f = "H"
4450 * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
4451 * elif t == NPY_UINT: f = "I"
4452 * elif t == NPY_LONG: f = "l"
4453 */
4454 __pyx_v_f = ((char *)"i");
4455 break;
4456 case NPY_UINT:
4457
4458 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":312
4459 * elif t == NPY_USHORT: f = "H"
4460 * elif t == NPY_INT: f = "i"
4461 * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
4462 * elif t == NPY_LONG: f = "l"
4463 * elif t == NPY_ULONG: f = "L"
4464 */
4465 __pyx_v_f = ((char *)"I");
4466 break;
4467 case NPY_LONG:
4468
4469 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":313
4470 * elif t == NPY_INT: f = "i"
4471 * elif t == NPY_UINT: f = "I"
4472 * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
4473 * elif t == NPY_ULONG: f = "L"
4474 * elif t == NPY_LONGLONG: f = "q"
4475 */
4476 __pyx_v_f = ((char *)"l");
4477 break;
4478 case NPY_ULONG:
4479
4480 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":314
4481 * elif t == NPY_UINT: f = "I"
4482 * elif t == NPY_LONG: f = "l"
4483 * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
4484 * elif t == NPY_LONGLONG: f = "q"
4485 * elif t == NPY_ULONGLONG: f = "Q"
4486 */
4487 __pyx_v_f = ((char *)"L");
4488 break;
4489 case NPY_LONGLONG:
4490
4491 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":315
4492 * elif t == NPY_LONG: f = "l"
4493 * elif t == NPY_ULONG: f = "L"
4494 * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
4495 * elif t == NPY_ULONGLONG: f = "Q"
4496 * elif t == NPY_FLOAT: f = "f"
4497 */
4498 __pyx_v_f = ((char *)"q");
4499 break;
4500 case NPY_ULONGLONG:
4501
4502 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":316
4503 * elif t == NPY_ULONG: f = "L"
4504 * elif t == NPY_LONGLONG: f = "q"
4505 * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
4506 * elif t == NPY_FLOAT: f = "f"
4507 * elif t == NPY_DOUBLE: f = "d"
4508 */
4509 __pyx_v_f = ((char *)"Q");
4510 break;
4511 case NPY_FLOAT:
4512
4513 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":317
4514 * elif t == NPY_LONGLONG: f = "q"
4515 * elif t == NPY_ULONGLONG: f = "Q"
4516 * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
4517 * elif t == NPY_DOUBLE: f = "d"
4518 * elif t == NPY_LONGDOUBLE: f = "g"
4519 */
4520 __pyx_v_f = ((char *)"f");
4521 break;
4522 case NPY_DOUBLE:
4523
4524 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":318
4525 * elif t == NPY_ULONGLONG: f = "Q"
4526 * elif t == NPY_FLOAT: f = "f"
4527 * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
4528 * elif t == NPY_LONGDOUBLE: f = "g"
4529 * elif t == NPY_CFLOAT: f = "Zf"
4530 */
4531 __pyx_v_f = ((char *)"d");
4532 break;
4533 case NPY_LONGDOUBLE:
4534
4535 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":319
4536 * elif t == NPY_FLOAT: f = "f"
4537 * elif t == NPY_DOUBLE: f = "d"
4538 * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
4539 * elif t == NPY_CFLOAT: f = "Zf"
4540 * elif t == NPY_CDOUBLE: f = "Zd"
4541 */
4542 __pyx_v_f = ((char *)"g");
4543 break;
4544 case NPY_CFLOAT:
4545
4546 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":320
4547 * elif t == NPY_DOUBLE: f = "d"
4548 * elif t == NPY_LONGDOUBLE: f = "g"
4549 * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
4550 * elif t == NPY_CDOUBLE: f = "Zd"
4551 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4552 */
4553 __pyx_v_f = ((char *)"Zf");
4554 break;
4555 case NPY_CDOUBLE:
4556
4557 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":321
4558 * elif t == NPY_LONGDOUBLE: f = "g"
4559 * elif t == NPY_CFLOAT: f = "Zf"
4560 * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
4561 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4562 * elif t == NPY_OBJECT: f = "O"
4563 */
4564 __pyx_v_f = ((char *)"Zd");
4565 break;
4566 case NPY_CLONGDOUBLE:
4567
4568 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":322
4569 * elif t == NPY_CFLOAT: f = "Zf"
4570 * elif t == NPY_CDOUBLE: f = "Zd"
4571 * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
4572 * elif t == NPY_OBJECT: f = "O"
4573 * else:
4574 */
4575 __pyx_v_f = ((char *)"Zg");
4576 break;
4577 case NPY_OBJECT:
4578
4579 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":323
4580 * elif t == NPY_CDOUBLE: f = "Zd"
4581 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4582 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
4583 * else:
4584 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4585 */
4586 __pyx_v_f = ((char *)"O");
4587 break;
4588 default:
4589
4590 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":325
4591 * elif t == NPY_OBJECT: f = "O"
4592 * else:
4593 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
4594 * info.format = f
4595 * return
4596 */
4597 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
4598 __Pyx_GOTREF(__pyx_t_3);
4599 __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
4600 __Pyx_GOTREF(__pyx_t_8);
4601 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4602 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
4603 __Pyx_GOTREF(__pyx_t_3);
4604 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4605 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4606 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4607 __PYX_ERR(2, 325, __pyx_L1_error)
4608 break;
4609 }
4610
4611 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":326
4612 * else:
4613 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4614 * info.format = f # <<<<<<<<<<<<<<
4615 * return
4616 * else:
4617 */
4618 __pyx_v_info->format = __pyx_v_f;
4619
4620 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":327
4621 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4622 * info.format = f
4623 * return # <<<<<<<<<<<<<<
4624 * else:
4625 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4626 */
4627 __pyx_r = 0;
4628 goto __pyx_L0;
4629
4630 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":302
4631 * info.obj = self
4632 *
4633 * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
4634 * t = descr.type_num
4635 * if ((descr.byteorder == c'>' and little_endian) or
4636 */
4637 }
4638
4639 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":329
4640 * return
4641 * else:
4642 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
4643 * info.format[0] = c'^' # Native data types, manual alignment
4644 * offset = 0
4645 */
4646 /*else*/ {
4647 __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
4648
4649 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":330
4650 * else:
4651 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4652 * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
4653 * offset = 0
4654 * f = _util_dtypestring(descr, info.format + 1,
4655 */
4656 (__pyx_v_info->format[0]) = '^';
4657
4658 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":331
4659 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4660 * info.format[0] = c'^' # Native data types, manual alignment
4661 * offset = 0 # <<<<<<<<<<<<<<
4662 * f = _util_dtypestring(descr, info.format + 1,
4663 * info.format + _buffer_format_string_len,
4664 */
4665 __pyx_v_offset = 0;
4666
4667 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":332
4668 * info.format[0] = c'^' # Native data types, manual alignment
4669 * offset = 0
4670 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
4671 * info.format + _buffer_format_string_len,
4672 * &offset)
4673 */
4674 __pyx_t_9 = __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_9 == ((char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
4675 __pyx_v_f = __pyx_t_9;
4676
4677 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":335
4678 * info.format + _buffer_format_string_len,
4679 * &offset)
4680 * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
4681 *
4682 * def __releasebuffer__(ndarray self, Py_buffer* info):
4683 */
4684 (__pyx_v_f[0]) = '\x00';
4685 }
4686
4687 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":258
4688 * # experimental exception made for __getbuffer__ and __releasebuffer__
4689 * # -- the details of this may change.
4690 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
4691 * # This implementation of getbuffer is geared towards Cython
4692 * # requirements, and does not yet fulfill the PEP.
4693 */
4694
4695 /* function exit code */
4696 __pyx_r = 0;
4697 goto __pyx_L0;
4698 __pyx_L1_error:;
4699 __Pyx_XDECREF(__pyx_t_3);
4700 __Pyx_XDECREF(__pyx_t_8);
4701 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4702 __pyx_r = -1;
4703 if (__pyx_v_info->obj != NULL) {
4704 __Pyx_GOTREF(__pyx_v_info->obj);
4705 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4706 }
4707 goto __pyx_L2;
4708 __pyx_L0:;
4709 if (__pyx_v_info->obj == Py_None) {
4710 __Pyx_GOTREF(__pyx_v_info->obj);
4711 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4712 }
4713 __pyx_L2:;
4714 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
4715 __Pyx_RefNannyFinishContext();
4716 return __pyx_r;
4717 }
4718
4719 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":337
4720 * f[0] = c'\0' # Terminate format string
4721 *
4722 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
4723 * if PyArray_HASFIELDS(self):
4724 * PyObject_Free(info.format)
4725 */
4726
4727 /* Python wrapper */
4728 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
__pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info)4729 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4730 __Pyx_RefNannyDeclarations
4731 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
4732 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
4733
4734 /* function exit code */
4735 __Pyx_RefNannyFinishContext();
4736 }
4737
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)4738 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4739 __Pyx_RefNannyDeclarations
4740 int __pyx_t_1;
4741 __Pyx_RefNannySetupContext("__releasebuffer__", 0);
4742
4743 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":338
4744 *
4745 * def __releasebuffer__(ndarray self, Py_buffer* info):
4746 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
4747 * PyObject_Free(info.format)
4748 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4749 */
4750 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
4751 if (__pyx_t_1) {
4752
4753 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":339
4754 * def __releasebuffer__(ndarray self, Py_buffer* info):
4755 * if PyArray_HASFIELDS(self):
4756 * PyObject_Free(info.format) # <<<<<<<<<<<<<<
4757 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4758 * PyObject_Free(info.strides)
4759 */
4760 PyObject_Free(__pyx_v_info->format);
4761
4762 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":338
4763 *
4764 * def __releasebuffer__(ndarray self, Py_buffer* info):
4765 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
4766 * PyObject_Free(info.format)
4767 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4768 */
4769 }
4770
4771 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":340
4772 * if PyArray_HASFIELDS(self):
4773 * PyObject_Free(info.format)
4774 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4775 * PyObject_Free(info.strides)
4776 * # info.shape was stored after info.strides in the same block
4777 */
4778 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4779 if (__pyx_t_1) {
4780
4781 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":341
4782 * PyObject_Free(info.format)
4783 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4784 * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
4785 * # info.shape was stored after info.strides in the same block
4786 *
4787 */
4788 PyObject_Free(__pyx_v_info->strides);
4789
4790 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":340
4791 * if PyArray_HASFIELDS(self):
4792 * PyObject_Free(info.format)
4793 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4794 * PyObject_Free(info.strides)
4795 * # info.shape was stored after info.strides in the same block
4796 */
4797 }
4798
4799 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":337
4800 * f[0] = c'\0' # Terminate format string
4801 *
4802 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
4803 * if PyArray_HASFIELDS(self):
4804 * PyObject_Free(info.format)
4805 */
4806
4807 /* function exit code */
4808 __Pyx_RefNannyFinishContext();
4809 }
4810
4811 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":821
4812 * ctypedef npy_cdouble complex_t
4813 *
4814 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4815 * return PyArray_MultiIterNew(1, <void*>a)
4816 *
4817 */
4818
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)4819 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4820 PyObject *__pyx_r = NULL;
4821 __Pyx_RefNannyDeclarations
4822 PyObject *__pyx_t_1 = NULL;
4823 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
4824
4825 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":822
4826 *
4827 * cdef inline object PyArray_MultiIterNew1(a):
4828 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
4829 *
4830 * cdef inline object PyArray_MultiIterNew2(a, b):
4831 */
4832 __Pyx_XDECREF(__pyx_r);
4833 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
4834 __Pyx_GOTREF(__pyx_t_1);
4835 __pyx_r = __pyx_t_1;
4836 __pyx_t_1 = 0;
4837 goto __pyx_L0;
4838
4839 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":821
4840 * ctypedef npy_cdouble complex_t
4841 *
4842 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4843 * return PyArray_MultiIterNew(1, <void*>a)
4844 *
4845 */
4846
4847 /* function exit code */
4848 __pyx_L1_error:;
4849 __Pyx_XDECREF(__pyx_t_1);
4850 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4851 __pyx_r = 0;
4852 __pyx_L0:;
4853 __Pyx_XGIVEREF(__pyx_r);
4854 __Pyx_RefNannyFinishContext();
4855 return __pyx_r;
4856 }
4857
4858 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":824
4859 * return PyArray_MultiIterNew(1, <void*>a)
4860 *
4861 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4862 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4863 *
4864 */
4865
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)4866 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4867 PyObject *__pyx_r = NULL;
4868 __Pyx_RefNannyDeclarations
4869 PyObject *__pyx_t_1 = NULL;
4870 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
4871
4872 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":825
4873 *
4874 * cdef inline object PyArray_MultiIterNew2(a, b):
4875 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
4876 *
4877 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4878 */
4879 __Pyx_XDECREF(__pyx_r);
4880 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
4881 __Pyx_GOTREF(__pyx_t_1);
4882 __pyx_r = __pyx_t_1;
4883 __pyx_t_1 = 0;
4884 goto __pyx_L0;
4885
4886 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":824
4887 * return PyArray_MultiIterNew(1, <void*>a)
4888 *
4889 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4890 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4891 *
4892 */
4893
4894 /* function exit code */
4895 __pyx_L1_error:;
4896 __Pyx_XDECREF(__pyx_t_1);
4897 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4898 __pyx_r = 0;
4899 __pyx_L0:;
4900 __Pyx_XGIVEREF(__pyx_r);
4901 __Pyx_RefNannyFinishContext();
4902 return __pyx_r;
4903 }
4904
4905 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":827
4906 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4907 *
4908 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4909 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4910 *
4911 */
4912
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)4913 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4914 PyObject *__pyx_r = NULL;
4915 __Pyx_RefNannyDeclarations
4916 PyObject *__pyx_t_1 = NULL;
4917 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4918
4919 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":828
4920 *
4921 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4922 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4923 *
4924 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4925 */
4926 __Pyx_XDECREF(__pyx_r);
4927 __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(2, 828, __pyx_L1_error)
4928 __Pyx_GOTREF(__pyx_t_1);
4929 __pyx_r = __pyx_t_1;
4930 __pyx_t_1 = 0;
4931 goto __pyx_L0;
4932
4933 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":827
4934 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4935 *
4936 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4937 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4938 *
4939 */
4940
4941 /* function exit code */
4942 __pyx_L1_error:;
4943 __Pyx_XDECREF(__pyx_t_1);
4944 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4945 __pyx_r = 0;
4946 __pyx_L0:;
4947 __Pyx_XGIVEREF(__pyx_r);
4948 __Pyx_RefNannyFinishContext();
4949 return __pyx_r;
4950 }
4951
4952 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":830
4953 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4954 *
4955 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4956 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4957 *
4958 */
4959
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)4960 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) {
4961 PyObject *__pyx_r = NULL;
4962 __Pyx_RefNannyDeclarations
4963 PyObject *__pyx_t_1 = NULL;
4964 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
4965
4966 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":831
4967 *
4968 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4969 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
4970 *
4971 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4972 */
4973 __Pyx_XDECREF(__pyx_r);
4974 __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(2, 831, __pyx_L1_error)
4975 __Pyx_GOTREF(__pyx_t_1);
4976 __pyx_r = __pyx_t_1;
4977 __pyx_t_1 = 0;
4978 goto __pyx_L0;
4979
4980 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":830
4981 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4982 *
4983 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4984 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4985 *
4986 */
4987
4988 /* function exit code */
4989 __pyx_L1_error:;
4990 __Pyx_XDECREF(__pyx_t_1);
4991 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4992 __pyx_r = 0;
4993 __pyx_L0:;
4994 __Pyx_XGIVEREF(__pyx_r);
4995 __Pyx_RefNannyFinishContext();
4996 return __pyx_r;
4997 }
4998
4999 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
5000 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5001 *
5002 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5003 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5004 *
5005 */
5006
__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)5007 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) {
5008 PyObject *__pyx_r = NULL;
5009 __Pyx_RefNannyDeclarations
5010 PyObject *__pyx_t_1 = NULL;
5011 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
5012
5013 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":834
5014 *
5015 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5016 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
5017 *
5018 * cdef inline tuple PyDataType_SHAPE(dtype d):
5019 */
5020 __Pyx_XDECREF(__pyx_r);
5021 __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(2, 834, __pyx_L1_error)
5022 __Pyx_GOTREF(__pyx_t_1);
5023 __pyx_r = __pyx_t_1;
5024 __pyx_t_1 = 0;
5025 goto __pyx_L0;
5026
5027 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
5028 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5029 *
5030 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5031 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5032 *
5033 */
5034
5035 /* function exit code */
5036 __pyx_L1_error:;
5037 __Pyx_XDECREF(__pyx_t_1);
5038 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5039 __pyx_r = 0;
5040 __pyx_L0:;
5041 __Pyx_XGIVEREF(__pyx_r);
5042 __Pyx_RefNannyFinishContext();
5043 return __pyx_r;
5044 }
5045
5046 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":836
5047 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5048 *
5049 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5050 * if PyDataType_HASSUBARRAY(d):
5051 * return <tuple>d.subarray.shape
5052 */
5053
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)5054 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5055 PyObject *__pyx_r = NULL;
5056 __Pyx_RefNannyDeclarations
5057 int __pyx_t_1;
5058 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
5059
5060 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":837
5061 *
5062 * cdef inline tuple PyDataType_SHAPE(dtype d):
5063 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5064 * return <tuple>d.subarray.shape
5065 * else:
5066 */
5067 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
5068 if (__pyx_t_1) {
5069
5070 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":838
5071 * cdef inline tuple PyDataType_SHAPE(dtype d):
5072 * if PyDataType_HASSUBARRAY(d):
5073 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
5074 * else:
5075 * return ()
5076 */
5077 __Pyx_XDECREF(__pyx_r);
5078 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
5079 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
5080 goto __pyx_L0;
5081
5082 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":837
5083 *
5084 * cdef inline tuple PyDataType_SHAPE(dtype d):
5085 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5086 * return <tuple>d.subarray.shape
5087 * else:
5088 */
5089 }
5090
5091 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":840
5092 * return <tuple>d.subarray.shape
5093 * else:
5094 * return () # <<<<<<<<<<<<<<
5095 *
5096 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
5097 */
5098 /*else*/ {
5099 __Pyx_XDECREF(__pyx_r);
5100 __Pyx_INCREF(__pyx_empty_tuple);
5101 __pyx_r = __pyx_empty_tuple;
5102 goto __pyx_L0;
5103 }
5104
5105 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":836
5106 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5107 *
5108 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5109 * if PyDataType_HASSUBARRAY(d):
5110 * return <tuple>d.subarray.shape
5111 */
5112
5113 /* function exit code */
5114 __pyx_L0:;
5115 __Pyx_XGIVEREF(__pyx_r);
5116 __Pyx_RefNannyFinishContext();
5117 return __pyx_r;
5118 }
5119
5120 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":842
5121 * return ()
5122 *
5123 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
5124 * # Recursive utility function used in __getbuffer__ to get format
5125 * # string. The new location in the format string is returned.
5126 */
5127
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)5128 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) {
5129 PyArray_Descr *__pyx_v_child = 0;
5130 int __pyx_v_endian_detector;
5131 int __pyx_v_little_endian;
5132 PyObject *__pyx_v_fields = 0;
5133 PyObject *__pyx_v_childname = NULL;
5134 PyObject *__pyx_v_new_offset = NULL;
5135 PyObject *__pyx_v_t = NULL;
5136 char *__pyx_r;
5137 __Pyx_RefNannyDeclarations
5138 PyObject *__pyx_t_1 = NULL;
5139 Py_ssize_t __pyx_t_2;
5140 PyObject *__pyx_t_3 = NULL;
5141 PyObject *__pyx_t_4 = NULL;
5142 int __pyx_t_5;
5143 int __pyx_t_6;
5144 int __pyx_t_7;
5145 long __pyx_t_8;
5146 char *__pyx_t_9;
5147 __Pyx_RefNannySetupContext("_util_dtypestring", 0);
5148
5149 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":847
5150 *
5151 * cdef dtype child
5152 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
5153 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5154 * cdef tuple fields
5155 */
5156 __pyx_v_endian_detector = 1;
5157
5158 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":848
5159 * cdef dtype child
5160 * cdef int endian_detector = 1
5161 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
5162 * cdef tuple fields
5163 *
5164 */
5165 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
5166
5167 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":851
5168 * cdef tuple fields
5169 *
5170 * for childname in descr.names: # <<<<<<<<<<<<<<
5171 * fields = descr.fields[childname]
5172 * child, new_offset = fields
5173 */
5174 if (unlikely(__pyx_v_descr->names == Py_None)) {
5175 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
5176 __PYX_ERR(2, 851, __pyx_L1_error)
5177 }
5178 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5179 for (;;) {
5180 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
5181 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5182 __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(2, 851, __pyx_L1_error)
5183 #else
5184 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
5185 __Pyx_GOTREF(__pyx_t_3);
5186 #endif
5187 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
5188 __pyx_t_3 = 0;
5189
5190 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":852
5191 *
5192 * for childname in descr.names:
5193 * fields = descr.fields[childname] # <<<<<<<<<<<<<<
5194 * child, new_offset = fields
5195 *
5196 */
5197 if (unlikely(__pyx_v_descr->fields == Py_None)) {
5198 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5199 __PYX_ERR(2, 852, __pyx_L1_error)
5200 }
5201 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
5202 __Pyx_GOTREF(__pyx_t_3);
5203 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(2, 852, __pyx_L1_error)
5204 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
5205 __pyx_t_3 = 0;
5206
5207 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":853
5208 * for childname in descr.names:
5209 * fields = descr.fields[childname]
5210 * child, new_offset = fields # <<<<<<<<<<<<<<
5211 *
5212 * if (end - f) - <int>(new_offset - offset[0]) < 15:
5213 */
5214 if (likely(__pyx_v_fields != Py_None)) {
5215 PyObject* sequence = __pyx_v_fields;
5216 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5217 if (unlikely(size != 2)) {
5218 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5219 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5220 __PYX_ERR(2, 853, __pyx_L1_error)
5221 }
5222 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5223 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
5224 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
5225 __Pyx_INCREF(__pyx_t_3);
5226 __Pyx_INCREF(__pyx_t_4);
5227 #else
5228 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
5229 __Pyx_GOTREF(__pyx_t_3);
5230 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
5231 __Pyx_GOTREF(__pyx_t_4);
5232 #endif
5233 } else {
5234 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
5235 }
5236 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
5237 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
5238 __pyx_t_3 = 0;
5239 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
5240 __pyx_t_4 = 0;
5241
5242 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":855
5243 * child, new_offset = fields
5244 *
5245 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
5246 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5247 *
5248 */
5249 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
5250 __Pyx_GOTREF(__pyx_t_4);
5251 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
5252 __Pyx_GOTREF(__pyx_t_3);
5253 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5254 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
5255 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5256 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
5257 if (unlikely(__pyx_t_6)) {
5258
5259 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":856
5260 *
5261 * if (end - f) - <int>(new_offset - offset[0]) < 15:
5262 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
5263 *
5264 * if ((child.byteorder == c'>' and little_endian) or
5265 */
5266 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
5267 __Pyx_GOTREF(__pyx_t_3);
5268 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5269 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5270 __PYX_ERR(2, 856, __pyx_L1_error)
5271
5272 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":855
5273 * child, new_offset = fields
5274 *
5275 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
5276 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5277 *
5278 */
5279 }
5280
5281 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":858
5282 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5283 *
5284 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5285 * (child.byteorder == c'<' and not little_endian)):
5286 * raise ValueError(u"Non-native byte order not supported")
5287 */
5288 __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
5289 if (!__pyx_t_7) {
5290 goto __pyx_L8_next_or;
5291 } else {
5292 }
5293 __pyx_t_7 = (__pyx_v_little_endian != 0);
5294 if (!__pyx_t_7) {
5295 } else {
5296 __pyx_t_6 = __pyx_t_7;
5297 goto __pyx_L7_bool_binop_done;
5298 }
5299 __pyx_L8_next_or:;
5300
5301 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":859
5302 *
5303 * if ((child.byteorder == c'>' and little_endian) or
5304 * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
5305 * raise ValueError(u"Non-native byte order not supported")
5306 * # One could encode it in the format string and have Cython
5307 */
5308 __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
5309 if (__pyx_t_7) {
5310 } else {
5311 __pyx_t_6 = __pyx_t_7;
5312 goto __pyx_L7_bool_binop_done;
5313 }
5314 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
5315 __pyx_t_6 = __pyx_t_7;
5316 __pyx_L7_bool_binop_done:;
5317
5318 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":858
5319 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5320 *
5321 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5322 * (child.byteorder == c'<' and not little_endian)):
5323 * raise ValueError(u"Non-native byte order not supported")
5324 */
5325 if (unlikely(__pyx_t_6)) {
5326
5327 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":860
5328 * if ((child.byteorder == c'>' and little_endian) or
5329 * (child.byteorder == c'<' and not little_endian)):
5330 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
5331 * # One could encode it in the format string and have Cython
5332 * # complain instead, BUT: < and > in format strings also imply
5333 */
5334 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
5335 __Pyx_GOTREF(__pyx_t_3);
5336 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5337 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5338 __PYX_ERR(2, 860, __pyx_L1_error)
5339
5340 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":858
5341 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5342 *
5343 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5344 * (child.byteorder == c'<' and not little_endian)):
5345 * raise ValueError(u"Non-native byte order not supported")
5346 */
5347 }
5348
5349 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":870
5350 *
5351 * # Output padding bytes
5352 * while offset[0] < new_offset: # <<<<<<<<<<<<<<
5353 * f[0] = 120 # "x"; pad byte
5354 * f += 1
5355 */
5356 while (1) {
5357 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
5358 __Pyx_GOTREF(__pyx_t_3);
5359 __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(2, 870, __pyx_L1_error)
5360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5361 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
5362 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5363 if (!__pyx_t_6) break;
5364
5365 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":871
5366 * # Output padding bytes
5367 * while offset[0] < new_offset:
5368 * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
5369 * f += 1
5370 * offset[0] += 1
5371 */
5372 (__pyx_v_f[0]) = 0x78;
5373
5374 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":872
5375 * while offset[0] < new_offset:
5376 * f[0] = 120 # "x"; pad byte
5377 * f += 1 # <<<<<<<<<<<<<<
5378 * offset[0] += 1
5379 *
5380 */
5381 __pyx_v_f = (__pyx_v_f + 1);
5382
5383 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":873
5384 * f[0] = 120 # "x"; pad byte
5385 * f += 1
5386 * offset[0] += 1 # <<<<<<<<<<<<<<
5387 *
5388 * offset[0] += child.itemsize
5389 */
5390 __pyx_t_8 = 0;
5391 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
5392 }
5393
5394 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":875
5395 * offset[0] += 1
5396 *
5397 * offset[0] += child.itemsize # <<<<<<<<<<<<<<
5398 *
5399 * if not PyDataType_HASFIELDS(child):
5400 */
5401 __pyx_t_8 = 0;
5402 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
5403
5404 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":877
5405 * offset[0] += child.itemsize
5406 *
5407 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
5408 * t = child.type_num
5409 * if end - f < 5:
5410 */
5411 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
5412 if (__pyx_t_6) {
5413
5414 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":878
5415 *
5416 * if not PyDataType_HASFIELDS(child):
5417 * t = child.type_num # <<<<<<<<<<<<<<
5418 * if end - f < 5:
5419 * raise RuntimeError(u"Format string allocated too short.")
5420 */
5421 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
5422 __Pyx_GOTREF(__pyx_t_4);
5423 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
5424 __pyx_t_4 = 0;
5425
5426 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":879
5427 * if not PyDataType_HASFIELDS(child):
5428 * t = child.type_num
5429 * if end - f < 5: # <<<<<<<<<<<<<<
5430 * raise RuntimeError(u"Format string allocated too short.")
5431 *
5432 */
5433 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
5434 if (unlikely(__pyx_t_6)) {
5435
5436 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":880
5437 * t = child.type_num
5438 * if end - f < 5:
5439 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
5440 *
5441 * # Until ticket #99 is fixed, use integers to avoid warnings
5442 */
5443 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
5444 __Pyx_GOTREF(__pyx_t_4);
5445 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5446 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5447 __PYX_ERR(2, 880, __pyx_L1_error)
5448
5449 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":879
5450 * if not PyDataType_HASFIELDS(child):
5451 * t = child.type_num
5452 * if end - f < 5: # <<<<<<<<<<<<<<
5453 * raise RuntimeError(u"Format string allocated too short.")
5454 *
5455 */
5456 }
5457
5458 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":883
5459 *
5460 * # Until ticket #99 is fixed, use integers to avoid warnings
5461 * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
5462 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5463 * elif t == NPY_SHORT: f[0] = 104 #"h"
5464 */
5465 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
5466 __Pyx_GOTREF(__pyx_t_4);
5467 __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(2, 883, __pyx_L1_error)
5468 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5469 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
5470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5471 if (__pyx_t_6) {
5472 (__pyx_v_f[0]) = 98;
5473 goto __pyx_L15;
5474 }
5475
5476 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":884
5477 * # Until ticket #99 is fixed, use integers to avoid warnings
5478 * if t == NPY_BYTE: f[0] = 98 #"b"
5479 * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
5480 * elif t == NPY_SHORT: f[0] = 104 #"h"
5481 * elif t == NPY_USHORT: f[0] = 72 #"H"
5482 */
5483 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
5484 __Pyx_GOTREF(__pyx_t_3);
5485 __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(2, 884, __pyx_L1_error)
5486 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5487 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
5488 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5489 if (__pyx_t_6) {
5490 (__pyx_v_f[0]) = 66;
5491 goto __pyx_L15;
5492 }
5493
5494 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":885
5495 * if t == NPY_BYTE: f[0] = 98 #"b"
5496 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5497 * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
5498 * elif t == NPY_USHORT: f[0] = 72 #"H"
5499 * elif t == NPY_INT: f[0] = 105 #"i"
5500 */
5501 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
5502 __Pyx_GOTREF(__pyx_t_4);
5503 __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(2, 885, __pyx_L1_error)
5504 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5505 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
5506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5507 if (__pyx_t_6) {
5508 (__pyx_v_f[0]) = 0x68;
5509 goto __pyx_L15;
5510 }
5511
5512 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":886
5513 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5514 * elif t == NPY_SHORT: f[0] = 104 #"h"
5515 * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
5516 * elif t == NPY_INT: f[0] = 105 #"i"
5517 * elif t == NPY_UINT: f[0] = 73 #"I"
5518 */
5519 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
5520 __Pyx_GOTREF(__pyx_t_3);
5521 __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(2, 886, __pyx_L1_error)
5522 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5523 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
5524 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5525 if (__pyx_t_6) {
5526 (__pyx_v_f[0]) = 72;
5527 goto __pyx_L15;
5528 }
5529
5530 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":887
5531 * elif t == NPY_SHORT: f[0] = 104 #"h"
5532 * elif t == NPY_USHORT: f[0] = 72 #"H"
5533 * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
5534 * elif t == NPY_UINT: f[0] = 73 #"I"
5535 * elif t == NPY_LONG: f[0] = 108 #"l"
5536 */
5537 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
5538 __Pyx_GOTREF(__pyx_t_4);
5539 __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(2, 887, __pyx_L1_error)
5540 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5541 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
5542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5543 if (__pyx_t_6) {
5544 (__pyx_v_f[0]) = 0x69;
5545 goto __pyx_L15;
5546 }
5547
5548 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":888
5549 * elif t == NPY_USHORT: f[0] = 72 #"H"
5550 * elif t == NPY_INT: f[0] = 105 #"i"
5551 * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
5552 * elif t == NPY_LONG: f[0] = 108 #"l"
5553 * elif t == NPY_ULONG: f[0] = 76 #"L"
5554 */
5555 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
5556 __Pyx_GOTREF(__pyx_t_3);
5557 __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(2, 888, __pyx_L1_error)
5558 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5559 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
5560 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5561 if (__pyx_t_6) {
5562 (__pyx_v_f[0]) = 73;
5563 goto __pyx_L15;
5564 }
5565
5566 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":889
5567 * elif t == NPY_INT: f[0] = 105 #"i"
5568 * elif t == NPY_UINT: f[0] = 73 #"I"
5569 * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
5570 * elif t == NPY_ULONG: f[0] = 76 #"L"
5571 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5572 */
5573 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
5574 __Pyx_GOTREF(__pyx_t_4);
5575 __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(2, 889, __pyx_L1_error)
5576 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5577 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
5578 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5579 if (__pyx_t_6) {
5580 (__pyx_v_f[0]) = 0x6C;
5581 goto __pyx_L15;
5582 }
5583
5584 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":890
5585 * elif t == NPY_UINT: f[0] = 73 #"I"
5586 * elif t == NPY_LONG: f[0] = 108 #"l"
5587 * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
5588 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5589 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5590 */
5591 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
5592 __Pyx_GOTREF(__pyx_t_3);
5593 __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(2, 890, __pyx_L1_error)
5594 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5595 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
5596 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5597 if (__pyx_t_6) {
5598 (__pyx_v_f[0]) = 76;
5599 goto __pyx_L15;
5600 }
5601
5602 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":891
5603 * elif t == NPY_LONG: f[0] = 108 #"l"
5604 * elif t == NPY_ULONG: f[0] = 76 #"L"
5605 * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
5606 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5607 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5608 */
5609 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
5610 __Pyx_GOTREF(__pyx_t_4);
5611 __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(2, 891, __pyx_L1_error)
5612 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5613 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
5614 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5615 if (__pyx_t_6) {
5616 (__pyx_v_f[0]) = 0x71;
5617 goto __pyx_L15;
5618 }
5619
5620 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":892
5621 * elif t == NPY_ULONG: f[0] = 76 #"L"
5622 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5623 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
5624 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5625 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5626 */
5627 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
5628 __Pyx_GOTREF(__pyx_t_3);
5629 __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(2, 892, __pyx_L1_error)
5630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5631 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
5632 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5633 if (__pyx_t_6) {
5634 (__pyx_v_f[0]) = 81;
5635 goto __pyx_L15;
5636 }
5637
5638 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":893
5639 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5640 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5641 * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
5642 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5643 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5644 */
5645 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
5646 __Pyx_GOTREF(__pyx_t_4);
5647 __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(2, 893, __pyx_L1_error)
5648 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5649 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
5650 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5651 if (__pyx_t_6) {
5652 (__pyx_v_f[0]) = 0x66;
5653 goto __pyx_L15;
5654 }
5655
5656 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":894
5657 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5658 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5659 * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
5660 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5661 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5662 */
5663 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
5664 __Pyx_GOTREF(__pyx_t_3);
5665 __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(2, 894, __pyx_L1_error)
5666 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5667 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
5668 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5669 if (__pyx_t_6) {
5670 (__pyx_v_f[0]) = 0x64;
5671 goto __pyx_L15;
5672 }
5673
5674 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":895
5675 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5676 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5677 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
5678 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5679 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5680 */
5681 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
5682 __Pyx_GOTREF(__pyx_t_4);
5683 __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(2, 895, __pyx_L1_error)
5684 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5685 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
5686 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5687 if (__pyx_t_6) {
5688 (__pyx_v_f[0]) = 0x67;
5689 goto __pyx_L15;
5690 }
5691
5692 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":896
5693 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5694 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5695 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
5696 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5697 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5698 */
5699 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
5700 __Pyx_GOTREF(__pyx_t_3);
5701 __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(2, 896, __pyx_L1_error)
5702 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5703 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
5704 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5705 if (__pyx_t_6) {
5706 (__pyx_v_f[0]) = 90;
5707 (__pyx_v_f[1]) = 0x66;
5708 __pyx_v_f = (__pyx_v_f + 1);
5709 goto __pyx_L15;
5710 }
5711
5712 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":897
5713 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5714 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5715 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
5716 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5717 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5718 */
5719 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
5720 __Pyx_GOTREF(__pyx_t_4);
5721 __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(2, 897, __pyx_L1_error)
5722 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5723 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
5724 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5725 if (__pyx_t_6) {
5726 (__pyx_v_f[0]) = 90;
5727 (__pyx_v_f[1]) = 0x64;
5728 __pyx_v_f = (__pyx_v_f + 1);
5729 goto __pyx_L15;
5730 }
5731
5732 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":898
5733 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5734 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5735 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
5736 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5737 * else:
5738 */
5739 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
5740 __Pyx_GOTREF(__pyx_t_3);
5741 __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(2, 898, __pyx_L1_error)
5742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5743 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
5744 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5745 if (__pyx_t_6) {
5746 (__pyx_v_f[0]) = 90;
5747 (__pyx_v_f[1]) = 0x67;
5748 __pyx_v_f = (__pyx_v_f + 1);
5749 goto __pyx_L15;
5750 }
5751
5752 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":899
5753 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5754 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5755 * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
5756 * else:
5757 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5758 */
5759 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
5760 __Pyx_GOTREF(__pyx_t_4);
5761 __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(2, 899, __pyx_L1_error)
5762 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5763 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
5764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5765 if (likely(__pyx_t_6)) {
5766 (__pyx_v_f[0]) = 79;
5767 goto __pyx_L15;
5768 }
5769
5770 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":901
5771 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5772 * else:
5773 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
5774 * f += 1
5775 * else:
5776 */
5777 /*else*/ {
5778 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
5779 __Pyx_GOTREF(__pyx_t_3);
5780 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
5781 __Pyx_GOTREF(__pyx_t_4);
5782 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5783 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5785 __PYX_ERR(2, 901, __pyx_L1_error)
5786 }
5787 __pyx_L15:;
5788
5789 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":902
5790 * else:
5791 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5792 * f += 1 # <<<<<<<<<<<<<<
5793 * else:
5794 * # Cython ignores struct boundary information ("T{...}"),
5795 */
5796 __pyx_v_f = (__pyx_v_f + 1);
5797
5798 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":877
5799 * offset[0] += child.itemsize
5800 *
5801 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
5802 * t = child.type_num
5803 * if end - f < 5:
5804 */
5805 goto __pyx_L13;
5806 }
5807
5808 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":906
5809 * # Cython ignores struct boundary information ("T{...}"),
5810 * # so don't output it
5811 * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
5812 * return f
5813 *
5814 */
5815 /*else*/ {
5816 __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 == ((char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
5817 __pyx_v_f = __pyx_t_9;
5818 }
5819 __pyx_L13:;
5820
5821 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":851
5822 * cdef tuple fields
5823 *
5824 * for childname in descr.names: # <<<<<<<<<<<<<<
5825 * fields = descr.fields[childname]
5826 * child, new_offset = fields
5827 */
5828 }
5829 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5830
5831 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":907
5832 * # so don't output it
5833 * f = _util_dtypestring(child, f, end, offset)
5834 * return f # <<<<<<<<<<<<<<
5835 *
5836 *
5837 */
5838 __pyx_r = __pyx_v_f;
5839 goto __pyx_L0;
5840
5841 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":842
5842 * return ()
5843 *
5844 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
5845 * # Recursive utility function used in __getbuffer__ to get format
5846 * # string. The new location in the format string is returned.
5847 */
5848
5849 /* function exit code */
5850 __pyx_L1_error:;
5851 __Pyx_XDECREF(__pyx_t_1);
5852 __Pyx_XDECREF(__pyx_t_3);
5853 __Pyx_XDECREF(__pyx_t_4);
5854 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
5855 __pyx_r = NULL;
5856 __pyx_L0:;
5857 __Pyx_XDECREF((PyObject *)__pyx_v_child);
5858 __Pyx_XDECREF(__pyx_v_fields);
5859 __Pyx_XDECREF(__pyx_v_childname);
5860 __Pyx_XDECREF(__pyx_v_new_offset);
5861 __Pyx_XDECREF(__pyx_v_t);
5862 __Pyx_RefNannyFinishContext();
5863 return __pyx_r;
5864 }
5865
5866 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1022
5867 * int _import_umath() except -1
5868 *
5869 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5870 * Py_INCREF(base) # important to do this before stealing the reference below!
5871 * PyArray_SetBaseObject(arr, base)
5872 */
5873
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)5874 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5875 __Pyx_RefNannyDeclarations
5876 __Pyx_RefNannySetupContext("set_array_base", 0);
5877
5878 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1023
5879 *
5880 * cdef inline void set_array_base(ndarray arr, object base):
5881 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
5882 * PyArray_SetBaseObject(arr, base)
5883 *
5884 */
5885 Py_INCREF(__pyx_v_base);
5886
5887 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1024
5888 * cdef inline void set_array_base(ndarray arr, object base):
5889 * Py_INCREF(base) # important to do this before stealing the reference below!
5890 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
5891 *
5892 * cdef inline object get_array_base(ndarray arr):
5893 */
5894 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
5895
5896 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1022
5897 * int _import_umath() except -1
5898 *
5899 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5900 * Py_INCREF(base) # important to do this before stealing the reference below!
5901 * PyArray_SetBaseObject(arr, base)
5902 */
5903
5904 /* function exit code */
5905 __Pyx_RefNannyFinishContext();
5906 }
5907
5908 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1026
5909 * PyArray_SetBaseObject(arr, base)
5910 *
5911 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5912 * base = PyArray_BASE(arr)
5913 * if base is NULL:
5914 */
5915
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)5916 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5917 PyObject *__pyx_v_base;
5918 PyObject *__pyx_r = NULL;
5919 __Pyx_RefNannyDeclarations
5920 int __pyx_t_1;
5921 __Pyx_RefNannySetupContext("get_array_base", 0);
5922
5923 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1027
5924 *
5925 * cdef inline object get_array_base(ndarray arr):
5926 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
5927 * if base is NULL:
5928 * return None
5929 */
5930 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5931
5932 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1028
5933 * cdef inline object get_array_base(ndarray arr):
5934 * base = PyArray_BASE(arr)
5935 * if base is NULL: # <<<<<<<<<<<<<<
5936 * return None
5937 * return <object>base
5938 */
5939 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
5940 if (__pyx_t_1) {
5941
5942 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1029
5943 * base = PyArray_BASE(arr)
5944 * if base is NULL:
5945 * return None # <<<<<<<<<<<<<<
5946 * return <object>base
5947 *
5948 */
5949 __Pyx_XDECREF(__pyx_r);
5950 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5951 goto __pyx_L0;
5952
5953 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1028
5954 * cdef inline object get_array_base(ndarray arr):
5955 * base = PyArray_BASE(arr)
5956 * if base is NULL: # <<<<<<<<<<<<<<
5957 * return None
5958 * return <object>base
5959 */
5960 }
5961
5962 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1030
5963 * if base is NULL:
5964 * return None
5965 * return <object>base # <<<<<<<<<<<<<<
5966 *
5967 * # Versions of the import_* functions which are more suitable for
5968 */
5969 __Pyx_XDECREF(__pyx_r);
5970 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5971 __pyx_r = ((PyObject *)__pyx_v_base);
5972 goto __pyx_L0;
5973
5974 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1026
5975 * PyArray_SetBaseObject(arr, base)
5976 *
5977 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5978 * base = PyArray_BASE(arr)
5979 * if base is NULL:
5980 */
5981
5982 /* function exit code */
5983 __pyx_L0:;
5984 __Pyx_XGIVEREF(__pyx_r);
5985 __Pyx_RefNannyFinishContext();
5986 return __pyx_r;
5987 }
5988
5989 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1034
5990 * # Versions of the import_* functions which are more suitable for
5991 * # Cython code.
5992 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5993 * try:
5994 * _import_array()
5995 */
5996
__pyx_f_5numpy_import_array(void)5997 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5998 int __pyx_r;
5999 __Pyx_RefNannyDeclarations
6000 PyObject *__pyx_t_1 = NULL;
6001 PyObject *__pyx_t_2 = NULL;
6002 PyObject *__pyx_t_3 = NULL;
6003 int __pyx_t_4;
6004 PyObject *__pyx_t_5 = NULL;
6005 PyObject *__pyx_t_6 = NULL;
6006 PyObject *__pyx_t_7 = NULL;
6007 PyObject *__pyx_t_8 = NULL;
6008 __Pyx_RefNannySetupContext("import_array", 0);
6009
6010 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6011 * # Cython code.
6012 * cdef inline int import_array() except -1:
6013 * try: # <<<<<<<<<<<<<<
6014 * _import_array()
6015 * except Exception:
6016 */
6017 {
6018 __Pyx_PyThreadState_declare
6019 __Pyx_PyThreadState_assign
6020 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6021 __Pyx_XGOTREF(__pyx_t_1);
6022 __Pyx_XGOTREF(__pyx_t_2);
6023 __Pyx_XGOTREF(__pyx_t_3);
6024 /*try:*/ {
6025
6026 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1036
6027 * cdef inline int import_array() except -1:
6028 * try:
6029 * _import_array() # <<<<<<<<<<<<<<
6030 * except Exception:
6031 * raise ImportError("numpy.core.multiarray failed to import")
6032 */
6033 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
6034
6035 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6036 * # Cython code.
6037 * cdef inline int import_array() except -1:
6038 * try: # <<<<<<<<<<<<<<
6039 * _import_array()
6040 * except Exception:
6041 */
6042 }
6043 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6044 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6045 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6046 goto __pyx_L8_try_end;
6047 __pyx_L3_error:;
6048
6049 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1037
6050 * try:
6051 * _import_array()
6052 * except Exception: # <<<<<<<<<<<<<<
6053 * raise ImportError("numpy.core.multiarray failed to import")
6054 *
6055 */
6056 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6057 if (__pyx_t_4) {
6058 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6059 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
6060 __Pyx_GOTREF(__pyx_t_5);
6061 __Pyx_GOTREF(__pyx_t_6);
6062 __Pyx_GOTREF(__pyx_t_7);
6063
6064 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1038
6065 * _import_array()
6066 * except Exception:
6067 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
6068 *
6069 * cdef inline int import_umath() except -1:
6070 */
6071 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
6072 __Pyx_GOTREF(__pyx_t_8);
6073 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6074 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6075 __PYX_ERR(2, 1038, __pyx_L5_except_error)
6076 }
6077 goto __pyx_L5_except_error;
6078 __pyx_L5_except_error:;
6079
6080 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6081 * # Cython code.
6082 * cdef inline int import_array() except -1:
6083 * try: # <<<<<<<<<<<<<<
6084 * _import_array()
6085 * except Exception:
6086 */
6087 __Pyx_XGIVEREF(__pyx_t_1);
6088 __Pyx_XGIVEREF(__pyx_t_2);
6089 __Pyx_XGIVEREF(__pyx_t_3);
6090 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6091 goto __pyx_L1_error;
6092 __pyx_L8_try_end:;
6093 }
6094
6095 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1034
6096 * # Versions of the import_* functions which are more suitable for
6097 * # Cython code.
6098 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6099 * try:
6100 * _import_array()
6101 */
6102
6103 /* function exit code */
6104 __pyx_r = 0;
6105 goto __pyx_L0;
6106 __pyx_L1_error:;
6107 __Pyx_XDECREF(__pyx_t_5);
6108 __Pyx_XDECREF(__pyx_t_6);
6109 __Pyx_XDECREF(__pyx_t_7);
6110 __Pyx_XDECREF(__pyx_t_8);
6111 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6112 __pyx_r = -1;
6113 __pyx_L0:;
6114 __Pyx_RefNannyFinishContext();
6115 return __pyx_r;
6116 }
6117
6118 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1040
6119 * raise ImportError("numpy.core.multiarray failed to import")
6120 *
6121 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6122 * try:
6123 * _import_umath()
6124 */
6125
__pyx_f_5numpy_import_umath(void)6126 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
6127 int __pyx_r;
6128 __Pyx_RefNannyDeclarations
6129 PyObject *__pyx_t_1 = NULL;
6130 PyObject *__pyx_t_2 = NULL;
6131 PyObject *__pyx_t_3 = NULL;
6132 int __pyx_t_4;
6133 PyObject *__pyx_t_5 = NULL;
6134 PyObject *__pyx_t_6 = NULL;
6135 PyObject *__pyx_t_7 = NULL;
6136 PyObject *__pyx_t_8 = NULL;
6137 __Pyx_RefNannySetupContext("import_umath", 0);
6138
6139 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6140 *
6141 * cdef inline int import_umath() except -1:
6142 * try: # <<<<<<<<<<<<<<
6143 * _import_umath()
6144 * except Exception:
6145 */
6146 {
6147 __Pyx_PyThreadState_declare
6148 __Pyx_PyThreadState_assign
6149 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6150 __Pyx_XGOTREF(__pyx_t_1);
6151 __Pyx_XGOTREF(__pyx_t_2);
6152 __Pyx_XGOTREF(__pyx_t_3);
6153 /*try:*/ {
6154
6155 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1042
6156 * cdef inline int import_umath() except -1:
6157 * try:
6158 * _import_umath() # <<<<<<<<<<<<<<
6159 * except Exception:
6160 * raise ImportError("numpy.core.umath failed to import")
6161 */
6162 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
6163
6164 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6165 *
6166 * cdef inline int import_umath() except -1:
6167 * try: # <<<<<<<<<<<<<<
6168 * _import_umath()
6169 * except Exception:
6170 */
6171 }
6172 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6173 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6174 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6175 goto __pyx_L8_try_end;
6176 __pyx_L3_error:;
6177
6178 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1043
6179 * try:
6180 * _import_umath()
6181 * except Exception: # <<<<<<<<<<<<<<
6182 * raise ImportError("numpy.core.umath failed to import")
6183 *
6184 */
6185 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6186 if (__pyx_t_4) {
6187 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6188 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
6189 __Pyx_GOTREF(__pyx_t_5);
6190 __Pyx_GOTREF(__pyx_t_6);
6191 __Pyx_GOTREF(__pyx_t_7);
6192
6193 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1044
6194 * _import_umath()
6195 * except Exception:
6196 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6197 *
6198 * cdef inline int import_ufunc() except -1:
6199 */
6200 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
6201 __Pyx_GOTREF(__pyx_t_8);
6202 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6203 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6204 __PYX_ERR(2, 1044, __pyx_L5_except_error)
6205 }
6206 goto __pyx_L5_except_error;
6207 __pyx_L5_except_error:;
6208
6209 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6210 *
6211 * cdef inline int import_umath() except -1:
6212 * try: # <<<<<<<<<<<<<<
6213 * _import_umath()
6214 * except Exception:
6215 */
6216 __Pyx_XGIVEREF(__pyx_t_1);
6217 __Pyx_XGIVEREF(__pyx_t_2);
6218 __Pyx_XGIVEREF(__pyx_t_3);
6219 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6220 goto __pyx_L1_error;
6221 __pyx_L8_try_end:;
6222 }
6223
6224 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1040
6225 * raise ImportError("numpy.core.multiarray failed to import")
6226 *
6227 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6228 * try:
6229 * _import_umath()
6230 */
6231
6232 /* function exit code */
6233 __pyx_r = 0;
6234 goto __pyx_L0;
6235 __pyx_L1_error:;
6236 __Pyx_XDECREF(__pyx_t_5);
6237 __Pyx_XDECREF(__pyx_t_6);
6238 __Pyx_XDECREF(__pyx_t_7);
6239 __Pyx_XDECREF(__pyx_t_8);
6240 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6241 __pyx_r = -1;
6242 __pyx_L0:;
6243 __Pyx_RefNannyFinishContext();
6244 return __pyx_r;
6245 }
6246
6247 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1046
6248 * raise ImportError("numpy.core.umath failed to import")
6249 *
6250 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6251 * try:
6252 * _import_umath()
6253 */
6254
__pyx_f_5numpy_import_ufunc(void)6255 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6256 int __pyx_r;
6257 __Pyx_RefNannyDeclarations
6258 PyObject *__pyx_t_1 = NULL;
6259 PyObject *__pyx_t_2 = NULL;
6260 PyObject *__pyx_t_3 = NULL;
6261 int __pyx_t_4;
6262 PyObject *__pyx_t_5 = NULL;
6263 PyObject *__pyx_t_6 = NULL;
6264 PyObject *__pyx_t_7 = NULL;
6265 PyObject *__pyx_t_8 = NULL;
6266 __Pyx_RefNannySetupContext("import_ufunc", 0);
6267
6268 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6269 *
6270 * cdef inline int import_ufunc() except -1:
6271 * try: # <<<<<<<<<<<<<<
6272 * _import_umath()
6273 * except Exception:
6274 */
6275 {
6276 __Pyx_PyThreadState_declare
6277 __Pyx_PyThreadState_assign
6278 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6279 __Pyx_XGOTREF(__pyx_t_1);
6280 __Pyx_XGOTREF(__pyx_t_2);
6281 __Pyx_XGOTREF(__pyx_t_3);
6282 /*try:*/ {
6283
6284 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1048
6285 * cdef inline int import_ufunc() except -1:
6286 * try:
6287 * _import_umath() # <<<<<<<<<<<<<<
6288 * except Exception:
6289 * raise ImportError("numpy.core.umath failed to import")
6290 */
6291 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
6292
6293 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6294 *
6295 * cdef inline int import_ufunc() except -1:
6296 * try: # <<<<<<<<<<<<<<
6297 * _import_umath()
6298 * except Exception:
6299 */
6300 }
6301 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6302 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6303 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6304 goto __pyx_L8_try_end;
6305 __pyx_L3_error:;
6306
6307 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1049
6308 * try:
6309 * _import_umath()
6310 * except Exception: # <<<<<<<<<<<<<<
6311 * raise ImportError("numpy.core.umath failed to import")
6312 */
6313 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6314 if (__pyx_t_4) {
6315 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6316 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
6317 __Pyx_GOTREF(__pyx_t_5);
6318 __Pyx_GOTREF(__pyx_t_6);
6319 __Pyx_GOTREF(__pyx_t_7);
6320
6321 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1050
6322 * _import_umath()
6323 * except Exception:
6324 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6325 */
6326 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
6327 __Pyx_GOTREF(__pyx_t_8);
6328 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6329 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6330 __PYX_ERR(2, 1050, __pyx_L5_except_error)
6331 }
6332 goto __pyx_L5_except_error;
6333 __pyx_L5_except_error:;
6334
6335 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6336 *
6337 * cdef inline int import_ufunc() except -1:
6338 * try: # <<<<<<<<<<<<<<
6339 * _import_umath()
6340 * except Exception:
6341 */
6342 __Pyx_XGIVEREF(__pyx_t_1);
6343 __Pyx_XGIVEREF(__pyx_t_2);
6344 __Pyx_XGIVEREF(__pyx_t_3);
6345 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6346 goto __pyx_L1_error;
6347 __pyx_L8_try_end:;
6348 }
6349
6350 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1046
6351 * raise ImportError("numpy.core.umath failed to import")
6352 *
6353 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6354 * try:
6355 * _import_umath()
6356 */
6357
6358 /* function exit code */
6359 __pyx_r = 0;
6360 goto __pyx_L0;
6361 __pyx_L1_error:;
6362 __Pyx_XDECREF(__pyx_t_5);
6363 __Pyx_XDECREF(__pyx_t_6);
6364 __Pyx_XDECREF(__pyx_t_7);
6365 __Pyx_XDECREF(__pyx_t_8);
6366 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6367 __pyx_r = -1;
6368 __pyx_L0:;
6369 __Pyx_RefNannyFinishContext();
6370 return __pyx_r;
6371 }
6372 static struct __pyx_vtabstruct_4cylp_2cy_9CyPEPivot_CyPEPivot __pyx_vtable_4cylp_2cy_9CyPEPivot_CyPEPivot;
6373
__pyx_tp_new_4cylp_2cy_9CyPEPivot_CyPEPivot(PyTypeObject * t,PyObject * a,PyObject * k)6374 static PyObject *__pyx_tp_new_4cylp_2cy_9CyPEPivot_CyPEPivot(PyTypeObject *t, PyObject *a, PyObject *k) {
6375 struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *p;
6376 PyObject *o = __pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase->tp_new(t, a, k);
6377 if (unlikely(!o)) return 0;
6378 p = ((struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot *)o);
6379 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase*)__pyx_vtabptr_4cylp_2cy_9CyPEPivot_CyPEPivot;
6380 return o;
6381 }
6382
__pyx_tp_dealloc_4cylp_2cy_9CyPEPivot_CyPEPivot(PyObject * o)6383 static void __pyx_tp_dealloc_4cylp_2cy_9CyPEPivot_CyPEPivot(PyObject *o) {
6384 #if CYTHON_USE_TP_FINALIZE
6385 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
6386 if (PyObject_CallFinalizerFromDealloc(o)) return;
6387 }
6388 #endif
6389 PyObject_GC_UnTrack(o);
6390 PyObject_GC_Track(o);
6391 if (likely(__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase)) __pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_4cylp_2cy_9CyPEPivot_CyPEPivot);
6392 }
6393
__pyx_tp_traverse_4cylp_2cy_9CyPEPivot_CyPEPivot(PyObject * o,visitproc v,void * a)6394 static int __pyx_tp_traverse_4cylp_2cy_9CyPEPivot_CyPEPivot(PyObject *o, visitproc v, void *a) {
6395 int e;
6396 e = ((likely(__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase)) ? ((__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase->tp_traverse) ? __pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4cylp_2cy_9CyPEPivot_CyPEPivot)); if (e) return e;
6397 return 0;
6398 }
6399
__pyx_tp_clear_4cylp_2cy_9CyPEPivot_CyPEPivot(PyObject * o)6400 static int __pyx_tp_clear_4cylp_2cy_9CyPEPivot_CyPEPivot(PyObject *o) {
6401 if (likely(__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase)) { if (__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase->tp_clear) __pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4cylp_2cy_9CyPEPivot_CyPEPivot);
6402 return 0;
6403 }
6404
6405 static PyMethodDef __pyx_methods_4cylp_2cy_9CyPEPivot_CyPEPivot[] = {
6406 {"__reduce_cython__", (PyCFunction)__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cylp_2cy_9CyPEPivot_9CyPEPivot_2__reduce_cython__},
6407 {"__setstate_cython__", (PyCFunction)__pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_5__setstate_cython__, METH_O, __pyx_doc_4cylp_2cy_9CyPEPivot_9CyPEPivot_4__setstate_cython__},
6408 {0, 0, 0, 0}
6409 };
6410
6411 static PyTypeObject __pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot = {
6412 PyVarObject_HEAD_INIT(0, 0)
6413 "cylp.cy.CyPEPivot.CyPEPivot", /*tp_name*/
6414 sizeof(struct __pyx_obj_4cylp_2cy_9CyPEPivot_CyPEPivot), /*tp_basicsize*/
6415 0, /*tp_itemsize*/
6416 __pyx_tp_dealloc_4cylp_2cy_9CyPEPivot_CyPEPivot, /*tp_dealloc*/
6417 0, /*tp_print*/
6418 0, /*tp_getattr*/
6419 0, /*tp_setattr*/
6420 #if PY_MAJOR_VERSION < 3
6421 0, /*tp_compare*/
6422 #endif
6423 #if PY_MAJOR_VERSION >= 3
6424 0, /*tp_as_async*/
6425 #endif
6426 0, /*tp_repr*/
6427 0, /*tp_as_number*/
6428 0, /*tp_as_sequence*/
6429 0, /*tp_as_mapping*/
6430 0, /*tp_hash*/
6431 0, /*tp_call*/
6432 0, /*tp_str*/
6433 0, /*tp_getattro*/
6434 0, /*tp_setattro*/
6435 0, /*tp_as_buffer*/
6436 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
6437 "CyPEPivot(cyModel)", /*tp_doc*/
6438 __pyx_tp_traverse_4cylp_2cy_9CyPEPivot_CyPEPivot, /*tp_traverse*/
6439 __pyx_tp_clear_4cylp_2cy_9CyPEPivot_CyPEPivot, /*tp_clear*/
6440 0, /*tp_richcompare*/
6441 0, /*tp_weaklistoffset*/
6442 0, /*tp_iter*/
6443 0, /*tp_iternext*/
6444 __pyx_methods_4cylp_2cy_9CyPEPivot_CyPEPivot, /*tp_methods*/
6445 0, /*tp_members*/
6446 0, /*tp_getset*/
6447 0, /*tp_base*/
6448 0, /*tp_dict*/
6449 0, /*tp_descr_get*/
6450 0, /*tp_descr_set*/
6451 0, /*tp_dictoffset*/
6452 __pyx_pw_4cylp_2cy_9CyPEPivot_9CyPEPivot_1__init__, /*tp_init*/
6453 0, /*tp_alloc*/
6454 __pyx_tp_new_4cylp_2cy_9CyPEPivot_CyPEPivot, /*tp_new*/
6455 0, /*tp_free*/
6456 0, /*tp_is_gc*/
6457 0, /*tp_bases*/
6458 0, /*tp_mro*/
6459 0, /*tp_cache*/
6460 0, /*tp_subclasses*/
6461 0, /*tp_weaklist*/
6462 0, /*tp_del*/
6463 0, /*tp_version_tag*/
6464 #if PY_VERSION_HEX >= 0x030400a1
6465 0, /*tp_finalize*/
6466 #endif
6467 #if PY_VERSION_HEX >= 0x030800b1
6468 0, /*tp_vectorcall*/
6469 #endif
6470 };
6471
6472 static PyMethodDef __pyx_methods[] = {
6473 {0, 0, 0, 0}
6474 };
6475
6476 #if PY_MAJOR_VERSION >= 3
6477 #if CYTHON_PEP489_MULTI_PHASE_INIT
6478 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
6479 static int __pyx_pymod_exec_CyPEPivot(PyObject* module); /*proto*/
6480 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
6481 {Py_mod_create, (void*)__pyx_pymod_create},
6482 {Py_mod_exec, (void*)__pyx_pymod_exec_CyPEPivot},
6483 {0, NULL}
6484 };
6485 #endif
6486
6487 static struct PyModuleDef __pyx_moduledef = {
6488 PyModuleDef_HEAD_INIT,
6489 "CyPEPivot",
6490 0, /* m_doc */
6491 #if CYTHON_PEP489_MULTI_PHASE_INIT
6492 0, /* m_size */
6493 #else
6494 -1, /* m_size */
6495 #endif
6496 __pyx_methods /* m_methods */,
6497 #if CYTHON_PEP489_MULTI_PHASE_INIT
6498 __pyx_moduledef_slots, /* m_slots */
6499 #else
6500 NULL, /* m_reload */
6501 #endif
6502 NULL, /* m_traverse */
6503 NULL, /* m_clear */
6504 NULL /* m_free */
6505 };
6506 #endif
6507 #ifndef CYTHON_SMALL_CODE
6508 #if defined(__clang__)
6509 #define CYTHON_SMALL_CODE
6510 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
6511 #define CYTHON_SMALL_CODE __attribute__((cold))
6512 #else
6513 #define CYTHON_SMALL_CODE
6514 #endif
6515 #endif
6516
6517 static __Pyx_StringTabEntry __pyx_string_tab[] = {
6518 {&__pyx_n_s_CyPEPivot, __pyx_k_CyPEPivot, sizeof(__pyx_k_CyPEPivot), 0, 0, 1, 1},
6519 {&__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},
6520 {&__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},
6521 {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
6522 {&__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},
6523 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
6524 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
6525 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
6526 {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
6527 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
6528 {&__pyx_kp_s_comp_selected, __pyx_k_comp_selected, sizeof(__pyx_k_comp_selected), 0, 0, 1, 0},
6529 {&__pyx_n_s_cyModel, __pyx_k_cyModel, sizeof(__pyx_k_cyModel), 0, 0, 1, 1},
6530 {&__pyx_n_s_dualTolerance, __pyx_k_dualTolerance, sizeof(__pyx_k_dualTolerance), 0, 0, 1, 1},
6531 {&__pyx_n_s_elements, __pyx_k_elements, sizeof(__pyx_k_elements), 0, 0, 1, 1},
6532 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
6533 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
6534 {&__pyx_kp_s_incomp_selected, __pyx_k_incomp_selected, sizeof(__pyx_k_incomp_selected), 0, 0, 1, 0},
6535 {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
6536 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
6537 {&__pyx_n_s_isCompatible, __pyx_k_isCompatible, sizeof(__pyx_k_isCompatible), 0, 0, 1, 1},
6538 {&__pyx_n_s_iteration, __pyx_k_iteration, sizeof(__pyx_k_iteration), 0, 0, 1, 1},
6539 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
6540 {&__pyx_n_s_nElements, __pyx_k_nElements, sizeof(__pyx_k_nElements), 0, 0, 1, 1},
6541 {&__pyx_n_s_nVariables, __pyx_k_nVariables, sizeof(__pyx_k_nVariables), 0, 0, 1, 1},
6542 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
6543 {&__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},
6544 {&__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},
6545 {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
6546 {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
6547 {&__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},
6548 {&__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},
6549 {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
6550 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
6551 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
6552 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
6553 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
6554 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
6555 {&__pyx_n_s_reducedCosts, __pyx_k_reducedCosts, sizeof(__pyx_k_reducedCosts), 0, 0, 1, 1},
6556 {&__pyx_kp_s_self_CppSelf_cannot_be_converted, __pyx_k_self_CppSelf_cannot_be_converted, sizeof(__pyx_k_self_CppSelf_cannot_be_converted), 0, 0, 1, 0},
6557 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
6558 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
6559 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
6560 {&__pyx_n_s_transposeTimes, __pyx_k_transposeTimes, sizeof(__pyx_k_transposeTimes), 0, 0, 1, 1},
6561 {&__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},
6562 {&__pyx_n_s_updateColumnTranspose, __pyx_k_updateColumnTranspose, sizeof(__pyx_k_updateColumnTranspose), 0, 0, 1, 1},
6563 {&__pyx_n_s_updateP, __pyx_k_updateP, sizeof(__pyx_k_updateP), 0, 0, 1, 1},
6564 {&__pyx_n_s_updateW, __pyx_k_updateW, sizeof(__pyx_k_updateW), 0, 0, 1, 1},
6565 {&__pyx_n_s_varIsAtLowerBound, __pyx_k_varIsAtLowerBound, sizeof(__pyx_k_varIsAtLowerBound), 0, 0, 1, 1},
6566 {&__pyx_n_s_varIsAtUpperBound, __pyx_k_varIsAtUpperBound, sizeof(__pyx_k_varIsAtUpperBound), 0, 0, 1, 1},
6567 {&__pyx_n_s_varIsFree, __pyx_k_varIsFree, sizeof(__pyx_k_varIsFree), 0, 0, 1, 1},
6568 {&__pyx_n_s_varNotBasic, __pyx_k_varNotBasic, sizeof(__pyx_k_varNotBasic), 0, 0, 1, 1},
6569 {&__pyx_n_s_varNotFixed, __pyx_k_varNotFixed, sizeof(__pyx_k_varNotFixed), 0, 0, 1, 1},
6570 {&__pyx_n_s_varNotFlagged, __pyx_k_varNotFlagged, sizeof(__pyx_k_varNotFlagged), 0, 0, 1, 1},
6571 {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
6572 {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
6573 {0, 0, 0, 0, 0, 0, 0}
6574 };
__Pyx_InitCachedBuiltins(void)6575 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
6576 #if PY_MAJOR_VERSION >= 3
6577 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 58, __pyx_L1_error)
6578 #else
6579 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 58, __pyx_L1_error)
6580 #endif
6581 __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 71, __pyx_L1_error)
6582 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
6583 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
6584 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 285, __pyx_L1_error)
6585 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
6586 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
6587 return 0;
6588 __pyx_L1_error:;
6589 return -1;
6590 }
6591
__Pyx_InitCachedConstants(void)6592 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
6593 __Pyx_RefNannyDeclarations
6594 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
6595
6596 /* "(tree fragment)":2
6597 * def __reduce_cython__(self):
6598 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6599 * def __setstate_cython__(self, __pyx_state):
6600 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
6601 */
6602 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_CppSelf_cannot_be_converted); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
6603 __Pyx_GOTREF(__pyx_tuple_);
6604 __Pyx_GIVEREF(__pyx_tuple_);
6605
6606 /* "(tree fragment)":4
6607 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling")
6608 * def __setstate_cython__(self, __pyx_state):
6609 * raise TypeError("self.CppSelf cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6610 */
6611 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_CppSelf_cannot_be_converted); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
6612 __Pyx_GOTREF(__pyx_tuple__2);
6613 __Pyx_GIVEREF(__pyx_tuple__2);
6614
6615 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":272
6616 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6617 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6618 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6619 *
6620 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6621 */
6622 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 272, __pyx_L1_error)
6623 __Pyx_GOTREF(__pyx_tuple__3);
6624 __Pyx_GIVEREF(__pyx_tuple__3);
6625
6626 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":276
6627 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6628 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6629 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6630 *
6631 * info.buf = PyArray_DATA(self)
6632 */
6633 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 276, __pyx_L1_error)
6634 __Pyx_GOTREF(__pyx_tuple__4);
6635 __Pyx_GIVEREF(__pyx_tuple__4);
6636
6637 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":306
6638 * if ((descr.byteorder == c'>' and little_endian) or
6639 * (descr.byteorder == c'<' and not little_endian)):
6640 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6641 * if t == NPY_BYTE: f = "b"
6642 * elif t == NPY_UBYTE: f = "B"
6643 */
6644 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 306, __pyx_L1_error)
6645 __Pyx_GOTREF(__pyx_tuple__5);
6646 __Pyx_GIVEREF(__pyx_tuple__5);
6647
6648 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":856
6649 *
6650 * if (end - f) - <int>(new_offset - offset[0]) < 15:
6651 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
6652 *
6653 * if ((child.byteorder == c'>' and little_endian) or
6654 */
6655 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 856, __pyx_L1_error)
6656 __Pyx_GOTREF(__pyx_tuple__6);
6657 __Pyx_GIVEREF(__pyx_tuple__6);
6658
6659 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":880
6660 * t = child.type_num
6661 * if end - f < 5:
6662 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
6663 *
6664 * # Until ticket #99 is fixed, use integers to avoid warnings
6665 */
6666 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 880, __pyx_L1_error)
6667 __Pyx_GOTREF(__pyx_tuple__7);
6668 __Pyx_GIVEREF(__pyx_tuple__7);
6669
6670 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1038
6671 * _import_array()
6672 * except Exception:
6673 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
6674 *
6675 * cdef inline int import_umath() except -1:
6676 */
6677 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 1038, __pyx_L1_error)
6678 __Pyx_GOTREF(__pyx_tuple__8);
6679 __Pyx_GIVEREF(__pyx_tuple__8);
6680
6681 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1044
6682 * _import_umath()
6683 * except Exception:
6684 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6685 *
6686 * cdef inline int import_ufunc() except -1:
6687 */
6688 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1044, __pyx_L1_error)
6689 __Pyx_GOTREF(__pyx_tuple__9);
6690 __Pyx_GIVEREF(__pyx_tuple__9);
6691 __Pyx_RefNannyFinishContext();
6692 return 0;
6693 __pyx_L1_error:;
6694 __Pyx_RefNannyFinishContext();
6695 return -1;
6696 }
6697
__Pyx_InitGlobals(void)6698 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
6699 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6700 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6701 return 0;
6702 __pyx_L1_error:;
6703 return -1;
6704 }
6705
6706 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
6707 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
6708 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
6709 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
6710 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
6711 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
6712 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
6713
__Pyx_modinit_global_init_code(void)6714 static int __Pyx_modinit_global_init_code(void) {
6715 __Pyx_RefNannyDeclarations
6716 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
6717 /*--- Global init code ---*/
6718 __Pyx_RefNannyFinishContext();
6719 return 0;
6720 }
6721
__Pyx_modinit_variable_export_code(void)6722 static int __Pyx_modinit_variable_export_code(void) {
6723 __Pyx_RefNannyDeclarations
6724 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
6725 /*--- Variable export code ---*/
6726 __Pyx_RefNannyFinishContext();
6727 return 0;
6728 }
6729
__Pyx_modinit_function_export_code(void)6730 static int __Pyx_modinit_function_export_code(void) {
6731 __Pyx_RefNannyDeclarations
6732 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
6733 /*--- Function export code ---*/
6734 __Pyx_RefNannyFinishContext();
6735 return 0;
6736 }
6737
__Pyx_modinit_type_init_code(void)6738 static int __Pyx_modinit_type_init_code(void) {
6739 __Pyx_RefNannyDeclarations
6740 PyObject *__pyx_t_1 = NULL;
6741 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
6742 /*--- Type init code ---*/
6743 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyClpPrimalColumnPivotBase"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6744 __Pyx_GOTREF(__pyx_t_1);
6745 __pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyClpPrimalColumnPivotBase", "CyClpPrimalColumnPivotBase", sizeof(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase), __Pyx_ImportType_CheckSize_Warn);
6746 if (!__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase) __PYX_ERR(0, 1, __pyx_L1_error)
6747 __pyx_vtabptr_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase = (struct __pyx_vtabstruct_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase)) __PYX_ERR(0, 1, __pyx_L1_error)
6748 __pyx_vtabptr_4cylp_2cy_9CyPEPivot_CyPEPivot = &__pyx_vtable_4cylp_2cy_9CyPEPivot_CyPEPivot;
6749 __pyx_vtable_4cylp_2cy_9CyPEPivot_CyPEPivot.__pyx_base = *__pyx_vtabptr_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase;
6750 __pyx_vtable_4cylp_2cy_9CyPEPivot_CyPEPivot.__pyx_base.pivotColumn = (PyObject *(*)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *))__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_pivotColumn;
6751 __pyx_vtable_4cylp_2cy_9CyPEPivot_CyPEPivot.__pyx_base.clone = (ClpPrimalColumnPivot *(*)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *, int))__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_clone;
6752 __pyx_vtable_4cylp_2cy_9CyPEPivot_CyPEPivot.__pyx_base.saveWeights = (void (*)(struct __pyx_obj_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase *, IClpSimplex *, int))__pyx_f_4cylp_2cy_9CyPEPivot_9CyPEPivot_saveWeights;
6753 __pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot.tp_base = __pyx_ptype_4cylp_2cy_26CyClpPrimalColumnPivotBase_CyClpPrimalColumnPivotBase;
6754 if (PyType_Ready(&__pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
6755 #if PY_VERSION_HEX < 0x030800B1
6756 __pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot.tp_print = 0;
6757 #endif
6758 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot.tp_dictoffset && __pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot.tp_getattro == PyObject_GenericGetAttr)) {
6759 __pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot.tp_getattro = __Pyx_PyObject_GenericGetAttr;
6760 }
6761 if (__Pyx_SetVtable(__pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot.tp_dict, __pyx_vtabptr_4cylp_2cy_9CyPEPivot_CyPEPivot) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
6762 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CyPEPivot, (PyObject *)&__pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
6763 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
6764 __pyx_ptype_4cylp_2cy_9CyPEPivot_CyPEPivot = &__pyx_type_4cylp_2cy_9CyPEPivot_CyPEPivot;
6765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6766 __Pyx_RefNannyFinishContext();
6767 return 0;
6768 __pyx_L1_error:;
6769 __Pyx_XDECREF(__pyx_t_1);
6770 __Pyx_RefNannyFinishContext();
6771 return -1;
6772 }
6773
__Pyx_modinit_type_import_code(void)6774 static int __Pyx_modinit_type_import_code(void) {
6775 __Pyx_RefNannyDeclarations
6776 PyObject *__pyx_t_1 = NULL;
6777 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
6778 /*--- Type import code ---*/
6779 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
6780 __Pyx_GOTREF(__pyx_t_1);
6781 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
6782 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6783 sizeof(PyTypeObject),
6784 #else
6785 sizeof(PyHeapTypeObject),
6786 #endif
6787 __Pyx_ImportType_CheckSize_Warn);
6788 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
6789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6790 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error)
6791 __Pyx_GOTREF(__pyx_t_1);
6792 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
6793 if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(4, 8, __pyx_L1_error)
6794 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6795 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error)
6796 __Pyx_GOTREF(__pyx_t_1);
6797 __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
6798 if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(5, 15, __pyx_L1_error)
6799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyCoinIndexedVector"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 22, __pyx_L1_error)
6801 __Pyx_GOTREF(__pyx_t_1);
6802 __pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCoinIndexedVector", "CyCoinIndexedVector", sizeof(struct __pyx_obj_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector), __Pyx_ImportType_CheckSize_Warn);
6803 if (!__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector) __PYX_ERR(6, 22, __pyx_L1_error)
6804 __pyx_vtabptr_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector = (struct __pyx_vtabstruct_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_19CyCoinIndexedVector_CyCoinIndexedVector)) __PYX_ERR(6, 22, __pyx_L1_error)
6805 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6806 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
6807 __Pyx_GOTREF(__pyx_t_1);
6808 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
6809 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
6810 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
6811 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
6812 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
6813 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
6814 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
6815 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
6816 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
6817 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
6818 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6819 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyClpDualRowPivotBase"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 72, __pyx_L1_error)
6820 __Pyx_GOTREF(__pyx_t_1);
6821 __pyx_ptype_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyClpDualRowPivotBase", "CyClpDualRowPivotBase", sizeof(struct __pyx_obj_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase), __Pyx_ImportType_CheckSize_Warn);
6822 if (!__pyx_ptype_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase) __PYX_ERR(7, 72, __pyx_L1_error)
6823 __pyx_vtabptr_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase = (struct __pyx_vtabstruct_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_21CyClpDualRowPivotBase_CyClpDualRowPivotBase)) __PYX_ERR(7, 72, __pyx_L1_error)
6824 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6825 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyCoinModel"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 34, __pyx_L1_error)
6826 __Pyx_GOTREF(__pyx_t_1);
6827 __pyx_ptype_4cylp_2cy_11CyCoinModel_CyCoinModel = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCoinModel", "CyCoinModel", sizeof(struct __pyx_obj_4cylp_2cy_11CyCoinModel_CyCoinModel), __Pyx_ImportType_CheckSize_Warn);
6828 if (!__pyx_ptype_4cylp_2cy_11CyCoinModel_CyCoinModel) __PYX_ERR(8, 34, __pyx_L1_error)
6829 __pyx_vtabptr_4cylp_2cy_11CyCoinModel_CyCoinModel = (struct __pyx_vtabstruct_4cylp_2cy_11CyCoinModel_CyCoinModel*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_11CyCoinModel_CyCoinModel->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_11CyCoinModel_CyCoinModel)) __PYX_ERR(8, 34, __pyx_L1_error)
6830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6831 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyCoinPackedMatrix"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 27, __pyx_L1_error)
6832 __Pyx_GOTREF(__pyx_t_1);
6833 __pyx_ptype_4cylp_2cy_18CyCoinPackedMatrix_CyCoinPackedMatrix = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCoinPackedMatrix", "CyCoinPackedMatrix", sizeof(struct __pyx_obj_4cylp_2cy_18CyCoinPackedMatrix_CyCoinPackedMatrix), __Pyx_ImportType_CheckSize_Warn);
6834 if (!__pyx_ptype_4cylp_2cy_18CyCoinPackedMatrix_CyCoinPackedMatrix) __PYX_ERR(9, 27, __pyx_L1_error)
6835 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6836 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyCgl"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 103, __pyx_L1_error)
6837 __Pyx_GOTREF(__pyx_t_1);
6838 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglCutGenerator = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglCutGenerator", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglCutGenerator), __Pyx_ImportType_CheckSize_Warn);
6839 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglCutGenerator) __PYX_ERR(10, 103, __pyx_L1_error)
6840 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglAllDifferent = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglAllDifferent", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglAllDifferent), __Pyx_ImportType_CheckSize_Warn);
6841 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglAllDifferent) __PYX_ERR(10, 108, __pyx_L1_error)
6842 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglClique = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglClique", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglClique), __Pyx_ImportType_CheckSize_Warn);
6843 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglClique) __PYX_ERR(10, 111, __pyx_L1_error)
6844 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglKnapsackCover = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglKnapsackCover", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglKnapsackCover), __Pyx_ImportType_CheckSize_Warn);
6845 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglKnapsackCover) __PYX_ERR(10, 114, __pyx_L1_error)
6846 __pyx_vtabptr_4cylp_2cy_5CyCgl_CyCglKnapsackCover = (struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglKnapsackCover*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_5CyCgl_CyCglKnapsackCover->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_5CyCgl_CyCglKnapsackCover)) __PYX_ERR(10, 114, __pyx_L1_error)
6847 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglOddHole = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglOddHole", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglOddHole), __Pyx_ImportType_CheckSize_Warn);
6848 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglOddHole) __PYX_ERR(10, 117, __pyx_L1_error)
6849 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglFlowCover = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglFlowCover", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglFlowCover), __Pyx_ImportType_CheckSize_Warn);
6850 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglFlowCover) __PYX_ERR(10, 122, __pyx_L1_error)
6851 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglGomory = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglGomory", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglGomory), __Pyx_ImportType_CheckSize_Warn);
6852 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglGomory) __PYX_ERR(10, 127, __pyx_L1_error)
6853 __pyx_vtabptr_4cylp_2cy_5CyCgl_CyCglGomory = (struct __pyx_vtabstruct_4cylp_2cy_5CyCgl_CyCglGomory*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_5CyCgl_CyCglGomory->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_5CyCgl_CyCglGomory)) __PYX_ERR(10, 127, __pyx_L1_error)
6854 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglRedSplit = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglRedSplit", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglRedSplit), __Pyx_ImportType_CheckSize_Warn);
6855 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglRedSplit) __PYX_ERR(10, 132, __pyx_L1_error)
6856 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglLiftAndProject = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglLiftAndProject", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglLiftAndProject), __Pyx_ImportType_CheckSize_Warn);
6857 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglLiftAndProject) __PYX_ERR(10, 137, __pyx_L1_error)
6858 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglLandP = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglLandP", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglLandP), __Pyx_ImportType_CheckSize_Warn);
6859 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglLandP) __PYX_ERR(10, 140, __pyx_L1_error)
6860 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglMixedIntegerRounding", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding), __Pyx_ImportType_CheckSize_Warn);
6861 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding) __PYX_ERR(10, 145, __pyx_L1_error)
6862 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding2 = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglMixedIntegerRounding2", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding2), __Pyx_ImportType_CheckSize_Warn);
6863 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglMixedIntegerRounding2) __PYX_ERR(10, 148, __pyx_L1_error)
6864 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglTwomir = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglTwomir", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglTwomir), __Pyx_ImportType_CheckSize_Warn);
6865 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglTwomir) __PYX_ERR(10, 151, __pyx_L1_error)
6866 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglResidualCapacity = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglResidualCapacity", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglResidualCapacity), __Pyx_ImportType_CheckSize_Warn);
6867 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglResidualCapacity) __PYX_ERR(10, 154, __pyx_L1_error)
6868 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglPreProcess = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglPreProcess", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglPreProcess), __Pyx_ImportType_CheckSize_Warn);
6869 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglPreProcess) __PYX_ERR(10, 162, __pyx_L1_error)
6870 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglProbing = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglProbing", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglProbing), __Pyx_ImportType_CheckSize_Warn);
6871 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglProbing) __PYX_ERR(10, 165, __pyx_L1_error)
6872 __pyx_ptype_4cylp_2cy_5CyCgl_CyCglSimpleRounding = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCgl", "CyCglSimpleRounding", sizeof(struct __pyx_obj_4cylp_2cy_5CyCgl_CyCglSimpleRounding), __Pyx_ImportType_CheckSize_Warn);
6873 if (!__pyx_ptype_4cylp_2cy_5CyCgl_CyCglSimpleRounding) __PYX_ERR(10, 168, __pyx_L1_error)
6874 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6875 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyCbcNode"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 13, __pyx_L1_error)
6876 __Pyx_GOTREF(__pyx_t_1);
6877 __pyx_ptype_4cylp_2cy_9CyCbcNode_CyCbcNode = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCbcNode", "CyCbcNode", sizeof(struct __pyx_obj_4cylp_2cy_9CyCbcNode_CyCbcNode), __Pyx_ImportType_CheckSize_Warn);
6878 if (!__pyx_ptype_4cylp_2cy_9CyCbcNode_CyCbcNode) __PYX_ERR(11, 13, __pyx_L1_error)
6879 __pyx_vtabptr_4cylp_2cy_9CyCbcNode_CyCbcNode = (struct __pyx_vtabstruct_4cylp_2cy_9CyCbcNode_CyCbcNode*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_9CyCbcNode_CyCbcNode->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_9CyCbcNode_CyCbcNode)) __PYX_ERR(11, 13, __pyx_L1_error)
6880 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6881 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyOsiSolverInterface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 15, __pyx_L1_error)
6882 __Pyx_GOTREF(__pyx_t_1);
6883 __pyx_ptype_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyOsiSolverInterface", "CyOsiSolverInterface", sizeof(struct __pyx_obj_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface), __Pyx_ImportType_CheckSize_Warn);
6884 if (!__pyx_ptype_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface) __PYX_ERR(12, 15, __pyx_L1_error)
6885 __pyx_vtabptr_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface = (struct __pyx_vtabstruct_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_20CyOsiSolverInterface_CyOsiSolverInterface)) __PYX_ERR(12, 15, __pyx_L1_error)
6886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6887 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyCbcModel"); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 82, __pyx_L1_error)
6888 __Pyx_GOTREF(__pyx_t_1);
6889 __pyx_ptype_4cylp_2cy_10CyCbcModel_CyCbcModel = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyCbcModel", "CyCbcModel", sizeof(struct __pyx_obj_4cylp_2cy_10CyCbcModel_CyCbcModel), __Pyx_ImportType_CheckSize_Warn);
6890 if (!__pyx_ptype_4cylp_2cy_10CyCbcModel_CyCbcModel) __PYX_ERR(13, 82, __pyx_L1_error)
6891 __pyx_vtabptr_4cylp_2cy_10CyCbcModel_CyCbcModel = (struct __pyx_vtabstruct_4cylp_2cy_10CyCbcModel_CyCbcModel*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_10CyCbcModel_CyCbcModel->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_10CyCbcModel_CyCbcModel)) __PYX_ERR(13, 82, __pyx_L1_error)
6892 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6893 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyClpSimplex"); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 302, __pyx_L1_error)
6894 __Pyx_GOTREF(__pyx_t_1);
6895 __pyx_ptype_4cylp_2cy_12CyClpSimplex_CyClpSimplex = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyClpSimplex", "CyClpSimplex", sizeof(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_CyClpSimplex), __Pyx_ImportType_CheckSize_Warn);
6896 if (!__pyx_ptype_4cylp_2cy_12CyClpSimplex_CyClpSimplex) __PYX_ERR(14, 302, __pyx_L1_error)
6897 __pyx_vtabptr_4cylp_2cy_12CyClpSimplex_CyClpSimplex = (struct __pyx_vtabstruct_4cylp_2cy_12CyClpSimplex_CyClpSimplex*)__Pyx_GetVtable(__pyx_ptype_4cylp_2cy_12CyClpSimplex_CyClpSimplex->tp_dict); if (unlikely(!__pyx_vtabptr_4cylp_2cy_12CyClpSimplex_CyClpSimplex)) __PYX_ERR(14, 302, __pyx_L1_error)
6898 __pyx_ptype_4cylp_2cy_12CyClpSimplex_VarStatus = __Pyx_ImportType(__pyx_t_1, "cylp.cy.CyClpSimplex", "VarStatus", sizeof(struct __pyx_obj_4cylp_2cy_12CyClpSimplex_VarStatus), __Pyx_ImportType_CheckSize_Warn);
6899 if (!__pyx_ptype_4cylp_2cy_12CyClpSimplex_VarStatus) __PYX_ERR(14, 377, __pyx_L1_error)
6900 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6901 __Pyx_RefNannyFinishContext();
6902 return 0;
6903 __pyx_L1_error:;
6904 __Pyx_XDECREF(__pyx_t_1);
6905 __Pyx_RefNannyFinishContext();
6906 return -1;
6907 }
6908
__Pyx_modinit_variable_import_code(void)6909 static int __Pyx_modinit_variable_import_code(void) {
6910 __Pyx_RefNannyDeclarations
6911 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
6912 /*--- Variable import code ---*/
6913 __Pyx_RefNannyFinishContext();
6914 return 0;
6915 }
6916
__Pyx_modinit_function_import_code(void)6917 static int __Pyx_modinit_function_import_code(void) {
6918 __Pyx_RefNannyDeclarations
6919 PyObject *__pyx_t_1 = NULL;
6920 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
6921 /*--- Function import code ---*/
6922 __pyx_t_1 = PyImport_ImportModule("cylp.cy.CyClpPrimalColumnPivotBase"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
6923 if (__Pyx_ImportFunction(__pyx_t_1, "RunPivotColumn", (void (**)(void))&__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunPivotColumn, "int (void *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *, ICoinIndexedVector *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6924 if (__Pyx_ImportFunction(__pyx_t_1, "RunClone", (void (**)(void))&__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunClone, "ClpPrimalColumnPivot *(void *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6925 if (__Pyx_ImportFunction(__pyx_t_1, "RunSaveWeights", (void (**)(void))&__pyx_f_4cylp_2cy_26CyClpPrimalColumnPivotBase_RunSaveWeights, "void (void *, IClpSimplex *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6926 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6927 __Pyx_RefNannyFinishContext();
6928 return 0;
6929 __pyx_L1_error:;
6930 __Pyx_XDECREF(__pyx_t_1);
6931 __Pyx_RefNannyFinishContext();
6932 return -1;
6933 }
6934
6935
6936 #if PY_MAJOR_VERSION < 3
6937 #ifdef CYTHON_NO_PYINIT_EXPORT
6938 #define __Pyx_PyMODINIT_FUNC void
6939 #else
6940 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6941 #endif
6942 #else
6943 #ifdef CYTHON_NO_PYINIT_EXPORT
6944 #define __Pyx_PyMODINIT_FUNC PyObject *
6945 #else
6946 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6947 #endif
6948 #endif
6949
6950
6951 #if PY_MAJOR_VERSION < 3
6952 __Pyx_PyMODINIT_FUNC initCyPEPivot(void) CYTHON_SMALL_CODE; /*proto*/
initCyPEPivot(void)6953 __Pyx_PyMODINIT_FUNC initCyPEPivot(void)
6954 #else
6955 __Pyx_PyMODINIT_FUNC PyInit_CyPEPivot(void) CYTHON_SMALL_CODE; /*proto*/
6956 __Pyx_PyMODINIT_FUNC PyInit_CyPEPivot(void)
6957 #if CYTHON_PEP489_MULTI_PHASE_INIT
6958 {
6959 return PyModuleDef_Init(&__pyx_moduledef);
6960 }
6961 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
6962 #if PY_VERSION_HEX >= 0x030700A1
6963 static PY_INT64_T main_interpreter_id = -1;
6964 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
6965 if (main_interpreter_id == -1) {
6966 main_interpreter_id = current_id;
6967 return (unlikely(current_id == -1)) ? -1 : 0;
6968 } else if (unlikely(main_interpreter_id != current_id))
6969 #else
6970 static PyInterpreterState *main_interpreter = NULL;
6971 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
6972 if (!main_interpreter) {
6973 main_interpreter = current_interpreter;
6974 } else if (unlikely(main_interpreter != current_interpreter))
6975 #endif
6976 {
6977 PyErr_SetString(
6978 PyExc_ImportError,
6979 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
6980 return -1;
6981 }
6982 return 0;
6983 }
6984 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
6985 PyObject *value = PyObject_GetAttrString(spec, from_name);
6986 int result = 0;
6987 if (likely(value)) {
6988 if (allow_none || value != Py_None) {
6989 result = PyDict_SetItemString(moddict, to_name, value);
6990 }
6991 Py_DECREF(value);
6992 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6993 PyErr_Clear();
6994 } else {
6995 result = -1;
6996 }
6997 return result;
6998 }
6999 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
7000 PyObject *module = NULL, *moddict, *modname;
7001 if (__Pyx_check_single_interpreter())
7002 return NULL;
7003 if (__pyx_m)
7004 return __Pyx_NewRef(__pyx_m);
7005 modname = PyObject_GetAttrString(spec, "name");
7006 if (unlikely(!modname)) goto bad;
7007 module = PyModule_NewObject(modname);
7008 Py_DECREF(modname);
7009 if (unlikely(!module)) goto bad;
7010 moddict = PyModule_GetDict(module);
7011 if (unlikely(!moddict)) goto bad;
7012 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
7013 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
7014 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
7015 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
7016 return module;
7017 bad:
7018 Py_XDECREF(module);
7019 return NULL;
7020 }
7021
7022
7023 static CYTHON_SMALL_CODE int __pyx_pymod_exec_CyPEPivot(PyObject *__pyx_pyinit_module)
7024 #endif
7025 #endif
7026 {
7027 PyObject *__pyx_t_1 = NULL;
7028 __Pyx_RefNannyDeclarations
7029 #if CYTHON_PEP489_MULTI_PHASE_INIT
7030 if (__pyx_m) {
7031 if (__pyx_m == __pyx_pyinit_module) return 0;
7032 PyErr_SetString(PyExc_RuntimeError, "Module 'CyPEPivot' has already been imported. Re-initialisation is not supported.");
7033 return -1;
7034 }
7035 #elif PY_MAJOR_VERSION >= 3
7036 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
7037 #endif
7038 #if CYTHON_REFNANNY
7039 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
7040 if (!__Pyx_RefNanny) {
7041 PyErr_Clear();
7042 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7043 if (!__Pyx_RefNanny)
7044 Py_FatalError("failed to import 'refnanny' module");
7045 }
7046 #endif
7047 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_CyPEPivot(void)", 0);
7048 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7049 #ifdef __Pxy_PyFrame_Initialize_Offsets
7050 __Pxy_PyFrame_Initialize_Offsets();
7051 #endif
7052 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
7053 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
7054 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
7055 #ifdef __Pyx_CyFunction_USED
7056 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7057 #endif
7058 #ifdef __Pyx_FusedFunction_USED
7059 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7060 #endif
7061 #ifdef __Pyx_Coroutine_USED
7062 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7063 #endif
7064 #ifdef __Pyx_Generator_USED
7065 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7066 #endif
7067 #ifdef __Pyx_AsyncGen_USED
7068 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7069 #endif
7070 #ifdef __Pyx_StopAsyncIteration_USED
7071 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7072 #endif
7073 /*--- Library function declarations ---*/
7074 /*--- Threads initialization code ---*/
7075 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
7076 #ifdef WITH_THREAD /* Python build with threading support? */
7077 PyEval_InitThreads();
7078 #endif
7079 #endif
7080 /*--- Module creation code ---*/
7081 #if CYTHON_PEP489_MULTI_PHASE_INIT
7082 __pyx_m = __pyx_pyinit_module;
7083 Py_INCREF(__pyx_m);
7084 #else
7085 #if PY_MAJOR_VERSION < 3
7086 __pyx_m = Py_InitModule4("CyPEPivot", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
7087 #else
7088 __pyx_m = PyModule_Create(&__pyx_moduledef);
7089 #endif
7090 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
7091 #endif
7092 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
7093 Py_INCREF(__pyx_d);
7094 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
7095 Py_INCREF(__pyx_b);
7096 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
7097 Py_INCREF(__pyx_cython_runtime);
7098 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
7099 /*--- Initialize various global constants etc. ---*/
7100 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7101 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
7102 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7103 #endif
7104 if (__pyx_module_is_main_cylp__cy__CyPEPivot) {
7105 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7106 }
7107 #if PY_MAJOR_VERSION >= 3
7108 {
7109 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
7110 if (!PyDict_GetItemString(modules, "cylp.cy.CyPEPivot")) {
7111 if (unlikely(PyDict_SetItemString(modules, "cylp.cy.CyPEPivot", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
7112 }
7113 }
7114 #endif
7115 /*--- Builtin init code ---*/
7116 if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
7117 /*--- Constants init code ---*/
7118 if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
7119 /*--- Global type/function init code ---*/
7120 (void)__Pyx_modinit_global_init_code();
7121 (void)__Pyx_modinit_variable_export_code();
7122 (void)__Pyx_modinit_function_export_code();
7123 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
7124 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
7125 (void)__Pyx_modinit_variable_import_code();
7126 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
7127 /*--- Execution code ---*/
7128 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
7129 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7130 #endif
7131
7132 /* "cylp/cy/CyPEPivot.pyx":5
7133 * from __future__ import print_function
7134 *
7135 * import numpy as np # <<<<<<<<<<<<<<
7136 * cimport numpy as np
7137 * from cylp.cy cimport CyPEPivot
7138 */
7139 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
7140 __Pyx_GOTREF(__pyx_t_1);
7141 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
7142 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7143
7144 /* "cylp/cy/CyPEPivot.pyx":1
7145 * # cython: embedsignature=True # <<<<<<<<<<<<<<
7146 *
7147 * from __future__ import print_function
7148 */
7149 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
7150 __Pyx_GOTREF(__pyx_t_1);
7151 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7152 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7153
7154 /* "../../../../Users/tkral/Anaconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1046
7155 * raise ImportError("numpy.core.umath failed to import")
7156 *
7157 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7158 * try:
7159 * _import_umath()
7160 */
7161
7162 /*--- Wrapped vars code ---*/
7163
7164 goto __pyx_L0;
7165 __pyx_L1_error:;
7166 __Pyx_XDECREF(__pyx_t_1);
7167 if (__pyx_m) {
7168 if (__pyx_d) {
7169 __Pyx_AddTraceback("init cylp.cy.CyPEPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
7170 }
7171 Py_CLEAR(__pyx_m);
7172 } else if (!PyErr_Occurred()) {
7173 PyErr_SetString(PyExc_ImportError, "init cylp.cy.CyPEPivot");
7174 }
7175 __pyx_L0:;
7176 __Pyx_RefNannyFinishContext();
7177 #if CYTHON_PEP489_MULTI_PHASE_INIT
7178 return (__pyx_m != NULL) ? 0 : -1;
7179 #elif PY_MAJOR_VERSION >= 3
7180 return __pyx_m;
7181 #else
7182 return;
7183 #endif
7184 }
7185
7186 /* --- Runtime support code --- */
7187 /* Refnanny */
7188 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)7189 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
7190 PyObject *m = NULL, *p = NULL;
7191 void *r = NULL;
7192 m = PyImport_ImportModule(modname);
7193 if (!m) goto end;
7194 p = PyObject_GetAttrString(m, "RefNannyAPI");
7195 if (!p) goto end;
7196 r = PyLong_AsVoidPtr(p);
7197 end:
7198 Py_XDECREF(p);
7199 Py_XDECREF(m);
7200 return (__Pyx_RefNannyAPIStruct *)r;
7201 }
7202 #endif
7203
7204 /* PyObjectGetAttrStr */
7205 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)7206 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7207 PyTypeObject* tp = Py_TYPE(obj);
7208 if (likely(tp->tp_getattro))
7209 return tp->tp_getattro(obj, attr_name);
7210 #if PY_MAJOR_VERSION < 3
7211 if (likely(tp->tp_getattr))
7212 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
7213 #endif
7214 return PyObject_GetAttr(obj, attr_name);
7215 }
7216 #endif
7217
7218 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)7219 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
7220 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
7221 if (unlikely(!result)) {
7222 PyErr_Format(PyExc_NameError,
7223 #if PY_MAJOR_VERSION >= 3
7224 "name '%U' is not defined", name);
7225 #else
7226 "name '%.200s' is not defined", PyString_AS_STRING(name));
7227 #endif
7228 }
7229 return result;
7230 }
7231
7232 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)7233 static void __Pyx_RaiseDoubleKeywordsError(
7234 const char* func_name,
7235 PyObject* kw_name)
7236 {
7237 PyErr_Format(PyExc_TypeError,
7238 #if PY_MAJOR_VERSION >= 3
7239 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7240 #else
7241 "%s() got multiple values for keyword argument '%s'", func_name,
7242 PyString_AsString(kw_name));
7243 #endif
7244 }
7245
7246 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)7247 static int __Pyx_ParseOptionalKeywords(
7248 PyObject *kwds,
7249 PyObject **argnames[],
7250 PyObject *kwds2,
7251 PyObject *values[],
7252 Py_ssize_t num_pos_args,
7253 const char* function_name)
7254 {
7255 PyObject *key = 0, *value = 0;
7256 Py_ssize_t pos = 0;
7257 PyObject*** name;
7258 PyObject*** first_kw_arg = argnames + num_pos_args;
7259 while (PyDict_Next(kwds, &pos, &key, &value)) {
7260 name = first_kw_arg;
7261 while (*name && (**name != key)) name++;
7262 if (*name) {
7263 values[name-argnames] = value;
7264 continue;
7265 }
7266 name = first_kw_arg;
7267 #if PY_MAJOR_VERSION < 3
7268 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
7269 while (*name) {
7270 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
7271 && _PyString_Eq(**name, key)) {
7272 values[name-argnames] = value;
7273 break;
7274 }
7275 name++;
7276 }
7277 if (*name) continue;
7278 else {
7279 PyObject*** argname = argnames;
7280 while (argname != first_kw_arg) {
7281 if ((**argname == key) || (
7282 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
7283 && _PyString_Eq(**argname, key))) {
7284 goto arg_passed_twice;
7285 }
7286 argname++;
7287 }
7288 }
7289 } else
7290 #endif
7291 if (likely(PyUnicode_Check(key))) {
7292 while (*name) {
7293 int cmp = (**name == key) ? 0 :
7294 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7295 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
7296 #endif
7297 PyUnicode_Compare(**name, key);
7298 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7299 if (cmp == 0) {
7300 values[name-argnames] = value;
7301 break;
7302 }
7303 name++;
7304 }
7305 if (*name) continue;
7306 else {
7307 PyObject*** argname = argnames;
7308 while (argname != first_kw_arg) {
7309 int cmp = (**argname == key) ? 0 :
7310 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7311 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
7312 #endif
7313 PyUnicode_Compare(**argname, key);
7314 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7315 if (cmp == 0) goto arg_passed_twice;
7316 argname++;
7317 }
7318 }
7319 } else
7320 goto invalid_keyword_type;
7321 if (kwds2) {
7322 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7323 } else {
7324 goto invalid_keyword;
7325 }
7326 }
7327 return 0;
7328 arg_passed_twice:
7329 __Pyx_RaiseDoubleKeywordsError(function_name, key);
7330 goto bad;
7331 invalid_keyword_type:
7332 PyErr_Format(PyExc_TypeError,
7333 "%.200s() keywords must be strings", function_name);
7334 goto bad;
7335 invalid_keyword:
7336 PyErr_Format(PyExc_TypeError,
7337 #if PY_MAJOR_VERSION < 3
7338 "%.200s() got an unexpected keyword argument '%.200s'",
7339 function_name, PyString_AsString(key));
7340 #else
7341 "%s() got an unexpected keyword argument '%U'",
7342 function_name, key);
7343 #endif
7344 bad:
7345 return -1;
7346 }
7347
7348 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)7349 static void __Pyx_RaiseArgtupleInvalid(
7350 const char* func_name,
7351 int exact,
7352 Py_ssize_t num_min,
7353 Py_ssize_t num_max,
7354 Py_ssize_t num_found)
7355 {
7356 Py_ssize_t num_expected;
7357 const char *more_or_less;
7358 if (num_found < num_min) {
7359 num_expected = num_min;
7360 more_or_less = "at least";
7361 } else {
7362 num_expected = num_max;
7363 more_or_less = "at most";
7364 }
7365 if (exact) {
7366 more_or_less = "exactly";
7367 }
7368 PyErr_Format(PyExc_TypeError,
7369 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
7370 func_name, more_or_less, num_expected,
7371 (num_expected == 1) ? "" : "s", num_found);
7372 }
7373
7374 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)7375 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
7376 if (unlikely(!type)) {
7377 PyErr_SetString(PyExc_SystemError, "Missing type object");
7378 return 0;
7379 }
7380 if (likely(__Pyx_TypeCheck(obj, type)))
7381 return 1;
7382 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
7383 Py_TYPE(obj)->tp_name, type->tp_name);
7384 return 0;
7385 }
7386
7387 /* PyCFunctionFastCall */
7388 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)7389 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
7390 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
7391 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
7392 PyObject *self = PyCFunction_GET_SELF(func);
7393 int flags = PyCFunction_GET_FLAGS(func);
7394 assert(PyCFunction_Check(func));
7395 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
7396 assert(nargs >= 0);
7397 assert(nargs == 0 || args != NULL);
7398 /* _PyCFunction_FastCallDict() must not be called with an exception set,
7399 because it may clear it (directly or indirectly) and so the
7400 caller loses its exception */
7401 assert(!PyErr_Occurred());
7402 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
7403 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
7404 } else {
7405 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
7406 }
7407 }
7408 #endif
7409
7410 /* PyFunctionFastCall */
7411 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)7412 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
7413 PyObject *globals) {
7414 PyFrameObject *f;
7415 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7416 PyObject **fastlocals;
7417 Py_ssize_t i;
7418 PyObject *result;
7419 assert(globals != NULL);
7420 /* XXX Perhaps we should create a specialized
7421 PyFrame_New() that doesn't take locals, but does
7422 take builtins without sanity checking them.
7423 */
7424 assert(tstate != NULL);
7425 f = PyFrame_New(tstate, co, globals, NULL);
7426 if (f == NULL) {
7427 return NULL;
7428 }
7429 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
7430 for (i = 0; i < na; i++) {
7431 Py_INCREF(*args);
7432 fastlocals[i] = *args++;
7433 }
7434 result = PyEval_EvalFrameEx(f,0);
7435 ++tstate->recursion_depth;
7436 Py_DECREF(f);
7437 --tstate->recursion_depth;
7438 return result;
7439 }
7440 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)7441 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
7442 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
7443 PyObject *globals = PyFunction_GET_GLOBALS(func);
7444 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
7445 PyObject *closure;
7446 #if PY_MAJOR_VERSION >= 3
7447 PyObject *kwdefs;
7448 #endif
7449 PyObject *kwtuple, **k;
7450 PyObject **d;
7451 Py_ssize_t nd;
7452 Py_ssize_t nk;
7453 PyObject *result;
7454 assert(kwargs == NULL || PyDict_Check(kwargs));
7455 nk = kwargs ? PyDict_Size(kwargs) : 0;
7456 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
7457 return NULL;
7458 }
7459 if (
7460 #if PY_MAJOR_VERSION >= 3
7461 co->co_kwonlyargcount == 0 &&
7462 #endif
7463 likely(kwargs == NULL || nk == 0) &&
7464 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
7465 if (argdefs == NULL && co->co_argcount == nargs) {
7466 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
7467 goto done;
7468 }
7469 else if (nargs == 0 && argdefs != NULL
7470 && co->co_argcount == Py_SIZE(argdefs)) {
7471 /* function called with no arguments, but all parameters have
7472 a default value: use default values as arguments .*/
7473 args = &PyTuple_GET_ITEM(argdefs, 0);
7474 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
7475 goto done;
7476 }
7477 }
7478 if (kwargs != NULL) {
7479 Py_ssize_t pos, i;
7480 kwtuple = PyTuple_New(2 * nk);
7481 if (kwtuple == NULL) {
7482 result = NULL;
7483 goto done;
7484 }
7485 k = &PyTuple_GET_ITEM(kwtuple, 0);
7486 pos = i = 0;
7487 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
7488 Py_INCREF(k[i]);
7489 Py_INCREF(k[i+1]);
7490 i += 2;
7491 }
7492 nk = i / 2;
7493 }
7494 else {
7495 kwtuple = NULL;
7496 k = NULL;
7497 }
7498 closure = PyFunction_GET_CLOSURE(func);
7499 #if PY_MAJOR_VERSION >= 3
7500 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
7501 #endif
7502 if (argdefs != NULL) {
7503 d = &PyTuple_GET_ITEM(argdefs, 0);
7504 nd = Py_SIZE(argdefs);
7505 }
7506 else {
7507 d = NULL;
7508 nd = 0;
7509 }
7510 #if PY_MAJOR_VERSION >= 3
7511 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
7512 args, (int)nargs,
7513 k, (int)nk,
7514 d, (int)nd, kwdefs, closure);
7515 #else
7516 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
7517 args, (int)nargs,
7518 k, (int)nk,
7519 d, (int)nd, closure);
7520 #endif
7521 Py_XDECREF(kwtuple);
7522 done:
7523 Py_LeaveRecursiveCall();
7524 return result;
7525 }
7526 #endif
7527 #endif
7528
7529 /* PyObjectCall */
7530 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)7531 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
7532 PyObject *result;
7533 ternaryfunc call = func->ob_type->tp_call;
7534 if (unlikely(!call))
7535 return PyObject_Call(func, arg, kw);
7536 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7537 return NULL;
7538 result = (*call)(func, arg, kw);
7539 Py_LeaveRecursiveCall();
7540 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7541 PyErr_SetString(
7542 PyExc_SystemError,
7543 "NULL result without error in PyObject_Call");
7544 }
7545 return result;
7546 }
7547 #endif
7548
7549 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)7550 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
7551 PyObject *args, *result = NULL;
7552 #if CYTHON_FAST_PYCALL
7553 if (PyFunction_Check(function)) {
7554 PyObject *args[2] = {arg1, arg2};
7555 return __Pyx_PyFunction_FastCall(function, args, 2);
7556 }
7557 #endif
7558 #if CYTHON_FAST_PYCCALL
7559 if (__Pyx_PyFastCFunction_Check(function)) {
7560 PyObject *args[2] = {arg1, arg2};
7561 return __Pyx_PyCFunction_FastCall(function, args, 2);
7562 }
7563 #endif
7564 args = PyTuple_New(2);
7565 if (unlikely(!args)) goto done;
7566 Py_INCREF(arg1);
7567 PyTuple_SET_ITEM(args, 0, arg1);
7568 Py_INCREF(arg2);
7569 PyTuple_SET_ITEM(args, 1, arg2);
7570 Py_INCREF(function);
7571 result = __Pyx_PyObject_Call(function, args, NULL);
7572 Py_DECREF(args);
7573 Py_DECREF(function);
7574 done:
7575 return result;
7576 }
7577
7578 /* PyObjectCallMethO */
7579 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)7580 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
7581 PyObject *self, *result;
7582 PyCFunction cfunc;
7583 cfunc = PyCFunction_GET_FUNCTION(func);
7584 self = PyCFunction_GET_SELF(func);
7585 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7586 return NULL;
7587 result = cfunc(self, arg);
7588 Py_LeaveRecursiveCall();
7589 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7590 PyErr_SetString(
7591 PyExc_SystemError,
7592 "NULL result without error in PyObject_Call");
7593 }
7594 return result;
7595 }
7596 #endif
7597
7598 /* PyObjectCallOneArg */
7599 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)7600 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7601 PyObject *result;
7602 PyObject *args = PyTuple_New(1);
7603 if (unlikely(!args)) return NULL;
7604 Py_INCREF(arg);
7605 PyTuple_SET_ITEM(args, 0, arg);
7606 result = __Pyx_PyObject_Call(func, args, NULL);
7607 Py_DECREF(args);
7608 return result;
7609 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)7610 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7611 #if CYTHON_FAST_PYCALL
7612 if (PyFunction_Check(func)) {
7613 return __Pyx_PyFunction_FastCall(func, &arg, 1);
7614 }
7615 #endif
7616 if (likely(PyCFunction_Check(func))) {
7617 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
7618 return __Pyx_PyObject_CallMethO(func, arg);
7619 #if CYTHON_FAST_PYCCALL
7620 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
7621 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
7622 #endif
7623 }
7624 }
7625 return __Pyx__PyObject_CallOneArg(func, arg);
7626 }
7627 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)7628 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7629 PyObject *result;
7630 PyObject *args = PyTuple_Pack(1, arg);
7631 if (unlikely(!args)) return NULL;
7632 result = __Pyx_PyObject_Call(func, args, NULL);
7633 Py_DECREF(args);
7634 return result;
7635 }
7636 #endif
7637
7638 /* PyObjectCallNoArg */
7639 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)7640 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
7641 #if CYTHON_FAST_PYCALL
7642 if (PyFunction_Check(func)) {
7643 return __Pyx_PyFunction_FastCall(func, NULL, 0);
7644 }
7645 #endif
7646 #ifdef __Pyx_CyFunction_USED
7647 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
7648 #else
7649 if (likely(PyCFunction_Check(func)))
7650 #endif
7651 {
7652 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
7653 return __Pyx_PyObject_CallMethO(func, NULL);
7654 }
7655 }
7656 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
7657 }
7658 #endif
7659
7660 /* SliceObject */
__Pyx_PyObject_GetSlice(PyObject * obj,Py_ssize_t cstart,Py_ssize_t cstop,PyObject ** _py_start,PyObject ** _py_stop,PyObject ** _py_slice,int has_cstart,int has_cstop,CYTHON_UNUSED int wraparound)7661 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
7662 Py_ssize_t cstart, Py_ssize_t cstop,
7663 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
7664 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
7665 #if CYTHON_USE_TYPE_SLOTS
7666 PyMappingMethods* mp;
7667 #if PY_MAJOR_VERSION < 3
7668 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
7669 if (likely(ms && ms->sq_slice)) {
7670 if (!has_cstart) {
7671 if (_py_start && (*_py_start != Py_None)) {
7672 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
7673 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
7674 } else
7675 cstart = 0;
7676 }
7677 if (!has_cstop) {
7678 if (_py_stop && (*_py_stop != Py_None)) {
7679 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
7680 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
7681 } else
7682 cstop = PY_SSIZE_T_MAX;
7683 }
7684 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
7685 Py_ssize_t l = ms->sq_length(obj);
7686 if (likely(l >= 0)) {
7687 if (cstop < 0) {
7688 cstop += l;
7689 if (cstop < 0) cstop = 0;
7690 }
7691 if (cstart < 0) {
7692 cstart += l;
7693 if (cstart < 0) cstart = 0;
7694 }
7695 } else {
7696 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
7697 goto bad;
7698 PyErr_Clear();
7699 }
7700 }
7701 return ms->sq_slice(obj, cstart, cstop);
7702 }
7703 #endif
7704 mp = Py_TYPE(obj)->tp_as_mapping;
7705 if (likely(mp && mp->mp_subscript))
7706 #endif
7707 {
7708 PyObject* result;
7709 PyObject *py_slice, *py_start, *py_stop;
7710 if (_py_slice) {
7711 py_slice = *_py_slice;
7712 } else {
7713 PyObject* owned_start = NULL;
7714 PyObject* owned_stop = NULL;
7715 if (_py_start) {
7716 py_start = *_py_start;
7717 } else {
7718 if (has_cstart) {
7719 owned_start = py_start = PyInt_FromSsize_t(cstart);
7720 if (unlikely(!py_start)) goto bad;
7721 } else
7722 py_start = Py_None;
7723 }
7724 if (_py_stop) {
7725 py_stop = *_py_stop;
7726 } else {
7727 if (has_cstop) {
7728 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
7729 if (unlikely(!py_stop)) {
7730 Py_XDECREF(owned_start);
7731 goto bad;
7732 }
7733 } else
7734 py_stop = Py_None;
7735 }
7736 py_slice = PySlice_New(py_start, py_stop, Py_None);
7737 Py_XDECREF(owned_start);
7738 Py_XDECREF(owned_stop);
7739 if (unlikely(!py_slice)) goto bad;
7740 }
7741 #if CYTHON_USE_TYPE_SLOTS
7742 result = mp->mp_subscript(obj, py_slice);
7743 #else
7744 result = PyObject_GetItem(obj, py_slice);
7745 #endif
7746 if (!_py_slice) {
7747 Py_DECREF(py_slice);
7748 }
7749 return result;
7750 }
7751 PyErr_Format(PyExc_TypeError,
7752 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
7753 bad:
7754 return NULL;
7755 }
7756
7757 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)7758 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
7759 PyObject *r;
7760 if (!j) return NULL;
7761 r = PyObject_GetItem(o, j);
7762 Py_DECREF(j);
7763 return r;
7764 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)7765 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
7766 CYTHON_NCP_UNUSED int wraparound,
7767 CYTHON_NCP_UNUSED int boundscheck) {
7768 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7769 Py_ssize_t wrapped_i = i;
7770 if (wraparound & unlikely(i < 0)) {
7771 wrapped_i += PyList_GET_SIZE(o);
7772 }
7773 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
7774 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
7775 Py_INCREF(r);
7776 return r;
7777 }
7778 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
7779 #else
7780 return PySequence_GetItem(o, i);
7781 #endif
7782 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)7783 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
7784 CYTHON_NCP_UNUSED int wraparound,
7785 CYTHON_NCP_UNUSED int boundscheck) {
7786 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7787 Py_ssize_t wrapped_i = i;
7788 if (wraparound & unlikely(i < 0)) {
7789 wrapped_i += PyTuple_GET_SIZE(o);
7790 }
7791 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
7792 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
7793 Py_INCREF(r);
7794 return r;
7795 }
7796 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
7797 #else
7798 return PySequence_GetItem(o, i);
7799 #endif
7800 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)7801 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
7802 CYTHON_NCP_UNUSED int wraparound,
7803 CYTHON_NCP_UNUSED int boundscheck) {
7804 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
7805 if (is_list || PyList_CheckExact(o)) {
7806 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
7807 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
7808 PyObject *r = PyList_GET_ITEM(o, n);
7809 Py_INCREF(r);
7810 return r;
7811 }
7812 }
7813 else if (PyTuple_CheckExact(o)) {
7814 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
7815 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
7816 PyObject *r = PyTuple_GET_ITEM(o, n);
7817 Py_INCREF(r);
7818 return r;
7819 }
7820 } else {
7821 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
7822 if (likely(m && m->sq_item)) {
7823 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
7824 Py_ssize_t l = m->sq_length(o);
7825 if (likely(l >= 0)) {
7826 i += l;
7827 } else {
7828 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
7829 return NULL;
7830 PyErr_Clear();
7831 }
7832 }
7833 return m->sq_item(o, i);
7834 }
7835 }
7836 #else
7837 if (is_list || PySequence_Check(o)) {
7838 return PySequence_GetItem(o, i);
7839 }
7840 #endif
7841 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
7842 }
7843
7844 /* ObjectGetItem */
7845 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)7846 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
7847 PyObject *runerr;
7848 Py_ssize_t key_value;
7849 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
7850 if (unlikely(!(m && m->sq_item))) {
7851 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
7852 return NULL;
7853 }
7854 key_value = __Pyx_PyIndex_AsSsize_t(index);
7855 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
7856 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
7857 }
7858 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
7859 PyErr_Clear();
7860 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
7861 }
7862 return NULL;
7863 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)7864 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
7865 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
7866 if (likely(m && m->mp_subscript)) {
7867 return m->mp_subscript(obj, key);
7868 }
7869 return __Pyx_PyObject_GetIndex(obj, key);
7870 }
7871 #endif
7872
7873 /* PyDictVersioning */
7874 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)7875 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
7876 PyObject *dict = Py_TYPE(obj)->tp_dict;
7877 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
7878 }
__Pyx_get_object_dict_version(PyObject * obj)7879 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
7880 PyObject **dictptr = NULL;
7881 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
7882 if (offset) {
7883 #if CYTHON_COMPILING_IN_CPYTHON
7884 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
7885 #else
7886 dictptr = _PyObject_GetDictPtr(obj);
7887 #endif
7888 }
7889 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
7890 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)7891 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
7892 PyObject *dict = Py_TYPE(obj)->tp_dict;
7893 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
7894 return 0;
7895 return obj_dict_version == __Pyx_get_object_dict_version(obj);
7896 }
7897 #endif
7898
7899 /* GetModuleGlobalName */
7900 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)7901 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
7902 #else
7903 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
7904 #endif
7905 {
7906 PyObject *result;
7907 #if !CYTHON_AVOID_BORROWED_REFS
7908 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
7909 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
7910 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7911 if (likely(result)) {
7912 return __Pyx_NewRef(result);
7913 } else if (unlikely(PyErr_Occurred())) {
7914 return NULL;
7915 }
7916 #else
7917 result = PyDict_GetItem(__pyx_d, name);
7918 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7919 if (likely(result)) {
7920 return __Pyx_NewRef(result);
7921 }
7922 #endif
7923 #else
7924 result = PyObject_GetItem(__pyx_d, name);
7925 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7926 if (likely(result)) {
7927 return __Pyx_NewRef(result);
7928 }
7929 PyErr_Clear();
7930 #endif
7931 return __Pyx_GetBuiltinName(name);
7932 }
7933
7934 /* py_abs */
7935 #if CYTHON_USE_PYLONG_INTERNALS
__Pyx_PyLong_AbsNeg(PyObject * n)7936 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
7937 if (likely(Py_SIZE(n) == -1)) {
7938 return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
7939 }
7940 #if CYTHON_COMPILING_IN_CPYTHON
7941 {
7942 PyObject *copy = _PyLong_Copy((PyLongObject*)n);
7943 if (likely(copy)) {
7944 Py_SIZE(copy) = -(Py_SIZE(copy));
7945 }
7946 return copy;
7947 }
7948 #else
7949 return PyNumber_Negative(n);
7950 #endif
7951 }
7952 #endif
7953
7954 /* PyErrFetchRestore */
7955 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)7956 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7957 PyObject *tmp_type, *tmp_value, *tmp_tb;
7958 tmp_type = tstate->curexc_type;
7959 tmp_value = tstate->curexc_value;
7960 tmp_tb = tstate->curexc_traceback;
7961 tstate->curexc_type = type;
7962 tstate->curexc_value = value;
7963 tstate->curexc_traceback = tb;
7964 Py_XDECREF(tmp_type);
7965 Py_XDECREF(tmp_value);
7966 Py_XDECREF(tmp_tb);
7967 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)7968 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7969 *type = tstate->curexc_type;
7970 *value = tstate->curexc_value;
7971 *tb = tstate->curexc_traceback;
7972 tstate->curexc_type = 0;
7973 tstate->curexc_value = 0;
7974 tstate->curexc_traceback = 0;
7975 }
7976 #endif
7977
7978 /* RaiseException */
7979 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)7980 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
7981 CYTHON_UNUSED PyObject *cause) {
7982 __Pyx_PyThreadState_declare
7983 Py_XINCREF(type);
7984 if (!value || value == Py_None)
7985 value = NULL;
7986 else
7987 Py_INCREF(value);
7988 if (!tb || tb == Py_None)
7989 tb = NULL;
7990 else {
7991 Py_INCREF(tb);
7992 if (!PyTraceBack_Check(tb)) {
7993 PyErr_SetString(PyExc_TypeError,
7994 "raise: arg 3 must be a traceback or None");
7995 goto raise_error;
7996 }
7997 }
7998 if (PyType_Check(type)) {
7999 #if CYTHON_COMPILING_IN_PYPY
8000 if (!value) {
8001 Py_INCREF(Py_None);
8002 value = Py_None;
8003 }
8004 #endif
8005 PyErr_NormalizeException(&type, &value, &tb);
8006 } else {
8007 if (value) {
8008 PyErr_SetString(PyExc_TypeError,
8009 "instance exception may not have a separate value");
8010 goto raise_error;
8011 }
8012 value = type;
8013 type = (PyObject*) Py_TYPE(type);
8014 Py_INCREF(type);
8015 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
8016 PyErr_SetString(PyExc_TypeError,
8017 "raise: exception class must be a subclass of BaseException");
8018 goto raise_error;
8019 }
8020 }
8021 __Pyx_PyThreadState_assign
8022 __Pyx_ErrRestore(type, value, tb);
8023 return;
8024 raise_error:
8025 Py_XDECREF(value);
8026 Py_XDECREF(type);
8027 Py_XDECREF(tb);
8028 return;
8029 }
8030 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)8031 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
8032 PyObject* owned_instance = NULL;
8033 if (tb == Py_None) {
8034 tb = 0;
8035 } else if (tb && !PyTraceBack_Check(tb)) {
8036 PyErr_SetString(PyExc_TypeError,
8037 "raise: arg 3 must be a traceback or None");
8038 goto bad;
8039 }
8040 if (value == Py_None)
8041 value = 0;
8042 if (PyExceptionInstance_Check(type)) {
8043 if (value) {
8044 PyErr_SetString(PyExc_TypeError,
8045 "instance exception may not have a separate value");
8046 goto bad;
8047 }
8048 value = type;
8049 type = (PyObject*) Py_TYPE(value);
8050 } else if (PyExceptionClass_Check(type)) {
8051 PyObject *instance_class = NULL;
8052 if (value && PyExceptionInstance_Check(value)) {
8053 instance_class = (PyObject*) Py_TYPE(value);
8054 if (instance_class != type) {
8055 int is_subclass = PyObject_IsSubclass(instance_class, type);
8056 if (!is_subclass) {
8057 instance_class = NULL;
8058 } else if (unlikely(is_subclass == -1)) {
8059 goto bad;
8060 } else {
8061 type = instance_class;
8062 }
8063 }
8064 }
8065 if (!instance_class) {
8066 PyObject *args;
8067 if (!value)
8068 args = PyTuple_New(0);
8069 else if (PyTuple_Check(value)) {
8070 Py_INCREF(value);
8071 args = value;
8072 } else
8073 args = PyTuple_Pack(1, value);
8074 if (!args)
8075 goto bad;
8076 owned_instance = PyObject_Call(type, args, NULL);
8077 Py_DECREF(args);
8078 if (!owned_instance)
8079 goto bad;
8080 value = owned_instance;
8081 if (!PyExceptionInstance_Check(value)) {
8082 PyErr_Format(PyExc_TypeError,
8083 "calling %R should have returned an instance of "
8084 "BaseException, not %R",
8085 type, Py_TYPE(value));
8086 goto bad;
8087 }
8088 }
8089 } else {
8090 PyErr_SetString(PyExc_TypeError,
8091 "raise: exception class must be a subclass of BaseException");
8092 goto bad;
8093 }
8094 if (cause) {
8095 PyObject *fixed_cause;
8096 if (cause == Py_None) {
8097 fixed_cause = NULL;
8098 } else if (PyExceptionClass_Check(cause)) {
8099 fixed_cause = PyObject_CallObject(cause, NULL);
8100 if (fixed_cause == NULL)
8101 goto bad;
8102 } else if (PyExceptionInstance_Check(cause)) {
8103 fixed_cause = cause;
8104 Py_INCREF(fixed_cause);
8105 } else {
8106 PyErr_SetString(PyExc_TypeError,
8107 "exception causes must derive from "
8108 "BaseException");
8109 goto bad;
8110 }
8111 PyException_SetCause(value, fixed_cause);
8112 }
8113 PyErr_SetObject(type, value);
8114 if (tb) {
8115 #if CYTHON_COMPILING_IN_PYPY
8116 PyObject *tmp_type, *tmp_value, *tmp_tb;
8117 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
8118 Py_INCREF(tb);
8119 PyErr_Restore(tmp_type, tmp_value, tb);
8120 Py_XDECREF(tmp_tb);
8121 #else
8122 PyThreadState *tstate = __Pyx_PyThreadState_Current;
8123 PyObject* tmp_tb = tstate->curexc_traceback;
8124 if (tb != tmp_tb) {
8125 Py_INCREF(tb);
8126 tstate->curexc_traceback = tb;
8127 Py_XDECREF(tmp_tb);
8128 }
8129 #endif
8130 }
8131 bad:
8132 Py_XDECREF(owned_instance);
8133 return;
8134 }
8135 #endif
8136
8137 /* DictGetItem */
8138 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)8139 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
8140 PyObject *value;
8141 value = PyDict_GetItemWithError(d, key);
8142 if (unlikely(!value)) {
8143 if (!PyErr_Occurred()) {
8144 if (unlikely(PyTuple_Check(key))) {
8145 PyObject* args = PyTuple_Pack(1, key);
8146 if (likely(args)) {
8147 PyErr_SetObject(PyExc_KeyError, args);
8148 Py_DECREF(args);
8149 }
8150 } else {
8151 PyErr_SetObject(PyExc_KeyError, key);
8152 }
8153 }
8154 return NULL;
8155 }
8156 Py_INCREF(value);
8157 return value;
8158 }
8159 #endif
8160
8161 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)8162 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
8163 PyErr_Format(PyExc_ValueError,
8164 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
8165 }
8166
8167 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)8168 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
8169 PyErr_Format(PyExc_ValueError,
8170 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
8171 index, (index == 1) ? "" : "s");
8172 }
8173
8174 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)8175 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
8176 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
8177 }
8178
8179 /* GetTopmostException */
8180 #if CYTHON_USE_EXC_INFO_STACK
8181 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)8182 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
8183 {
8184 _PyErr_StackItem *exc_info = tstate->exc_info;
8185 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
8186 exc_info->previous_item != NULL)
8187 {
8188 exc_info = exc_info->previous_item;
8189 }
8190 return exc_info;
8191 }
8192 #endif
8193
8194 /* SaveResetException */
8195 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)8196 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8197 #if CYTHON_USE_EXC_INFO_STACK
8198 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
8199 *type = exc_info->exc_type;
8200 *value = exc_info->exc_value;
8201 *tb = exc_info->exc_traceback;
8202 #else
8203 *type = tstate->exc_type;
8204 *value = tstate->exc_value;
8205 *tb = tstate->exc_traceback;
8206 #endif
8207 Py_XINCREF(*type);
8208 Py_XINCREF(*value);
8209 Py_XINCREF(*tb);
8210 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)8211 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8212 PyObject *tmp_type, *tmp_value, *tmp_tb;
8213 #if CYTHON_USE_EXC_INFO_STACK
8214 _PyErr_StackItem *exc_info = tstate->exc_info;
8215 tmp_type = exc_info->exc_type;
8216 tmp_value = exc_info->exc_value;
8217 tmp_tb = exc_info->exc_traceback;
8218 exc_info->exc_type = type;
8219 exc_info->exc_value = value;
8220 exc_info->exc_traceback = tb;
8221 #else
8222 tmp_type = tstate->exc_type;
8223 tmp_value = tstate->exc_value;
8224 tmp_tb = tstate->exc_traceback;
8225 tstate->exc_type = type;
8226 tstate->exc_value = value;
8227 tstate->exc_traceback = tb;
8228 #endif
8229 Py_XDECREF(tmp_type);
8230 Py_XDECREF(tmp_value);
8231 Py_XDECREF(tmp_tb);
8232 }
8233 #endif
8234
8235 /* PyErrExceptionMatches */
8236 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)8237 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8238 Py_ssize_t i, n;
8239 n = PyTuple_GET_SIZE(tuple);
8240 #if PY_MAJOR_VERSION >= 3
8241 for (i=0; i<n; i++) {
8242 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8243 }
8244 #endif
8245 for (i=0; i<n; i++) {
8246 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
8247 }
8248 return 0;
8249 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)8250 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8251 PyObject *exc_type = tstate->curexc_type;
8252 if (exc_type == err) return 1;
8253 if (unlikely(!exc_type)) return 0;
8254 if (unlikely(PyTuple_Check(err)))
8255 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
8256 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
8257 }
8258 #endif
8259
8260 /* GetException */
8261 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)8262 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
8263 #else
8264 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
8265 #endif
8266 {
8267 PyObject *local_type, *local_value, *local_tb;
8268 #if CYTHON_FAST_THREAD_STATE
8269 PyObject *tmp_type, *tmp_value, *tmp_tb;
8270 local_type = tstate->curexc_type;
8271 local_value = tstate->curexc_value;
8272 local_tb = tstate->curexc_traceback;
8273 tstate->curexc_type = 0;
8274 tstate->curexc_value = 0;
8275 tstate->curexc_traceback = 0;
8276 #else
8277 PyErr_Fetch(&local_type, &local_value, &local_tb);
8278 #endif
8279 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
8280 #if CYTHON_FAST_THREAD_STATE
8281 if (unlikely(tstate->curexc_type))
8282 #else
8283 if (unlikely(PyErr_Occurred()))
8284 #endif
8285 goto bad;
8286 #if PY_MAJOR_VERSION >= 3
8287 if (local_tb) {
8288 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
8289 goto bad;
8290 }
8291 #endif
8292 Py_XINCREF(local_tb);
8293 Py_XINCREF(local_type);
8294 Py_XINCREF(local_value);
8295 *type = local_type;
8296 *value = local_value;
8297 *tb = local_tb;
8298 #if CYTHON_FAST_THREAD_STATE
8299 #if CYTHON_USE_EXC_INFO_STACK
8300 {
8301 _PyErr_StackItem *exc_info = tstate->exc_info;
8302 tmp_type = exc_info->exc_type;
8303 tmp_value = exc_info->exc_value;
8304 tmp_tb = exc_info->exc_traceback;
8305 exc_info->exc_type = local_type;
8306 exc_info->exc_value = local_value;
8307 exc_info->exc_traceback = local_tb;
8308 }
8309 #else
8310 tmp_type = tstate->exc_type;
8311 tmp_value = tstate->exc_value;
8312 tmp_tb = tstate->exc_traceback;
8313 tstate->exc_type = local_type;
8314 tstate->exc_value = local_value;
8315 tstate->exc_traceback = local_tb;
8316 #endif
8317 Py_XDECREF(tmp_type);
8318 Py_XDECREF(tmp_value);
8319 Py_XDECREF(tmp_tb);
8320 #else
8321 PyErr_SetExcInfo(local_type, local_value, local_tb);
8322 #endif
8323 return 0;
8324 bad:
8325 *type = 0;
8326 *value = 0;
8327 *tb = 0;
8328 Py_XDECREF(local_type);
8329 Py_XDECREF(local_value);
8330 Py_XDECREF(local_tb);
8331 return -1;
8332 }
8333
8334 /* CallNextTpDealloc */
__Pyx_call_next_tp_dealloc(PyObject * obj,destructor current_tp_dealloc)8335 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
8336 PyTypeObject* type = Py_TYPE(obj);
8337 while (type && type->tp_dealloc != current_tp_dealloc)
8338 type = type->tp_base;
8339 while (type && type->tp_dealloc == current_tp_dealloc)
8340 type = type->tp_base;
8341 if (type)
8342 type->tp_dealloc(obj);
8343 }
8344
8345 /* CallNextTpTraverse */
__Pyx_call_next_tp_traverse(PyObject * obj,visitproc v,void * a,traverseproc current_tp_traverse)8346 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
8347 PyTypeObject* type = Py_TYPE(obj);
8348 while (type && type->tp_traverse != current_tp_traverse)
8349 type = type->tp_base;
8350 while (type && type->tp_traverse == current_tp_traverse)
8351 type = type->tp_base;
8352 if (type && type->tp_traverse)
8353 return type->tp_traverse(obj, v, a);
8354 return 0;
8355 }
8356
8357 /* CallNextTpClear */
__Pyx_call_next_tp_clear(PyObject * obj,inquiry current_tp_clear)8358 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
8359 PyTypeObject* type = Py_TYPE(obj);
8360 while (type && type->tp_clear != current_tp_clear)
8361 type = type->tp_base;
8362 while (type && type->tp_clear == current_tp_clear)
8363 type = type->tp_base;
8364 if (type && type->tp_clear)
8365 type->tp_clear(obj);
8366 }
8367
8368 /* TypeImport */
8369 #ifndef __PYX_HAVE_RT_ImportType
8370 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)8371 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
8372 size_t size, enum __Pyx_ImportType_CheckSize check_size)
8373 {
8374 PyObject *result = 0;
8375 char warning[200];
8376 Py_ssize_t basicsize;
8377 #ifdef Py_LIMITED_API
8378 PyObject *py_basicsize;
8379 #endif
8380 result = PyObject_GetAttrString(module, class_name);
8381 if (!result)
8382 goto bad;
8383 if (!PyType_Check(result)) {
8384 PyErr_Format(PyExc_TypeError,
8385 "%.200s.%.200s is not a type object",
8386 module_name, class_name);
8387 goto bad;
8388 }
8389 #ifndef Py_LIMITED_API
8390 basicsize = ((PyTypeObject *)result)->tp_basicsize;
8391 #else
8392 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
8393 if (!py_basicsize)
8394 goto bad;
8395 basicsize = PyLong_AsSsize_t(py_basicsize);
8396 Py_DECREF(py_basicsize);
8397 py_basicsize = 0;
8398 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
8399 goto bad;
8400 #endif
8401 if ((size_t)basicsize < size) {
8402 PyErr_Format(PyExc_ValueError,
8403 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8404 "Expected %zd from C header, got %zd from PyObject",
8405 module_name, class_name, size, basicsize);
8406 goto bad;
8407 }
8408 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
8409 PyErr_Format(PyExc_ValueError,
8410 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8411 "Expected %zd from C header, got %zd from PyObject",
8412 module_name, class_name, size, basicsize);
8413 goto bad;
8414 }
8415 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
8416 PyOS_snprintf(warning, sizeof(warning),
8417 "%s.%s size changed, may indicate binary incompatibility. "
8418 "Expected %zd from C header, got %zd from PyObject",
8419 module_name, class_name, size, basicsize);
8420 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
8421 }
8422 return (PyTypeObject *)result;
8423 bad:
8424 Py_XDECREF(result);
8425 return NULL;
8426 }
8427 #endif
8428
8429 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)8430 static void* __Pyx_GetVtable(PyObject *dict) {
8431 void* ptr;
8432 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
8433 if (!ob)
8434 goto bad;
8435 #if PY_VERSION_HEX >= 0x02070000
8436 ptr = PyCapsule_GetPointer(ob, 0);
8437 #else
8438 ptr = PyCObject_AsVoidPtr(ob);
8439 #endif
8440 if (!ptr && !PyErr_Occurred())
8441 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
8442 Py_DECREF(ob);
8443 return ptr;
8444 bad:
8445 Py_XDECREF(ob);
8446 return NULL;
8447 }
8448
8449 /* PyObject_GenericGetAttrNoDict */
8450 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)8451 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
8452 PyErr_Format(PyExc_AttributeError,
8453 #if PY_MAJOR_VERSION >= 3
8454 "'%.50s' object has no attribute '%U'",
8455 tp->tp_name, attr_name);
8456 #else
8457 "'%.50s' object has no attribute '%.400s'",
8458 tp->tp_name, PyString_AS_STRING(attr_name));
8459 #endif
8460 return NULL;
8461 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)8462 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
8463 PyObject *descr;
8464 PyTypeObject *tp = Py_TYPE(obj);
8465 if (unlikely(!PyString_Check(attr_name))) {
8466 return PyObject_GenericGetAttr(obj, attr_name);
8467 }
8468 assert(!tp->tp_dictoffset);
8469 descr = _PyType_Lookup(tp, attr_name);
8470 if (unlikely(!descr)) {
8471 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
8472 }
8473 Py_INCREF(descr);
8474 #if PY_MAJOR_VERSION < 3
8475 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
8476 #endif
8477 {
8478 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
8479 if (unlikely(f)) {
8480 PyObject *res = f(descr, obj, (PyObject *)tp);
8481 Py_DECREF(descr);
8482 return res;
8483 }
8484 }
8485 return descr;
8486 }
8487 #endif
8488
8489 /* PyObject_GenericGetAttr */
8490 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)8491 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
8492 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
8493 return PyObject_GenericGetAttr(obj, attr_name);
8494 }
8495 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
8496 }
8497 #endif
8498
8499 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)8500 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
8501 #if PY_VERSION_HEX >= 0x02070000
8502 PyObject *ob = PyCapsule_New(vtable, 0, 0);
8503 #else
8504 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
8505 #endif
8506 if (!ob)
8507 goto bad;
8508 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
8509 goto bad;
8510 Py_DECREF(ob);
8511 return 0;
8512 bad:
8513 Py_XDECREF(ob);
8514 return -1;
8515 }
8516
8517 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)8518 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
8519 int ret;
8520 PyObject *name_attr;
8521 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
8522 if (likely(name_attr)) {
8523 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
8524 } else {
8525 ret = -1;
8526 }
8527 if (unlikely(ret < 0)) {
8528 PyErr_Clear();
8529 ret = 0;
8530 }
8531 Py_XDECREF(name_attr);
8532 return ret;
8533 }
__Pyx_setup_reduce(PyObject * type_obj)8534 static int __Pyx_setup_reduce(PyObject* type_obj) {
8535 int ret = 0;
8536 PyObject *object_reduce = NULL;
8537 PyObject *object_reduce_ex = NULL;
8538 PyObject *reduce = NULL;
8539 PyObject *reduce_ex = NULL;
8540 PyObject *reduce_cython = NULL;
8541 PyObject *setstate = NULL;
8542 PyObject *setstate_cython = NULL;
8543 #if CYTHON_USE_PYTYPE_LOOKUP
8544 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
8545 #else
8546 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
8547 #endif
8548 #if CYTHON_USE_PYTYPE_LOOKUP
8549 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
8550 #else
8551 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
8552 #endif
8553 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
8554 if (reduce_ex == object_reduce_ex) {
8555 #if CYTHON_USE_PYTYPE_LOOKUP
8556 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
8557 #else
8558 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
8559 #endif
8560 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
8561 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
8562 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
8563 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
8564 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
8565 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
8566 if (!setstate) PyErr_Clear();
8567 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
8568 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
8569 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
8570 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
8571 }
8572 PyType_Modified((PyTypeObject*)type_obj);
8573 }
8574 }
8575 goto GOOD;
8576 BAD:
8577 if (!PyErr_Occurred())
8578 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
8579 ret = -1;
8580 GOOD:
8581 #if !CYTHON_USE_PYTYPE_LOOKUP
8582 Py_XDECREF(object_reduce);
8583 Py_XDECREF(object_reduce_ex);
8584 #endif
8585 Py_XDECREF(reduce);
8586 Py_XDECREF(reduce_ex);
8587 Py_XDECREF(reduce_cython);
8588 Py_XDECREF(setstate);
8589 Py_XDECREF(setstate_cython);
8590 return ret;
8591 }
8592
8593 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)8594 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
8595 PyObject *empty_list = 0;
8596 PyObject *module = 0;
8597 PyObject *global_dict = 0;
8598 PyObject *empty_dict = 0;
8599 PyObject *list;
8600 #if PY_MAJOR_VERSION < 3
8601 PyObject *py_import;
8602 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
8603 if (!py_import)
8604 goto bad;
8605 #endif
8606 if (from_list)
8607 list = from_list;
8608 else {
8609 empty_list = PyList_New(0);
8610 if (!empty_list)
8611 goto bad;
8612 list = empty_list;
8613 }
8614 global_dict = PyModule_GetDict(__pyx_m);
8615 if (!global_dict)
8616 goto bad;
8617 empty_dict = PyDict_New();
8618 if (!empty_dict)
8619 goto bad;
8620 {
8621 #if PY_MAJOR_VERSION >= 3
8622 if (level == -1) {
8623 if (strchr(__Pyx_MODULE_NAME, '.')) {
8624 module = PyImport_ImportModuleLevelObject(
8625 name, global_dict, empty_dict, list, 1);
8626 if (!module) {
8627 if (!PyErr_ExceptionMatches(PyExc_ImportError))
8628 goto bad;
8629 PyErr_Clear();
8630 }
8631 }
8632 level = 0;
8633 }
8634 #endif
8635 if (!module) {
8636 #if PY_MAJOR_VERSION < 3
8637 PyObject *py_level = PyInt_FromLong(level);
8638 if (!py_level)
8639 goto bad;
8640 module = PyObject_CallFunctionObjArgs(py_import,
8641 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
8642 Py_DECREF(py_level);
8643 #else
8644 module = PyImport_ImportModuleLevelObject(
8645 name, global_dict, empty_dict, list, level);
8646 #endif
8647 }
8648 }
8649 bad:
8650 #if PY_MAJOR_VERSION < 3
8651 Py_XDECREF(py_import);
8652 #endif
8653 Py_XDECREF(empty_list);
8654 Py_XDECREF(empty_dict);
8655 return module;
8656 }
8657
8658 /* CLineInTraceback */
8659 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)8660 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
8661 PyObject *use_cline;
8662 PyObject *ptype, *pvalue, *ptraceback;
8663 #if CYTHON_COMPILING_IN_CPYTHON
8664 PyObject **cython_runtime_dict;
8665 #endif
8666 if (unlikely(!__pyx_cython_runtime)) {
8667 return c_line;
8668 }
8669 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
8670 #if CYTHON_COMPILING_IN_CPYTHON
8671 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
8672 if (likely(cython_runtime_dict)) {
8673 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
8674 use_cline, *cython_runtime_dict,
8675 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
8676 } else
8677 #endif
8678 {
8679 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
8680 if (use_cline_obj) {
8681 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
8682 Py_DECREF(use_cline_obj);
8683 } else {
8684 PyErr_Clear();
8685 use_cline = NULL;
8686 }
8687 }
8688 if (!use_cline) {
8689 c_line = 0;
8690 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
8691 }
8692 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
8693 c_line = 0;
8694 }
8695 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
8696 return c_line;
8697 }
8698 #endif
8699
8700 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)8701 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
8702 int start = 0, mid = 0, end = count - 1;
8703 if (end >= 0 && code_line > entries[end].code_line) {
8704 return count;
8705 }
8706 while (start < end) {
8707 mid = start + (end - start) / 2;
8708 if (code_line < entries[mid].code_line) {
8709 end = mid;
8710 } else if (code_line > entries[mid].code_line) {
8711 start = mid + 1;
8712 } else {
8713 return mid;
8714 }
8715 }
8716 if (code_line <= entries[mid].code_line) {
8717 return mid;
8718 } else {
8719 return mid + 1;
8720 }
8721 }
__pyx_find_code_object(int code_line)8722 static PyCodeObject *__pyx_find_code_object(int code_line) {
8723 PyCodeObject* code_object;
8724 int pos;
8725 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
8726 return NULL;
8727 }
8728 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8729 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
8730 return NULL;
8731 }
8732 code_object = __pyx_code_cache.entries[pos].code_object;
8733 Py_INCREF(code_object);
8734 return code_object;
8735 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)8736 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
8737 int pos, i;
8738 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
8739 if (unlikely(!code_line)) {
8740 return;
8741 }
8742 if (unlikely(!entries)) {
8743 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
8744 if (likely(entries)) {
8745 __pyx_code_cache.entries = entries;
8746 __pyx_code_cache.max_count = 64;
8747 __pyx_code_cache.count = 1;
8748 entries[0].code_line = code_line;
8749 entries[0].code_object = code_object;
8750 Py_INCREF(code_object);
8751 }
8752 return;
8753 }
8754 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8755 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
8756 PyCodeObject* tmp = entries[pos].code_object;
8757 entries[pos].code_object = code_object;
8758 Py_DECREF(tmp);
8759 return;
8760 }
8761 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
8762 int new_max = __pyx_code_cache.max_count + 64;
8763 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
8764 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
8765 if (unlikely(!entries)) {
8766 return;
8767 }
8768 __pyx_code_cache.entries = entries;
8769 __pyx_code_cache.max_count = new_max;
8770 }
8771 for (i=__pyx_code_cache.count; i>pos; i--) {
8772 entries[i] = entries[i-1];
8773 }
8774 entries[pos].code_line = code_line;
8775 entries[pos].code_object = code_object;
8776 __pyx_code_cache.count++;
8777 Py_INCREF(code_object);
8778 }
8779
8780 /* AddTraceback */
8781 #include "compile.h"
8782 #include "frameobject.h"
8783 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)8784 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
8785 const char *funcname, int c_line,
8786 int py_line, const char *filename) {
8787 PyCodeObject *py_code = 0;
8788 PyObject *py_srcfile = 0;
8789 PyObject *py_funcname = 0;
8790 #if PY_MAJOR_VERSION < 3
8791 py_srcfile = PyString_FromString(filename);
8792 #else
8793 py_srcfile = PyUnicode_FromString(filename);
8794 #endif
8795 if (!py_srcfile) goto bad;
8796 if (c_line) {
8797 #if PY_MAJOR_VERSION < 3
8798 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8799 #else
8800 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8801 #endif
8802 }
8803 else {
8804 #if PY_MAJOR_VERSION < 3
8805 py_funcname = PyString_FromString(funcname);
8806 #else
8807 py_funcname = PyUnicode_FromString(funcname);
8808 #endif
8809 }
8810 if (!py_funcname) goto bad;
8811 py_code = __Pyx_PyCode_New(
8812 0,
8813 0,
8814 0,
8815 0,
8816 0,
8817 __pyx_empty_bytes, /*PyObject *code,*/
8818 __pyx_empty_tuple, /*PyObject *consts,*/
8819 __pyx_empty_tuple, /*PyObject *names,*/
8820 __pyx_empty_tuple, /*PyObject *varnames,*/
8821 __pyx_empty_tuple, /*PyObject *freevars,*/
8822 __pyx_empty_tuple, /*PyObject *cellvars,*/
8823 py_srcfile, /*PyObject *filename,*/
8824 py_funcname, /*PyObject *name,*/
8825 py_line,
8826 __pyx_empty_bytes /*PyObject *lnotab*/
8827 );
8828 Py_DECREF(py_srcfile);
8829 Py_DECREF(py_funcname);
8830 return py_code;
8831 bad:
8832 Py_XDECREF(py_srcfile);
8833 Py_XDECREF(py_funcname);
8834 return NULL;
8835 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)8836 static void __Pyx_AddTraceback(const char *funcname, int c_line,
8837 int py_line, const char *filename) {
8838 PyCodeObject *py_code = 0;
8839 PyFrameObject *py_frame = 0;
8840 PyThreadState *tstate = __Pyx_PyThreadState_Current;
8841 if (c_line) {
8842 c_line = __Pyx_CLineForTraceback(tstate, c_line);
8843 }
8844 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
8845 if (!py_code) {
8846 py_code = __Pyx_CreateCodeObjectForTraceback(
8847 funcname, c_line, py_line, filename);
8848 if (!py_code) goto bad;
8849 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
8850 }
8851 py_frame = PyFrame_New(
8852 tstate, /*PyThreadState *tstate,*/
8853 py_code, /*PyCodeObject *code,*/
8854 __pyx_d, /*PyObject *globals,*/
8855 0 /*PyObject *locals*/
8856 );
8857 if (!py_frame) goto bad;
8858 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
8859 PyTraceBack_Here(py_frame);
8860 bad:
8861 Py_XDECREF(py_code);
8862 Py_XDECREF(py_frame);
8863 }
8864
8865 /* CIntToPy */
__Pyx_PyInt_From_long(long value)8866 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
8867 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
8868 const int is_unsigned = neg_one > const_zero;
8869 if (is_unsigned) {
8870 if (sizeof(long) < sizeof(long)) {
8871 return PyInt_FromLong((long) value);
8872 } else if (sizeof(long) <= sizeof(unsigned long)) {
8873 return PyLong_FromUnsignedLong((unsigned long) value);
8874 #ifdef HAVE_LONG_LONG
8875 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
8876 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8877 #endif
8878 }
8879 } else {
8880 if (sizeof(long) <= sizeof(long)) {
8881 return PyInt_FromLong((long) value);
8882 #ifdef HAVE_LONG_LONG
8883 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
8884 return PyLong_FromLongLong((PY_LONG_LONG) value);
8885 #endif
8886 }
8887 }
8888 {
8889 int one = 1; int little = (int)*(unsigned char *)&one;
8890 unsigned char *bytes = (unsigned char *)&value;
8891 return _PyLong_FromByteArray(bytes, sizeof(long),
8892 little, !is_unsigned);
8893 }
8894 }
8895
8896 /* CIntFromPyVerify */
8897 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
8898 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
8899 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
8900 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
8901 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
8902 {\
8903 func_type value = func_value;\
8904 if (sizeof(target_type) < sizeof(func_type)) {\
8905 if (unlikely(value != (func_type) (target_type) value)) {\
8906 func_type zero = 0;\
8907 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
8908 return (target_type) -1;\
8909 if (is_unsigned && unlikely(value < zero))\
8910 goto raise_neg_overflow;\
8911 else\
8912 goto raise_overflow;\
8913 }\
8914 }\
8915 return (target_type) value;\
8916 }
8917
8918 /* CIntToPy */
__Pyx_PyInt_From_int(int value)8919 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
8920 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
8921 const int is_unsigned = neg_one > const_zero;
8922 if (is_unsigned) {
8923 if (sizeof(int) < sizeof(long)) {
8924 return PyInt_FromLong((long) value);
8925 } else if (sizeof(int) <= sizeof(unsigned long)) {
8926 return PyLong_FromUnsignedLong((unsigned long) value);
8927 #ifdef HAVE_LONG_LONG
8928 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
8929 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8930 #endif
8931 }
8932 } else {
8933 if (sizeof(int) <= sizeof(long)) {
8934 return PyInt_FromLong((long) value);
8935 #ifdef HAVE_LONG_LONG
8936 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
8937 return PyLong_FromLongLong((PY_LONG_LONG) value);
8938 #endif
8939 }
8940 }
8941 {
8942 int one = 1; int little = (int)*(unsigned char *)&one;
8943 unsigned char *bytes = (unsigned char *)&value;
8944 return _PyLong_FromByteArray(bytes, sizeof(int),
8945 little, !is_unsigned);
8946 }
8947 }
8948
8949 /* Declarations */
8950 #if CYTHON_CCOMPLEX
8951 #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)8952 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
8953 return ::std::complex< float >(x, y);
8954 }
8955 #else
__pyx_t_float_complex_from_parts(float x,float y)8956 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
8957 return x + y*(__pyx_t_float_complex)_Complex_I;
8958 }
8959 #endif
8960 #else
__pyx_t_float_complex_from_parts(float x,float y)8961 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
8962 __pyx_t_float_complex z;
8963 z.real = x;
8964 z.imag = y;
8965 return z;
8966 }
8967 #endif
8968
8969 /* Arithmetic */
8970 #if CYTHON_CCOMPLEX
8971 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)8972 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8973 return (a.real == b.real) && (a.imag == b.imag);
8974 }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)8975 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8976 __pyx_t_float_complex z;
8977 z.real = a.real + b.real;
8978 z.imag = a.imag + b.imag;
8979 return z;
8980 }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)8981 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8982 __pyx_t_float_complex z;
8983 z.real = a.real - b.real;
8984 z.imag = a.imag - b.imag;
8985 return z;
8986 }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)8987 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8988 __pyx_t_float_complex z;
8989 z.real = a.real * b.real - a.imag * b.imag;
8990 z.imag = a.real * b.imag + a.imag * b.real;
8991 return z;
8992 }
8993 #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)8994 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
8995 if (b.imag == 0) {
8996 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
8997 } else if (fabsf(b.real) >= fabsf(b.imag)) {
8998 if (b.real == 0 && b.imag == 0) {
8999 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
9000 } else {
9001 float r = b.imag / b.real;
9002 float s = (float)(1.0) / (b.real + b.imag * r);
9003 return __pyx_t_float_complex_from_parts(
9004 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
9005 }
9006 } else {
9007 float r = b.real / b.imag;
9008 float s = (float)(1.0) / (b.imag + b.real * r);
9009 return __pyx_t_float_complex_from_parts(
9010 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
9011 }
9012 }
9013 #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9014 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9015 if (b.imag == 0) {
9016 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
9017 } else {
9018 float denom = b.real * b.real + b.imag * b.imag;
9019 return __pyx_t_float_complex_from_parts(
9020 (a.real * b.real + a.imag * b.imag) / denom,
9021 (a.imag * b.real - a.real * b.imag) / denom);
9022 }
9023 }
9024 #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)9025 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
9026 __pyx_t_float_complex z;
9027 z.real = -a.real;
9028 z.imag = -a.imag;
9029 return z;
9030 }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)9031 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
9032 return (a.real == 0) && (a.imag == 0);
9033 }
__Pyx_c_conj_float(__pyx_t_float_complex a)9034 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
9035 __pyx_t_float_complex z;
9036 z.real = a.real;
9037 z.imag = -a.imag;
9038 return z;
9039 }
9040 #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)9041 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
9042 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
9043 return sqrtf(z.real*z.real + z.imag*z.imag);
9044 #else
9045 return hypotf(z.real, z.imag);
9046 #endif
9047 }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9048 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9049 __pyx_t_float_complex z;
9050 float r, lnr, theta, z_r, z_theta;
9051 if (b.imag == 0 && b.real == (int)b.real) {
9052 if (b.real < 0) {
9053 float denom = a.real * a.real + a.imag * a.imag;
9054 a.real = a.real / denom;
9055 a.imag = -a.imag / denom;
9056 b.real = -b.real;
9057 }
9058 switch ((int)b.real) {
9059 case 0:
9060 z.real = 1;
9061 z.imag = 0;
9062 return z;
9063 case 1:
9064 return a;
9065 case 2:
9066 z = __Pyx_c_prod_float(a, a);
9067 return __Pyx_c_prod_float(a, a);
9068 case 3:
9069 z = __Pyx_c_prod_float(a, a);
9070 return __Pyx_c_prod_float(z, a);
9071 case 4:
9072 z = __Pyx_c_prod_float(a, a);
9073 return __Pyx_c_prod_float(z, z);
9074 }
9075 }
9076 if (a.imag == 0) {
9077 if (a.real == 0) {
9078 return a;
9079 } else if (b.imag == 0) {
9080 z.real = powf(a.real, b.real);
9081 z.imag = 0;
9082 return z;
9083 } else if (a.real > 0) {
9084 r = a.real;
9085 theta = 0;
9086 } else {
9087 r = -a.real;
9088 theta = atan2f(0.0, -1.0);
9089 }
9090 } else {
9091 r = __Pyx_c_abs_float(a);
9092 theta = atan2f(a.imag, a.real);
9093 }
9094 lnr = logf(r);
9095 z_r = expf(lnr * b.real - theta * b.imag);
9096 z_theta = theta * b.real + lnr * b.imag;
9097 z.real = z_r * cosf(z_theta);
9098 z.imag = z_r * sinf(z_theta);
9099 return z;
9100 }
9101 #endif
9102 #endif
9103
9104 /* Declarations */
9105 #if CYTHON_CCOMPLEX
9106 #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)9107 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
9108 return ::std::complex< double >(x, y);
9109 }
9110 #else
__pyx_t_double_complex_from_parts(double x,double y)9111 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
9112 return x + y*(__pyx_t_double_complex)_Complex_I;
9113 }
9114 #endif
9115 #else
__pyx_t_double_complex_from_parts(double x,double y)9116 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
9117 __pyx_t_double_complex z;
9118 z.real = x;
9119 z.imag = y;
9120 return z;
9121 }
9122 #endif
9123
9124 /* Arithmetic */
9125 #if CYTHON_CCOMPLEX
9126 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)9127 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
9128 return (a.real == b.real) && (a.imag == b.imag);
9129 }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)9130 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
9131 __pyx_t_double_complex z;
9132 z.real = a.real + b.real;
9133 z.imag = a.imag + b.imag;
9134 return z;
9135 }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)9136 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
9137 __pyx_t_double_complex z;
9138 z.real = a.real - b.real;
9139 z.imag = a.imag - b.imag;
9140 return z;
9141 }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)9142 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
9143 __pyx_t_double_complex z;
9144 z.real = a.real * b.real - a.imag * b.imag;
9145 z.imag = a.real * b.imag + a.imag * b.real;
9146 return z;
9147 }
9148 #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)9149 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
9150 if (b.imag == 0) {
9151 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
9152 } else if (fabs(b.real) >= fabs(b.imag)) {
9153 if (b.real == 0 && b.imag == 0) {
9154 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
9155 } else {
9156 double r = b.imag / b.real;
9157 double s = (double)(1.0) / (b.real + b.imag * r);
9158 return __pyx_t_double_complex_from_parts(
9159 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
9160 }
9161 } else {
9162 double r = b.real / b.imag;
9163 double s = (double)(1.0) / (b.imag + b.real * r);
9164 return __pyx_t_double_complex_from_parts(
9165 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
9166 }
9167 }
9168 #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)9169 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
9170 if (b.imag == 0) {
9171 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
9172 } else {
9173 double denom = b.real * b.real + b.imag * b.imag;
9174 return __pyx_t_double_complex_from_parts(
9175 (a.real * b.real + a.imag * b.imag) / denom,
9176 (a.imag * b.real - a.real * b.imag) / denom);
9177 }
9178 }
9179 #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)9180 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
9181 __pyx_t_double_complex z;
9182 z.real = -a.real;
9183 z.imag = -a.imag;
9184 return z;
9185 }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)9186 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
9187 return (a.real == 0) && (a.imag == 0);
9188 }
__Pyx_c_conj_double(__pyx_t_double_complex a)9189 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
9190 __pyx_t_double_complex z;
9191 z.real = a.real;
9192 z.imag = -a.imag;
9193 return z;
9194 }
9195 #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)9196 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
9197 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
9198 return sqrt(z.real*z.real + z.imag*z.imag);
9199 #else
9200 return hypot(z.real, z.imag);
9201 #endif
9202 }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)9203 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
9204 __pyx_t_double_complex z;
9205 double r, lnr, theta, z_r, z_theta;
9206 if (b.imag == 0 && b.real == (int)b.real) {
9207 if (b.real < 0) {
9208 double denom = a.real * a.real + a.imag * a.imag;
9209 a.real = a.real / denom;
9210 a.imag = -a.imag / denom;
9211 b.real = -b.real;
9212 }
9213 switch ((int)b.real) {
9214 case 0:
9215 z.real = 1;
9216 z.imag = 0;
9217 return z;
9218 case 1:
9219 return a;
9220 case 2:
9221 z = __Pyx_c_prod_double(a, a);
9222 return __Pyx_c_prod_double(a, a);
9223 case 3:
9224 z = __Pyx_c_prod_double(a, a);
9225 return __Pyx_c_prod_double(z, a);
9226 case 4:
9227 z = __Pyx_c_prod_double(a, a);
9228 return __Pyx_c_prod_double(z, z);
9229 }
9230 }
9231 if (a.imag == 0) {
9232 if (a.real == 0) {
9233 return a;
9234 } else if (b.imag == 0) {
9235 z.real = pow(a.real, b.real);
9236 z.imag = 0;
9237 return z;
9238 } else if (a.real > 0) {
9239 r = a.real;
9240 theta = 0;
9241 } else {
9242 r = -a.real;
9243 theta = atan2(0.0, -1.0);
9244 }
9245 } else {
9246 r = __Pyx_c_abs_double(a);
9247 theta = atan2(a.imag, a.real);
9248 }
9249 lnr = log(r);
9250 z_r = exp(lnr * b.real - theta * b.imag);
9251 z_theta = theta * b.real + lnr * b.imag;
9252 z.real = z_r * cos(z_theta);
9253 z.imag = z_r * sin(z_theta);
9254 return z;
9255 }
9256 #endif
9257 #endif
9258
9259 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)9260 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
9261 const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
9262 const int is_unsigned = neg_one > const_zero;
9263 if (is_unsigned) {
9264 if (sizeof(enum NPY_TYPES) < sizeof(long)) {
9265 return PyInt_FromLong((long) value);
9266 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
9267 return PyLong_FromUnsignedLong((unsigned long) value);
9268 #ifdef HAVE_LONG_LONG
9269 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
9270 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9271 #endif
9272 }
9273 } else {
9274 if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
9275 return PyInt_FromLong((long) value);
9276 #ifdef HAVE_LONG_LONG
9277 } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
9278 return PyLong_FromLongLong((PY_LONG_LONG) value);
9279 #endif
9280 }
9281 }
9282 {
9283 int one = 1; int little = (int)*(unsigned char *)&one;
9284 unsigned char *bytes = (unsigned char *)&value;
9285 return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
9286 little, !is_unsigned);
9287 }
9288 }
9289
9290 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)9291 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
9292 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
9293 const int is_unsigned = neg_one > const_zero;
9294 #if PY_MAJOR_VERSION < 3
9295 if (likely(PyInt_Check(x))) {
9296 if (sizeof(int) < sizeof(long)) {
9297 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
9298 } else {
9299 long val = PyInt_AS_LONG(x);
9300 if (is_unsigned && unlikely(val < 0)) {
9301 goto raise_neg_overflow;
9302 }
9303 return (int) val;
9304 }
9305 } else
9306 #endif
9307 if (likely(PyLong_Check(x))) {
9308 if (is_unsigned) {
9309 #if CYTHON_USE_PYLONG_INTERNALS
9310 const digit* digits = ((PyLongObject*)x)->ob_digit;
9311 switch (Py_SIZE(x)) {
9312 case 0: return (int) 0;
9313 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
9314 case 2:
9315 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
9316 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9317 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9318 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
9319 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9320 }
9321 }
9322 break;
9323 case 3:
9324 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
9325 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9326 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9327 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
9328 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9329 }
9330 }
9331 break;
9332 case 4:
9333 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
9334 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9335 __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])))
9336 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
9337 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9338 }
9339 }
9340 break;
9341 }
9342 #endif
9343 #if CYTHON_COMPILING_IN_CPYTHON
9344 if (unlikely(Py_SIZE(x) < 0)) {
9345 goto raise_neg_overflow;
9346 }
9347 #else
9348 {
9349 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
9350 if (unlikely(result < 0))
9351 return (int) -1;
9352 if (unlikely(result == 1))
9353 goto raise_neg_overflow;
9354 }
9355 #endif
9356 if (sizeof(int) <= sizeof(unsigned long)) {
9357 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
9358 #ifdef HAVE_LONG_LONG
9359 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
9360 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9361 #endif
9362 }
9363 } else {
9364 #if CYTHON_USE_PYLONG_INTERNALS
9365 const digit* digits = ((PyLongObject*)x)->ob_digit;
9366 switch (Py_SIZE(x)) {
9367 case 0: return (int) 0;
9368 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
9369 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
9370 case -2:
9371 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
9372 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9373 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9374 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9375 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9376 }
9377 }
9378 break;
9379 case 2:
9380 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
9381 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9382 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9383 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9384 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9385 }
9386 }
9387 break;
9388 case -3:
9389 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9390 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9391 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9392 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9393 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9394 }
9395 }
9396 break;
9397 case 3:
9398 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
9399 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9400 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9401 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9402 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9403 }
9404 }
9405 break;
9406 case -4:
9407 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9408 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9409 __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])))
9410 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
9411 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9412 }
9413 }
9414 break;
9415 case 4:
9416 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
9417 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9418 __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])))
9419 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
9420 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9421 }
9422 }
9423 break;
9424 }
9425 #endif
9426 if (sizeof(int) <= sizeof(long)) {
9427 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
9428 #ifdef HAVE_LONG_LONG
9429 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
9430 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
9431 #endif
9432 }
9433 }
9434 {
9435 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9436 PyErr_SetString(PyExc_RuntimeError,
9437 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9438 #else
9439 int val;
9440 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9441 #if PY_MAJOR_VERSION < 3
9442 if (likely(v) && !PyLong_Check(v)) {
9443 PyObject *tmp = v;
9444 v = PyNumber_Long(tmp);
9445 Py_DECREF(tmp);
9446 }
9447 #endif
9448 if (likely(v)) {
9449 int one = 1; int is_little = (int)*(unsigned char *)&one;
9450 unsigned char *bytes = (unsigned char *)&val;
9451 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9452 bytes, sizeof(val),
9453 is_little, !is_unsigned);
9454 Py_DECREF(v);
9455 if (likely(!ret))
9456 return val;
9457 }
9458 #endif
9459 return (int) -1;
9460 }
9461 } else {
9462 int val;
9463 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9464 if (!tmp) return (int) -1;
9465 val = __Pyx_PyInt_As_int(tmp);
9466 Py_DECREF(tmp);
9467 return val;
9468 }
9469 raise_overflow:
9470 PyErr_SetString(PyExc_OverflowError,
9471 "value too large to convert to int");
9472 return (int) -1;
9473 raise_neg_overflow:
9474 PyErr_SetString(PyExc_OverflowError,
9475 "can't convert negative value to int");
9476 return (int) -1;
9477 }
9478
9479 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)9480 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
9481 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
9482 const int is_unsigned = neg_one > const_zero;
9483 #if PY_MAJOR_VERSION < 3
9484 if (likely(PyInt_Check(x))) {
9485 if (sizeof(long) < sizeof(long)) {
9486 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
9487 } else {
9488 long val = PyInt_AS_LONG(x);
9489 if (is_unsigned && unlikely(val < 0)) {
9490 goto raise_neg_overflow;
9491 }
9492 return (long) val;
9493 }
9494 } else
9495 #endif
9496 if (likely(PyLong_Check(x))) {
9497 if (is_unsigned) {
9498 #if CYTHON_USE_PYLONG_INTERNALS
9499 const digit* digits = ((PyLongObject*)x)->ob_digit;
9500 switch (Py_SIZE(x)) {
9501 case 0: return (long) 0;
9502 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
9503 case 2:
9504 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9505 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9506 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9507 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
9508 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9509 }
9510 }
9511 break;
9512 case 3:
9513 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9514 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9515 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9516 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
9517 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9518 }
9519 }
9520 break;
9521 case 4:
9522 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9523 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9524 __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])))
9525 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
9526 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9527 }
9528 }
9529 break;
9530 }
9531 #endif
9532 #if CYTHON_COMPILING_IN_CPYTHON
9533 if (unlikely(Py_SIZE(x) < 0)) {
9534 goto raise_neg_overflow;
9535 }
9536 #else
9537 {
9538 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
9539 if (unlikely(result < 0))
9540 return (long) -1;
9541 if (unlikely(result == 1))
9542 goto raise_neg_overflow;
9543 }
9544 #endif
9545 if (sizeof(long) <= sizeof(unsigned long)) {
9546 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
9547 #ifdef HAVE_LONG_LONG
9548 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
9549 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9550 #endif
9551 }
9552 } else {
9553 #if CYTHON_USE_PYLONG_INTERNALS
9554 const digit* digits = ((PyLongObject*)x)->ob_digit;
9555 switch (Py_SIZE(x)) {
9556 case 0: return (long) 0;
9557 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
9558 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
9559 case -2:
9560 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
9561 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9562 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9563 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9564 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9565 }
9566 }
9567 break;
9568 case 2:
9569 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9570 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9571 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9572 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9573 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9574 }
9575 }
9576 break;
9577 case -3:
9578 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9579 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9580 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9581 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9582 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9583 }
9584 }
9585 break;
9586 case 3:
9587 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9588 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9589 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9590 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9591 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9592 }
9593 }
9594 break;
9595 case -4:
9596 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9597 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9598 __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])))
9599 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9600 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9601 }
9602 }
9603 break;
9604 case 4:
9605 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9606 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9607 __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])))
9608 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9609 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9610 }
9611 }
9612 break;
9613 }
9614 #endif
9615 if (sizeof(long) <= sizeof(long)) {
9616 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
9617 #ifdef HAVE_LONG_LONG
9618 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
9619 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
9620 #endif
9621 }
9622 }
9623 {
9624 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9625 PyErr_SetString(PyExc_RuntimeError,
9626 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9627 #else
9628 long val;
9629 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9630 #if PY_MAJOR_VERSION < 3
9631 if (likely(v) && !PyLong_Check(v)) {
9632 PyObject *tmp = v;
9633 v = PyNumber_Long(tmp);
9634 Py_DECREF(tmp);
9635 }
9636 #endif
9637 if (likely(v)) {
9638 int one = 1; int is_little = (int)*(unsigned char *)&one;
9639 unsigned char *bytes = (unsigned char *)&val;
9640 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9641 bytes, sizeof(val),
9642 is_little, !is_unsigned);
9643 Py_DECREF(v);
9644 if (likely(!ret))
9645 return val;
9646 }
9647 #endif
9648 return (long) -1;
9649 }
9650 } else {
9651 long val;
9652 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9653 if (!tmp) return (long) -1;
9654 val = __Pyx_PyInt_As_long(tmp);
9655 Py_DECREF(tmp);
9656 return val;
9657 }
9658 raise_overflow:
9659 PyErr_SetString(PyExc_OverflowError,
9660 "value too large to convert to long");
9661 return (long) -1;
9662 raise_neg_overflow:
9663 PyErr_SetString(PyExc_OverflowError,
9664 "can't convert negative value to long");
9665 return (long) -1;
9666 }
9667
9668 /* FastTypeChecks */
9669 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)9670 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
9671 while (a) {
9672 a = a->tp_base;
9673 if (a == b)
9674 return 1;
9675 }
9676 return b == &PyBaseObject_Type;
9677 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)9678 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
9679 PyObject *mro;
9680 if (a == b) return 1;
9681 mro = a->tp_mro;
9682 if (likely(mro)) {
9683 Py_ssize_t i, n;
9684 n = PyTuple_GET_SIZE(mro);
9685 for (i = 0; i < n; i++) {
9686 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
9687 return 1;
9688 }
9689 return 0;
9690 }
9691 return __Pyx_InBases(a, b);
9692 }
9693 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9694 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
9695 PyObject *exception, *value, *tb;
9696 int res;
9697 __Pyx_PyThreadState_declare
9698 __Pyx_PyThreadState_assign
9699 __Pyx_ErrFetch(&exception, &value, &tb);
9700 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
9701 if (unlikely(res == -1)) {
9702 PyErr_WriteUnraisable(err);
9703 res = 0;
9704 }
9705 if (!res) {
9706 res = PyObject_IsSubclass(err, exc_type2);
9707 if (unlikely(res == -1)) {
9708 PyErr_WriteUnraisable(err);
9709 res = 0;
9710 }
9711 }
9712 __Pyx_ErrRestore(exception, value, tb);
9713 return res;
9714 }
9715 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9716 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
9717 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
9718 if (!res) {
9719 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
9720 }
9721 return res;
9722 }
9723 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)9724 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9725 Py_ssize_t i, n;
9726 assert(PyExceptionClass_Check(exc_type));
9727 n = PyTuple_GET_SIZE(tuple);
9728 #if PY_MAJOR_VERSION >= 3
9729 for (i=0; i<n; i++) {
9730 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
9731 }
9732 #endif
9733 for (i=0; i<n; i++) {
9734 PyObject *t = PyTuple_GET_ITEM(tuple, i);
9735 #if PY_MAJOR_VERSION < 3
9736 if (likely(exc_type == t)) return 1;
9737 #endif
9738 if (likely(PyExceptionClass_Check(t))) {
9739 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
9740 } else {
9741 }
9742 }
9743 return 0;
9744 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)9745 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
9746 if (likely(err == exc_type)) return 1;
9747 if (likely(PyExceptionClass_Check(err))) {
9748 if (likely(PyExceptionClass_Check(exc_type))) {
9749 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
9750 } else if (likely(PyTuple_Check(exc_type))) {
9751 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
9752 } else {
9753 }
9754 }
9755 return PyErr_GivenExceptionMatches(err, exc_type);
9756 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9757 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
9758 assert(PyExceptionClass_Check(exc_type1));
9759 assert(PyExceptionClass_Check(exc_type2));
9760 if (likely(err == exc_type1 || err == exc_type2)) return 1;
9761 if (likely(PyExceptionClass_Check(err))) {
9762 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
9763 }
9764 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
9765 }
9766 #endif
9767
9768 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)9769 static int __Pyx_check_binary_version(void) {
9770 char ctversion[4], rtversion[4];
9771 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
9772 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
9773 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
9774 char message[200];
9775 PyOS_snprintf(message, sizeof(message),
9776 "compiletime version %s of module '%.100s' "
9777 "does not match runtime version %s",
9778 ctversion, __Pyx_MODULE_NAME, rtversion);
9779 return PyErr_WarnEx(NULL, message, 1);
9780 }
9781 return 0;
9782 }
9783
9784 /* FunctionImport */
9785 #ifndef __PYX_HAVE_RT_ImportFunction
9786 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)9787 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
9788 PyObject *d = 0;
9789 PyObject *cobj = 0;
9790 union {
9791 void (*fp)(void);
9792 void *p;
9793 } tmp;
9794 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
9795 if (!d)
9796 goto bad;
9797 cobj = PyDict_GetItemString(d, funcname);
9798 if (!cobj) {
9799 PyErr_Format(PyExc_ImportError,
9800 "%.200s does not export expected C function %.200s",
9801 PyModule_GetName(module), funcname);
9802 goto bad;
9803 }
9804 #if PY_VERSION_HEX >= 0x02070000
9805 if (!PyCapsule_IsValid(cobj, sig)) {
9806 PyErr_Format(PyExc_TypeError,
9807 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
9808 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
9809 goto bad;
9810 }
9811 tmp.p = PyCapsule_GetPointer(cobj, sig);
9812 #else
9813 {const char *desc, *s1, *s2;
9814 desc = (const char *)PyCObject_GetDesc(cobj);
9815 if (!desc)
9816 goto bad;
9817 s1 = desc; s2 = sig;
9818 while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
9819 if (*s1 != *s2) {
9820 PyErr_Format(PyExc_TypeError,
9821 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
9822 PyModule_GetName(module), funcname, sig, desc);
9823 goto bad;
9824 }
9825 tmp.p = PyCObject_AsVoidPtr(cobj);}
9826 #endif
9827 *f = tmp.fp;
9828 if (!(*f))
9829 goto bad;
9830 Py_DECREF(d);
9831 return 0;
9832 bad:
9833 Py_XDECREF(d);
9834 return -1;
9835 }
9836 #endif
9837
9838 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)9839 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
9840 while (t->p) {
9841 #if PY_MAJOR_VERSION < 3
9842 if (t->is_unicode) {
9843 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
9844 } else if (t->intern) {
9845 *t->p = PyString_InternFromString(t->s);
9846 } else {
9847 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
9848 }
9849 #else
9850 if (t->is_unicode | t->is_str) {
9851 if (t->intern) {
9852 *t->p = PyUnicode_InternFromString(t->s);
9853 } else if (t->encoding) {
9854 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
9855 } else {
9856 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
9857 }
9858 } else {
9859 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
9860 }
9861 #endif
9862 if (!*t->p)
9863 return -1;
9864 if (PyObject_Hash(*t->p) == -1)
9865 return -1;
9866 ++t;
9867 }
9868 return 0;
9869 }
9870
__Pyx_PyUnicode_FromString(const char * c_str)9871 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
9872 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
9873 }
__Pyx_PyObject_AsString(PyObject * o)9874 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
9875 Py_ssize_t ignore;
9876 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
9877 }
9878 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9879 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)9880 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9881 char* defenc_c;
9882 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
9883 if (!defenc) return NULL;
9884 defenc_c = PyBytes_AS_STRING(defenc);
9885 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9886 {
9887 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
9888 char* c;
9889 for (c = defenc_c; c < end; c++) {
9890 if ((unsigned char) (*c) >= 128) {
9891 PyUnicode_AsASCIIString(o);
9892 return NULL;
9893 }
9894 }
9895 }
9896 #endif
9897 *length = PyBytes_GET_SIZE(defenc);
9898 return defenc_c;
9899 }
9900 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)9901 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9902 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
9903 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9904 if (likely(PyUnicode_IS_ASCII(o))) {
9905 *length = PyUnicode_GET_LENGTH(o);
9906 return PyUnicode_AsUTF8(o);
9907 } else {
9908 PyUnicode_AsASCIIString(o);
9909 return NULL;
9910 }
9911 #else
9912 return PyUnicode_AsUTF8AndSize(o, length);
9913 #endif
9914 }
9915 #endif
9916 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)9917 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9918 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9919 if (
9920 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9921 __Pyx_sys_getdefaultencoding_not_ascii &&
9922 #endif
9923 PyUnicode_Check(o)) {
9924 return __Pyx_PyUnicode_AsStringAndSize(o, length);
9925 } else
9926 #endif
9927 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
9928 if (PyByteArray_Check(o)) {
9929 *length = PyByteArray_GET_SIZE(o);
9930 return PyByteArray_AS_STRING(o);
9931 } else
9932 #endif
9933 {
9934 char* result;
9935 int r = PyBytes_AsStringAndSize(o, &result, length);
9936 if (unlikely(r < 0)) {
9937 return NULL;
9938 } else {
9939 return result;
9940 }
9941 }
9942 }
__Pyx_PyObject_IsTrue(PyObject * x)9943 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
9944 int is_true = x == Py_True;
9945 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
9946 else return PyObject_IsTrue(x);
9947 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)9948 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
9949 int retval;
9950 if (unlikely(!x)) return -1;
9951 retval = __Pyx_PyObject_IsTrue(x);
9952 Py_DECREF(x);
9953 return retval;
9954 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)9955 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
9956 #if PY_MAJOR_VERSION >= 3
9957 if (PyLong_Check(result)) {
9958 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
9959 "__int__ returned non-int (type %.200s). "
9960 "The ability to return an instance of a strict subclass of int "
9961 "is deprecated, and may be removed in a future version of Python.",
9962 Py_TYPE(result)->tp_name)) {
9963 Py_DECREF(result);
9964 return NULL;
9965 }
9966 return result;
9967 }
9968 #endif
9969 PyErr_Format(PyExc_TypeError,
9970 "__%.4s__ returned non-%.4s (type %.200s)",
9971 type_name, type_name, Py_TYPE(result)->tp_name);
9972 Py_DECREF(result);
9973 return NULL;
9974 }
__Pyx_PyNumber_IntOrLong(PyObject * x)9975 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
9976 #if CYTHON_USE_TYPE_SLOTS
9977 PyNumberMethods *m;
9978 #endif
9979 const char *name = NULL;
9980 PyObject *res = NULL;
9981 #if PY_MAJOR_VERSION < 3
9982 if (likely(PyInt_Check(x) || PyLong_Check(x)))
9983 #else
9984 if (likely(PyLong_Check(x)))
9985 #endif
9986 return __Pyx_NewRef(x);
9987 #if CYTHON_USE_TYPE_SLOTS
9988 m = Py_TYPE(x)->tp_as_number;
9989 #if PY_MAJOR_VERSION < 3
9990 if (m && m->nb_int) {
9991 name = "int";
9992 res = m->nb_int(x);
9993 }
9994 else if (m && m->nb_long) {
9995 name = "long";
9996 res = m->nb_long(x);
9997 }
9998 #else
9999 if (likely(m && m->nb_int)) {
10000 name = "int";
10001 res = m->nb_int(x);
10002 }
10003 #endif
10004 #else
10005 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
10006 res = PyNumber_Int(x);
10007 }
10008 #endif
10009 if (likely(res)) {
10010 #if PY_MAJOR_VERSION < 3
10011 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
10012 #else
10013 if (unlikely(!PyLong_CheckExact(res))) {
10014 #endif
10015 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
10016 }
10017 }
10018 else if (!PyErr_Occurred()) {
10019 PyErr_SetString(PyExc_TypeError,
10020 "an integer is required");
10021 }
10022 return res;
10023 }
10024 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
10025 Py_ssize_t ival;
10026 PyObject *x;
10027 #if PY_MAJOR_VERSION < 3
10028 if (likely(PyInt_CheckExact(b))) {
10029 if (sizeof(Py_ssize_t) >= sizeof(long))
10030 return PyInt_AS_LONG(b);
10031 else
10032 return PyInt_AsSsize_t(b);
10033 }
10034 #endif
10035 if (likely(PyLong_CheckExact(b))) {
10036 #if CYTHON_USE_PYLONG_INTERNALS
10037 const digit* digits = ((PyLongObject*)b)->ob_digit;
10038 const Py_ssize_t size = Py_SIZE(b);
10039 if (likely(__Pyx_sst_abs(size) <= 1)) {
10040 ival = likely(size) ? digits[0] : 0;
10041 if (size == -1) ival = -ival;
10042 return ival;
10043 } else {
10044 switch (size) {
10045 case 2:
10046 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
10047 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10048 }
10049 break;
10050 case -2:
10051 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
10052 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10053 }
10054 break;
10055 case 3:
10056 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
10057 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10058 }
10059 break;
10060 case -3:
10061 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
10062 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10063 }
10064 break;
10065 case 4:
10066 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
10067 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]));
10068 }
10069 break;
10070 case -4:
10071 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
10072 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]));
10073 }
10074 break;
10075 }
10076 }
10077 #endif
10078 return PyLong_AsSsize_t(b);
10079 }
10080 x = PyNumber_Index(b);
10081 if (!x) return -1;
10082 ival = PyInt_AsSsize_t(x);
10083 Py_DECREF(x);
10084 return ival;
10085 }
10086 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
10087 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
10088 }
10089 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
10090 return PyInt_FromSize_t(ival);
10091 }
10092
10093
10094 #endif /* Py_PYTHON_H */
10095