3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
306 #ifndef CYTHON_INLINE
307 #if defined(__clang__)
308 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309 #elif defined(__GNUC__)
310 #define CYTHON_INLINE __inline__
311 #elif defined(_MSC_VER)
312 #define CYTHON_INLINE __inline
313 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314 #define CYTHON_INLINE inline
316 #define CYTHON_INLINE
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321 #define Py_OptimizeFlag 0
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329 #define __Pyx_DefaultClassType PyClass_Type
331 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
335 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
336 PyObject *fv, PyObject *cell, PyObject* fn,
337 PyObject *name,
int fline, PyObject *lnos) {
338 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340 const char *fn_cstr=NULL;
341 const char *name_cstr=NULL;
342 PyCodeObject* co=NULL;
343 PyObject *type, *value, *traceback;
344 PyErr_Fetch(&type, &value, &traceback);
345 if (!(kwds=PyDict_New()))
goto end;
346 if (!(argcount=PyLong_FromLong(a)))
goto end;
347 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
348 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
349 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
350 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
351 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
352 if (!(nlocals=PyLong_FromLong(l)))
goto end;
353 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
354 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
355 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
356 if (!(flags=PyLong_FromLong(
f)))
goto end;
357 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
358 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
359 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
360 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
361 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
362 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
363 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
364 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
365 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
366 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
367 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
368 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
369 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
370 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
371 Py_XDECREF((PyObject*)co);
372 co = (PyCodeObject*)call_result;
376 Py_XDECREF((PyObject*)co);
381 Py_XDECREF(argcount);
382 Py_XDECREF(posonlyargcount);
383 Py_XDECREF(kwonlyargcount);
385 Py_XDECREF(stacksize);
387 Py_XDECREF(call_result);
390 PyErr_Restore(type, value, traceback);
395 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
398 #define __Pyx_DefaultClassType PyType_Type
400 #ifndef Py_TPFLAGS_CHECKTYPES
401 #define Py_TPFLAGS_CHECKTYPES 0
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404 #define Py_TPFLAGS_HAVE_INDEX 0
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410 #define Py_TPFLAGS_HAVE_FINALIZE 0
412 #ifndef METH_STACKLESS
413 #define METH_STACKLESS 0
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416 #ifndef METH_FASTCALL
417 #define METH_FASTCALL 0x80
419 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
420 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
421 Py_ssize_t nargs, PyObject *kwnames);
423 #define __Pyx_PyCFunctionFast _PyCFunctionFast
424 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
430 #define __Pyx_PyFastCFunction_Check(func) 0
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433 #define PyObject_Malloc(s) PyMem_Malloc(s)
434 #define PyObject_Free(p) PyMem_Free(p)
435 #define PyObject_Realloc(p) PyMem_Realloc(p)
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440 #define PyMem_RawFree(p) PyMem_Free(p)
442 #if CYTHON_COMPILING_IN_PYSTON
443 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
446 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450 #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454 #define __Pyx_PyThreadState_Current PyThreadState_GET()
456 #define __Pyx_PyThreadState_Current _PyThreadState_Current
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
463 *key = PyThread_create_key();
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
467 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
468 *key = Py_tss_NEEDS_INIT;
471 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
474 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
475 return *key != Py_tss_NEEDS_INIT;
477 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
478 PyThread_delete_key(*key);
479 *key = Py_tss_NEEDS_INIT;
481 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
482 return PyThread_set_key_value(*key, value);
484 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
485 return PyThread_get_key_value(*key);
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
497 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506 #define CYTHON_PEP393_ENABLED 1
507 #if defined(PyUnicode_IS_READY)
508 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509 0 : _PyUnicode_Ready((PyObject *)(op)))
511 #define __Pyx_PyUnicode_READY(op) (0)
513 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
527 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
530 #define CYTHON_PEP393_ENABLED 0
531 #define PyUnicode_1BYTE_KIND 1
532 #define PyUnicode_2BYTE_KIND 2
533 #define PyUnicode_4BYTE_KIND 4
534 #define __Pyx_PyUnicode_READY(op) (0)
535 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
544 #if CYTHON_COMPILING_IN_PYPY
545 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
548 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
561 #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))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
566 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569 #define PyObject_ASCII(o) PyObject_Repr(o)
571 #if PY_MAJOR_VERSION >= 3
572 #define PyBaseString_Type PyUnicode_Type
573 #define PyStringObject PyUnicodeObject
574 #define PyString_Type PyUnicode_Type
575 #define PyString_Check PyUnicode_Check
576 #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578 #define PyObject_Unicode PyObject_Str
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
585 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
588 #ifndef PySet_CheckExact
589 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
591 #if PY_VERSION_HEX >= 0x030900A4
592 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
595 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
598 #if CYTHON_ASSUME_SAFE_MACROS
599 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
601 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
603 #if PY_MAJOR_VERSION >= 3
604 #define PyIntObject PyLongObject
605 #define PyInt_Type PyLong_Type
606 #define PyInt_Check(op) PyLong_Check(op)
607 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608 #define PyInt_FromString PyLong_FromString
609 #define PyInt_FromUnicode PyLong_FromUnicode
610 #define PyInt_FromLong PyLong_FromLong
611 #define PyInt_FromSize_t PyLong_FromSize_t
612 #define PyInt_FromSsize_t PyLong_FromSsize_t
613 #define PyInt_AsLong PyLong_AsLong
614 #define PyInt_AS_LONG PyLong_AS_LONG
615 #define PyInt_AsSsize_t PyLong_AsSsize_t
616 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618 #define PyNumber_Int PyNumber_Long
620 #if PY_MAJOR_VERSION >= 3
621 #define PyBoolObject PyLongObject
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624 #ifndef PyUnicode_InternFromString
625 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
628 #if PY_VERSION_HEX < 0x030200A4
629 typedef long Py_hash_t;
630 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
633 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
636 #if PY_MAJOR_VERSION >= 3
637 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
639 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
641 #if CYTHON_USE_ASYNC_SLOTS
642 #if PY_VERSION_HEX >= 0x030500B1
643 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
646 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
649 #define __Pyx_PyType_AsAsync(obj) NULL
651 #ifndef __Pyx_PyAsyncMethodsStruct
656 } __Pyx_PyAsyncMethodsStruct;
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660 #if !defined(_USE_MATH_DEFINES)
661 #define _USE_MATH_DEFINES
666 #define __PYX_NAN() ((float) NAN)
668 static CYTHON_INLINE
float __PYX_NAN() {
670 memset(&value, 0xFF,
sizeof(value));
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
677 #define __Pyx_truncl truncl
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
685 #ifndef __PYX_EXTERN_C
687 #define __PYX_EXTERN_C extern "C"
689 #define __PYX_EXTERN_C extern
693 #define __PYX_HAVE__superluWrappers
694 #define __PYX_HAVE_API__superluWrappers
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
708 #include "pythread.h"
714 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
715 #define CYTHON_WITHOUT_ASSERTIONS
718 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
719 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
721 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
722 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
723 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
724 #define __PYX_DEFAULT_STRING_ENCODING ""
725 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
726 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
727 #define __Pyx_uchar_cast(c) ((unsigned char)c)
728 #define __Pyx_long_cast(x) ((long)x)
729 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
730 (sizeof(type) < sizeof(Py_ssize_t)) ||\
731 (sizeof(type) > sizeof(Py_ssize_t) &&\
732 likely(v < (type)PY_SSIZE_T_MAX ||\
733 v == (type)PY_SSIZE_T_MAX) &&\
734 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
735 v == (type)PY_SSIZE_T_MIN))) ||\
736 (sizeof(type) == sizeof(Py_ssize_t) &&\
737 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
738 v == (type)PY_SSIZE_T_MAX))) )
739 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
740 return (
size_t) i < (size_t) limit;
742 #if defined (__cplusplus) && __cplusplus >= 201103L
744 #define __Pyx_sst_abs(value) std::abs(value)
745 #elif SIZEOF_INT >= SIZEOF_SIZE_T
746 #define __Pyx_sst_abs(value) abs(value)
747 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
748 #define __Pyx_sst_abs(value) labs(value)
749 #elif defined (_MSC_VER)
750 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
751 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
752 #define __Pyx_sst_abs(value) llabs(value)
753 #elif defined (__GNUC__)
754 #define __Pyx_sst_abs(value) __builtin_llabs(value)
756 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
758 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
759 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
760 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
761 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
762 #define __Pyx_PyBytes_FromString PyBytes_FromString
763 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
764 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
765 #if PY_MAJOR_VERSION < 3
766 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
767 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
769 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
770 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
772 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
773 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
776 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
777 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
778 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
779 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
781 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
782 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
783 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
784 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
785 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
786 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
787 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
788 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
789 const Py_UNICODE *u_end =
u;
791 return (
size_t)(u_end -
u - 1);
793 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
794 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
795 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
796 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
797 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
798 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
799 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
800 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
801 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
802 #define __Pyx_PySequence_Tuple(obj)\
803 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
804 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
805 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
806 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
807 #if CYTHON_ASSUME_SAFE_MACROS
808 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
810 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
812 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
813 #if PY_MAJOR_VERSION >= 3
814 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
816 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
818 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
819 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
820 static int __Pyx_sys_getdefaultencoding_not_ascii;
821 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
823 PyObject* default_encoding = NULL;
824 PyObject* ascii_chars_u = NULL;
825 PyObject* ascii_chars_b = NULL;
826 const char* default_encoding_c;
827 sys = PyImport_ImportModule(
"sys");
829 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
831 if (!default_encoding)
goto bad;
832 default_encoding_c = PyBytes_AsString(default_encoding);
833 if (!default_encoding_c)
goto bad;
834 if (strcmp(default_encoding_c,
"ascii") == 0) {
835 __Pyx_sys_getdefaultencoding_not_ascii = 0;
837 char ascii_chars[128];
839 for (
c = 0;
c < 128;
c++) {
842 __Pyx_sys_getdefaultencoding_not_ascii = 1;
843 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
844 if (!ascii_chars_u)
goto bad;
845 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
846 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
849 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
853 Py_DECREF(ascii_chars_u);
854 Py_DECREF(ascii_chars_b);
856 Py_DECREF(default_encoding);
859 Py_XDECREF(default_encoding);
860 Py_XDECREF(ascii_chars_u);
861 Py_XDECREF(ascii_chars_b);
865 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
866 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
868 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
869 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
870 static char* __PYX_DEFAULT_STRING_ENCODING;
871 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
873 PyObject* default_encoding = NULL;
874 char* default_encoding_c;
875 sys = PyImport_ImportModule(
"sys");
877 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
879 if (!default_encoding)
goto bad;
880 default_encoding_c = PyBytes_AsString(default_encoding);
881 if (!default_encoding_c)
goto bad;
882 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
883 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
884 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
885 Py_DECREF(default_encoding);
888 Py_XDECREF(default_encoding);
896 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
897 #define likely(x) __builtin_expect(!!(x), 1)
898 #define unlikely(x) __builtin_expect(!!(x), 0)
900 #define likely(x) (x)
901 #define unlikely(x) (x)
903 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
905 static PyObject *__pyx_m = NULL;
906 static PyObject *__pyx_d;
907 static PyObject *__pyx_b;
908 static PyObject *__pyx_cython_runtime = NULL;
909 static PyObject *__pyx_empty_tuple;
910 static PyObject *__pyx_empty_bytes;
911 static PyObject *__pyx_empty_unicode;
912 static int __pyx_lineno;
913 static int __pyx_clineno = 0;
914 static const char * __pyx_cfilenm= __FILE__;
915 static const char *__pyx_filename;
918 #if !defined(CYTHON_CCOMPLEX)
919 #if defined(__cplusplus)
920 #define CYTHON_CCOMPLEX 1
921 #elif defined(_Complex_I)
922 #define CYTHON_CCOMPLEX 1
924 #define CYTHON_CCOMPLEX 0
934 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
936 #define _Complex_I 1.0fj
940 static const char *__pyx_f[] = {
941 "proteus/superluWrappers.pyx",
947 struct __pyx_memoryview_obj;
949 struct __pyx_memoryview_obj *memview;
952 Py_ssize_t strides[8];
953 Py_ssize_t suboffsets[8];
954 } __Pyx_memviewslice;
955 #define __Pyx_MemoryView_Len(m) (m.shape[0])
958 #include <pythread.h>
959 #ifndef CYTHON_ATOMICS
960 #define CYTHON_ATOMICS 1
962 #define __pyx_atomic_int_type int
963 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
964 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
966 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
967 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
968 #ifdef __PYX_DEBUG_ATOMICS
969 #warning "Using GNU atomics"
971 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
973 #undef __pyx_atomic_int_type
974 #define __pyx_atomic_int_type LONG
975 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
976 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
977 #ifdef __PYX_DEBUG_ATOMICS
978 #pragma message ("Using MSVC atomics")
980 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
981 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
982 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
983 #ifdef __PYX_DEBUG_ATOMICS
984 #warning "Using Intel atomics"
987 #undef CYTHON_ATOMICS
988 #define CYTHON_ATOMICS 0
989 #ifdef __PYX_DEBUG_ATOMICS
990 #warning "Not using atomics"
993 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
995 #define __pyx_add_acquisition_count(memview)\
996 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
997 #define __pyx_sub_acquisition_count(memview)\
998 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1000 #define __pyx_add_acquisition_count(memview)\
1001 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1002 #define __pyx_sub_acquisition_count(memview)\
1003 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1007 #ifndef __PYX_FORCE_INIT_THREADS
1008 #define __PYX_FORCE_INIT_THREADS 0
1012 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1013 #define __Pyx_PyGILState_Release PyGILState_Release
1014 #define __Pyx_FastGIL_Remember()
1015 #define __Pyx_FastGIL_Forget()
1016 #define __Pyx_FastGilFuncInit()
1019 #define IS_UNSIGNED(type) (((type) -1) > 0)
1020 struct __Pyx_StructField_;
1021 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1024 struct __Pyx_StructField_* fields;
1026 size_t arraysize[8];
1032 typedef struct __Pyx_StructField_ {
1033 __Pyx_TypeInfo* type;
1036 } __Pyx_StructField;
1038 __Pyx_StructField* field;
1039 size_t parent_offset;
1040 } __Pyx_BufFmt_StackElem;
1042 __Pyx_StructField root;
1043 __Pyx_BufFmt_StackElem* head;
1045 size_t new_count, enc_count;
1046 size_t struct_alignment;
1051 char is_valid_array;
1052 } __Pyx_BufFmt_Context;
1062 typedef npy_int8 __pyx_t_5numpy_int8_t;
1071 typedef npy_int16 __pyx_t_5numpy_int16_t;
1080 typedef npy_int32 __pyx_t_5numpy_int32_t;
1089 typedef npy_int64 __pyx_t_5numpy_int64_t;
1098 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1107 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1116 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1125 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1134 typedef npy_float32 __pyx_t_5numpy_float32_t;
1143 typedef npy_float64 __pyx_t_5numpy_float64_t;
1152 typedef npy_long __pyx_t_5numpy_int_t;
1161 typedef npy_longlong __pyx_t_5numpy_long_t;
1170 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1179 typedef npy_ulong __pyx_t_5numpy_uint_t;
1188 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1197 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1206 typedef npy_intp __pyx_t_5numpy_intp_t;
1215 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1224 typedef npy_double __pyx_t_5numpy_float_t;
1233 typedef npy_double __pyx_t_5numpy_double_t;
1242 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1246 typedef ::std::complex< float > __pyx_t_float_complex;
1248 typedef float _Complex __pyx_t_float_complex;
1251 typedef struct {
float real, imag; } __pyx_t_float_complex;
1253 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1258 typedef ::std::complex< double > __pyx_t_double_complex;
1260 typedef double _Complex __pyx_t_double_complex;
1263 typedef struct {
double real, imag; } __pyx_t_double_complex;
1265 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1269 struct __pyx_obj_15superluWrappers_cSparseMatrix;
1270 struct __pyx_obj_15superluWrappers_SparseFactor;
1271 struct __pyx_array_obj;
1272 struct __pyx_MemviewEnum_obj;
1273 struct __pyx_memoryview_obj;
1274 struct __pyx_memoryviewslice_obj;
1283 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1292 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1301 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1310 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1311 struct __pyx_t_15superluWrappers__NRformat;
1312 struct __pyx_t_15superluWrappers__NCformat;
1313 struct __pyx_t_15superluWrappers__DNformat;
1314 struct __pyx_t_15superluWrappers__NCPformat;
1323 struct __pyx_t_15superluWrappers__NRformat {
1324 __pyx_t_5numpy_int32_t
nnz;
1325 __pyx_t_5numpy_float64_t *nzval;
1326 __pyx_t_5numpy_int32_t *colind;
1327 __pyx_t_5numpy_int32_t *rowptr;
1337 struct __pyx_t_15superluWrappers__NCformat {
1338 __pyx_t_5numpy_int32_t
nnz;
1339 __pyx_t_5numpy_float64_t *nzval;
1340 __pyx_t_5numpy_int32_t *rowind;
1341 __pyx_t_5numpy_int32_t *colptr;
1351 struct __pyx_t_15superluWrappers__DNformat {
1352 __pyx_t_5numpy_int32_t lda;
1363 struct __pyx_t_15superluWrappers__NCPformat {
1364 __pyx_t_5numpy_int32_t
nnz;
1366 __pyx_t_5numpy_int32_t *rowind;
1367 __pyx_t_5numpy_int32_t *colbeg;
1368 __pyx_t_5numpy_int32_t *colend;
1378 struct __pyx_obj_15superluWrappers_cSparseMatrix {
1380 __pyx_t_5numpy_int32_t dim[2];
1381 struct __pyx_t_15superluWrappers__NRformat A;
1392 struct __pyx_obj_15superluWrappers_SparseFactor {
1394 struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
1395 superlu_options_t options;
1403 struct __pyx_t_15superluWrappers__NCformat storeA;
1404 struct __pyx_t_15superluWrappers__DNformat storeX;
1408 unsigned int use_same_perm_c;
1409 unsigned int use_same_sparsity;
1421 struct __pyx_array_obj {
1423 struct __pyx_vtabstruct_array *__pyx_vtab;
1429 Py_ssize_t *_strides;
1430 Py_ssize_t itemsize;
1433 void (*callback_free_data)(
void *);
1435 int dtype_is_object;
1446 struct __pyx_MemviewEnum_obj {
1459 struct __pyx_memoryview_obj {
1461 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1464 PyObject *_array_interface;
1465 PyThread_type_lock lock;
1466 __pyx_atomic_int acquisition_count[2];
1467 __pyx_atomic_int *acquisition_count_aligned_p;
1470 int dtype_is_object;
1471 __Pyx_TypeInfo *typeinfo;
1482 struct __pyx_memoryviewslice_obj {
1483 struct __pyx_memoryview_obj __pyx_base;
1484 __Pyx_memviewslice from_slice;
1485 PyObject *from_object;
1486 PyObject *(*to_object_func)(
char *);
1487 int (*to_dtype_func)(
char *, PyObject *);
1500 struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
1501 PyObject *(*_set_mat_types)(
struct __pyx_obj_15superluWrappers_SparseFactor *);
1503 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
1514 struct __pyx_vtabstruct_array {
1515 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1517 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1528 struct __pyx_vtabstruct_memoryview {
1529 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1530 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1531 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1532 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1533 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1534 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1535 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1537 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1548 struct __pyx_vtabstruct__memoryviewslice {
1549 struct __pyx_vtabstruct_memoryview __pyx_base;
1551 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1555 #ifndef CYTHON_REFNANNY
1556 #define CYTHON_REFNANNY 0
1560 void (*INCREF)(
void*, PyObject*, int);
1561 void (*DECREF)(
void*, PyObject*, int);
1562 void (*GOTREF)(
void*, PyObject*, int);
1563 void (*GIVEREF)(
void*, PyObject*, int);
1564 void* (*SetupContext)(
const char*, int,
const char*);
1565 void (*FinishContext)(
void**);
1566 } __Pyx_RefNannyAPIStruct;
1567 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1568 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1569 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1571 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1573 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1574 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1575 PyGILState_Release(__pyx_gilstate_save);\
1577 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1580 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1581 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1583 #define __Pyx_RefNannyFinishContext()\
1584 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1585 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1586 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1587 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1588 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1589 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1590 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1591 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1592 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1594 #define __Pyx_RefNannyDeclarations
1595 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1596 #define __Pyx_RefNannyFinishContext()
1597 #define __Pyx_INCREF(r) Py_INCREF(r)
1598 #define __Pyx_DECREF(r) Py_DECREF(r)
1599 #define __Pyx_GOTREF(r)
1600 #define __Pyx_GIVEREF(r)
1601 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1602 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1603 #define __Pyx_XGOTREF(r)
1604 #define __Pyx_XGIVEREF(r)
1606 #define __Pyx_XDECREF_SET(r, v) do {\
1607 PyObject *tmp = (PyObject *) r;\
1608 r = v; __Pyx_XDECREF(tmp);\
1610 #define __Pyx_DECREF_SET(r, v) do {\
1611 PyObject *tmp = (PyObject *) r;\
1612 r = v; __Pyx_DECREF(tmp);\
1614 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1615 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1618 #if CYTHON_USE_TYPE_SLOTS
1619 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1621 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1625 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1628 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1629 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1632 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1635 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1636 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1637 const char* function_name);
1640 #if CYTHON_USE_TYPE_SLOTS
1641 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1642 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1644 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1645 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1649 #if CYTHON_COMPILING_IN_CPYTHON
1650 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1652 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1656 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1659 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1660 #define __Pyx_MEMVIEW_DIRECT 1
1661 #define __Pyx_MEMVIEW_PTR 2
1662 #define __Pyx_MEMVIEW_FULL 4
1663 #define __Pyx_MEMVIEW_CONTIG 8
1664 #define __Pyx_MEMVIEW_STRIDED 16
1665 #define __Pyx_MEMVIEW_FOLLOW 32
1666 #define __Pyx_IS_C_CONTIG 1
1667 #define __Pyx_IS_F_CONTIG 2
1668 static int __Pyx_init_memviewslice(
1669 struct __pyx_memoryview_obj *memview,
1671 __Pyx_memviewslice *memviewslice,
1672 int memview_is_new_reference);
1673 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1674 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1675 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1676 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1677 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1678 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1679 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1680 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1681 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1682 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1685 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1686 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1688 PyTypeObject *tp = Py_TYPE(obj);
1689 #if PY_MAJOR_VERSION < 3
1690 if (unlikely(PyInstance_Check(obj)))
1691 return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1693 res = _PyType_Lookup(tp, attr_name);
1695 descrgetfunc
f = Py_TYPE(res)->tp_descr_get;
1699 res =
f(res, obj, (PyObject *)tp);
1702 PyErr_SetObject(PyExc_AttributeError, attr_name);
1707 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1711 #if CYTHON_FAST_PYCALL
1712 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1713 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1714 #if 1 || PY_VERSION_HEX < 0x030600B1
1715 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1717 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1719 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1720 (sizeof(char [1 - 2*!(cond)]) - 1)
1721 #ifndef Py_MEMBER_SIZE
1722 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1724 #if CYTHON_FAST_PYCALL
1725 static size_t __pyx_pyframe_localsplus_offset = 0;
1726 #include "frameobject.h"
1727 #if PY_VERSION_HEX >= 0x030b00a6
1728 #ifndef Py_BUILD_CORE
1729 #define Py_BUILD_CORE 1
1731 #include "internal/pycore_frame.h"
1733 #define __Pxy_PyFrame_Initialize_Offsets()\
1734 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1735 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1736 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1737 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1738 #endif // CYTHON_FAST_PYCALL
1742 #if CYTHON_COMPILING_IN_CPYTHON
1743 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1747 #if CYTHON_COMPILING_IN_CPYTHON
1748 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1750 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1754 #if CYTHON_FAST_PYCCALL
1755 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1757 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1761 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1764 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1765 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1766 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1767 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1768 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1769 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1770 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1771 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1772 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1773 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1774 int wraparound,
int boundscheck);
1775 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1776 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1777 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1778 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1779 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1780 int wraparound,
int boundscheck);
1781 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1782 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1783 int is_list,
int wraparound,
int boundscheck);
1786 #if CYTHON_USE_TYPE_SLOTS
1787 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1789 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1793 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1796 #if !CYTHON_COMPILING_IN_PYPY
1797 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1799 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1800 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1804 #if CYTHON_USE_EXC_INFO_STACK
1805 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1809 #if CYTHON_FAST_THREAD_STATE
1810 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1811 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1812 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1814 #define __Pyx_PyThreadState_declare
1815 #define __Pyx_PyThreadState_assign
1816 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1820 #if CYTHON_FAST_THREAD_STATE
1821 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1822 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1823 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1824 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1826 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1827 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1831 #if CYTHON_FAST_THREAD_STATE
1832 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1833 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1835 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1839 #if CYTHON_FAST_THREAD_STATE
1840 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1841 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1842 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1843 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1844 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1845 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1846 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1847 #if CYTHON_COMPILING_IN_CPYTHON
1848 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1850 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1853 #define __Pyx_PyErr_Clear() PyErr_Clear()
1854 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1855 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1856 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1857 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1858 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1859 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1860 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1864 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1865 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1866 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1867 int has_cstart,
int has_cstop,
int wraparound);
1870 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1873 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1874 int lineno,
const char *filename,
1875 int full_traceback,
int nogil);
1878 #if CYTHON_FAST_THREAD_STATE
1879 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1880 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1882 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1886 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1887 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1888 __Pyx__ArgTypeTest(obj, type, name, exact))
1889 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1895 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1898 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1901 #if PY_MAJOR_VERSION >= 3
1902 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1904 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1908 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1911 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1912 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1914 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1915 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1917 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1920 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1922 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1924 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1926 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1928 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1930 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1934 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1935 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1936 const char* encoding,
const char* errors,
1937 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1940 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1943 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1944 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1945 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1946 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1947 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1948 (cache_var) = (value);
1949 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1950 static PY_UINT64_T __pyx_dict_version = 0;\
1951 static PyObject *__pyx_dict_cached_value = NULL;\
1952 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1953 (VAR) = __pyx_dict_cached_value;\
1955 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1956 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1959 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1960 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1961 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1963 #define __PYX_GET_DICT_VERSION(dict) (0)
1964 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1965 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1969 #if CYTHON_USE_DICT_VERSIONS
1970 #define __Pyx_GetModuleGlobalName(var, name) {\
1971 static PY_UINT64_T __pyx_dict_version = 0;\
1972 static PyObject *__pyx_dict_cached_value = NULL;\
1973 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1974 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1975 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1977 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1978 PY_UINT64_T __pyx_dict_version;\
1979 PyObject *__pyx_dict_cached_value;\
1980 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1982 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1984 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1985 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1986 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1990 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1993 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1996 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1999 #if CYTHON_FAST_THREAD_STATE
2000 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2001 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2003 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2007 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2010 #if CYTHON_COMPILING_IN_CPYTHON
2011 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2012 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2013 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2014 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2016 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2017 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2018 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2020 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2022 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2024 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2025 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2026 PyListObject*
L = (PyListObject*) list;
2027 Py_ssize_t len = Py_SIZE(list);
2028 if (likely(
L->allocated > len)) {
2030 PyList_SET_ITEM(list, len, x);
2031 __Pyx_SET_SIZE(list, len + 1);
2034 return PyList_Append(list, x);
2037 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2041 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2042 #if CYTHON_COMPILING_IN_CPYTHON
2043 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2044 if (unlikely(!none))
2049 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2054 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2055 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2056 PyListObject*
L = (PyListObject*) list;
2057 Py_ssize_t len = Py_SIZE(list);
2058 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2060 PyList_SET_ITEM(list, len, x);
2061 __Pyx_SET_SIZE(list, len + 1);
2064 return PyList_Append(list, x);
2067 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2071 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2074 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2077 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2078 int result = PySequence_Contains(seq, item);
2079 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2083 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2086 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2089 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2090 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2092 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2096 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2097 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2099 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2103 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2106 static int __Pyx_setup_reduce(PyObject* type_obj);
2109 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2112 #ifndef __PYX_HAVE_RT_ImportType_proto
2113 #define __PYX_HAVE_RT_ImportType_proto
2114 enum __Pyx_ImportType_CheckSize {
2115 __Pyx_ImportType_CheckSize_Error = 0,
2116 __Pyx_ImportType_CheckSize_Warn = 1,
2117 __Pyx_ImportType_CheckSize_Ignore = 2
2119 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2123 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2126 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2129 #define __Pyx_CyFunction_USED 1
2130 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2131 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2132 #define __Pyx_CYFUNCTION_CCLASS 0x04
2133 #define __Pyx_CyFunction_GetClosure(f)\
2134 (((__pyx_CyFunctionObject *) (f))->func_closure)
2135 #define __Pyx_CyFunction_GetClassObj(f)\
2136 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2137 #define __Pyx_CyFunction_Defaults(type, f)\
2138 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2139 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2140 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2142 PyCFunctionObject func;
2143 #if PY_VERSION_HEX < 0x030500A0
2144 PyObject *func_weakreflist;
2146 PyObject *func_dict;
2147 PyObject *func_name;
2148 PyObject *func_qualname;
2150 PyObject *func_globals;
2151 PyObject *func_code;
2152 PyObject *func_closure;
2153 PyObject *func_classobj;
2155 int defaults_pyobjects;
2156 size_t defaults_size;
2158 PyObject *defaults_tuple;
2159 PyObject *defaults_kwdict;
2160 PyObject *(*defaults_getter)(PyObject *);
2161 PyObject *func_annotations;
2162 } __pyx_CyFunctionObject;
2163 static PyTypeObject *__pyx_CyFunctionType = 0;
2164 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2165 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2166 int flags, PyObject* qualname,
2168 PyObject *module, PyObject *globals,
2170 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2173 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2175 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2177 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2179 static int __pyx_CyFunction_init(
void);
2182 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2183 int flags, PyObject* qualname,
2185 PyObject *module, PyObject *globals,
2189 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2190 #define __Pyx_SetNameInClass(ns, name, value)\
2191 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2192 #elif CYTHON_COMPILING_IN_CPYTHON
2193 #define __Pyx_SetNameInClass(ns, name, value)\
2194 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2196 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2200 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2201 PyObject *mkw, PyObject *modname, PyObject *doc);
2202 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2203 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
2206 #ifdef CYTHON_CLINE_IN_TRACEBACK
2207 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2209 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2214 PyCodeObject* code_object;
2216 } __Pyx_CodeObjectCacheEntry;
2217 struct __Pyx_CodeObjectCache {
2220 __Pyx_CodeObjectCacheEntry* entries;
2222 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2223 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2224 static PyCodeObject *__pyx_find_code_object(
int code_line);
2225 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2228 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2229 int py_line,
const char *filename);
2231 #if PY_MAJOR_VERSION < 3
2232 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2233 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2235 #define __Pyx_GetBuffer PyObject_GetBuffer
2236 #define __Pyx_ReleaseBuffer PyBuffer_Release
2242 Py_ssize_t shape, strides, suboffsets;
2243 } __Pyx_Buf_DimInfo;
2249 __Pyx_Buffer *rcbuffer;
2251 __Pyx_Buf_DimInfo diminfo[8];
2252 } __Pyx_LocalBuf_ND;
2255 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2258 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2259 __Pyx_memviewslice *slice2,
2260 int ndim,
size_t itemsize);
2263 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2266 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2267 #define __Pyx_HAS_GCC_DIAGNOSTIC
2271 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2274 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2275 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2276 __Pyx_BufFmt_StackElem* stack,
2277 __Pyx_TypeInfo* type);
2280 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2283 static int __Pyx_ValidateAndInit_memviewslice(
2288 __Pyx_TypeInfo *dtype,
2289 __Pyx_BufFmt_StackElem stack[],
2290 __Pyx_memviewslice *memviewslice,
2291 PyObject *original_obj);
2294 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *,
int writable_flag);
2297 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *,
int writable_flag);
2302 #define __Pyx_CREAL(z) ((z).real())
2303 #define __Pyx_CIMAG(z) ((z).imag())
2305 #define __Pyx_CREAL(z) (__real__(z))
2306 #define __Pyx_CIMAG(z) (__imag__(z))
2309 #define __Pyx_CREAL(z) ((z).real)
2310 #define __Pyx_CIMAG(z) ((z).imag)
2312 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2313 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2314 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2315 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2317 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2318 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2323 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2324 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2325 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2326 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2327 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2328 #define __Pyx_c_neg_float(a) (-(a))
2330 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2331 #define __Pyx_c_conj_float(z) (::std::conj(z))
2333 #define __Pyx_c_abs_float(z) (::std::abs(z))
2334 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2337 #define __Pyx_c_is_zero_float(z) ((z)==0)
2338 #define __Pyx_c_conj_float(z) (conjf(z))
2340 #define __Pyx_c_abs_float(z) (cabsf(z))
2341 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2345 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2346 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2347 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2348 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2349 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2350 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2351 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2352 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2354 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2355 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2361 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2362 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2363 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2364 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2365 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2366 #define __Pyx_c_neg_double(a) (-(a))
2368 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2369 #define __Pyx_c_conj_double(z) (::std::conj(z))
2371 #define __Pyx_c_abs_double(z) (::std::abs(z))
2372 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2375 #define __Pyx_c_is_zero_double(z) ((z)==0)
2376 #define __Pyx_c_conj_double(z) (conj(z))
2378 #define __Pyx_c_abs_double(z) (cabs(z))
2379 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2383 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2384 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2385 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2386 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2387 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2388 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2389 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2390 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2392 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2393 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2398 static __Pyx_memviewslice
2399 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2400 const char *mode,
int ndim,
2401 size_t sizeof_dtype,
int contig_flag,
2402 int dtype_is_object);
2405 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2408 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2411 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2414 static CYTHON_INLINE
size_t __Pyx_PyInt_As_size_t(PyObject *);
2417 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2420 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2423 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2426 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2429 static int __Pyx_check_binary_version(
void);
2432 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2434 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
2435 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2436 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2437 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2438 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2439 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2440 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2441 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2442 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2443 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2444 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2455 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2468 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2469 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2470 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2471 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2472 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2473 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2474 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2475 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2476 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2477 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2478 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2479 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2480 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2481 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2482 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2491 static PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix = 0;
2492 static PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor = 0;
2493 static PyTypeObject *__pyx_array_type = 0;
2494 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2495 static PyTypeObject *__pyx_memoryview_type = 0;
2496 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2497 static PyObject *
generic = 0;
2498 static PyObject *strided = 0;
2499 static PyObject *indirect = 0;
2500 static PyObject *contiguous = 0;
2501 static PyObject *indirect_contiguous = 0;
2502 static int __pyx_memoryview_thread_locks_used;
2503 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2504 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(
struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice);
2505 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(
struct __pyx_obj_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_15superluWrappers_SparseFactor *);
2506 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(
struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice);
2507 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2508 static void *__pyx_align_pointer(
void *,
size_t);
2509 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2510 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2511 static PyObject *_unellipsify(PyObject *,
int);
2512 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2513 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2514 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2515 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2516 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2517 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2518 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2519 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2520 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2521 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2522 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2523 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2524 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2525 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2526 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2527 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2528 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2529 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2530 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2531 static int __pyx_memoryview_err(PyObject *,
char *);
2532 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2533 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2534 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2535 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2536 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2537 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2538 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2539 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2540 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = {
"float64_t", NULL,
sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0,
'R', 0, 0 };
2541 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = {
"int32_t", NULL,
sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
2542 #define __Pyx_MODULE_NAME "superluWrappers"
2543 extern int __pyx_module_is_main_superluWrappers;
2544 int __pyx_module_is_main_superluWrappers = 0;
2547 static PyObject *__pyx_builtin_object;
2548 static PyObject *__pyx_builtin_open;
2549 static PyObject *__pyx_builtin_range;
2550 static PyObject *__pyx_builtin_TypeError;
2551 static PyObject *__pyx_builtin_ImportError;
2552 static PyObject *__pyx_builtin_ValueError;
2553 static PyObject *__pyx_builtin_MemoryError;
2554 static PyObject *__pyx_builtin_enumerate;
2555 static PyObject *__pyx_builtin_Ellipsis;
2556 static PyObject *__pyx_builtin_id;
2557 static PyObject *__pyx_builtin_IndexError;
2558 static const char __pyx_k_O[] =
"O";
2559 static const char __pyx_k_c[] =
"c";
2560 static const char __pyx_k_i[] =
"i";
2561 static const char __pyx_k_k[] =
"k";
2562 static const char __pyx_k_w[] =
"w";
2563 static const char __pyx_k_x[] =
"x";
2564 static const char __pyx_k_y[] =
"y";
2565 static const char __pyx_k_id[] =
"id";
2566 static const char __pyx_k_nc[] =
"nc";
2567 static const char __pyx_k_np[] =
"np";
2568 static const char __pyx_k_nr[] =
"nr";
2569 static const char __pyx_k_dim[] =
"dim";
2570 static const char __pyx_k_doc[] =
"__doc__";
2571 static const char __pyx_k_new[] =
"__new__";
2572 static const char __pyx_k_nnz[] =
"nnz";
2573 static const char __pyx_k_obj[] =
"obj";
2574 static const char __pyx_k_base[] =
"base";
2575 static const char __pyx_k_dict[] =
"__dict__";
2576 static const char __pyx_k_exit[] =
"__exit__";
2577 static const char __pyx_k_init[] =
"__init__";
2578 static const char __pyx_k_main[] =
"__main__";
2579 static const char __pyx_k_mode[] =
"mode";
2580 static const char __pyx_k_name[] =
"name";
2581 static const char __pyx_k_ndim[] =
"ndim";
2582 static const char __pyx_k_open[] =
"open";
2583 static const char __pyx_k_pack[] =
"pack";
2584 static const char __pyx_k_rows[] =
"_rows";
2585 static const char __pyx_k_self[] =
"self";
2586 static const char __pyx_k_size[] =
"size";
2587 static const char __pyx_k_step[] =
"step";
2588 static const char __pyx_k_stop[] =
"stop";
2589 static const char __pyx_k_test[] =
"__test__";
2590 static const char __pyx_k_ASCII[] =
"ASCII";
2591 static const char __pyx_k_class[] =
"__class__";
2592 static const char __pyx_k_enter[] =
"__enter__";
2593 static const char __pyx_k_error[] =
"error";
2594 static const char __pyx_k_flags[] =
"flags";
2595 static const char __pyx_k_i_i_i[] =
"%i %i %i \n";
2596 static const char __pyx_k_numpy[] =
"numpy";
2597 static const char __pyx_k_nzval[] =
"nzval";
2598 static const char __pyx_k_range[] =
"range";
2599 static const char __pyx_k_shape[] =
"shape";
2600 static const char __pyx_k_start[] =
"start";
2601 static const char __pyx_k_write[] =
"write";
2602 static const char __pyx_k_colind[] =
"colind";
2603 static const char __pyx_k_encode[] =
"encode";
2604 static const char __pyx_k_format[] =
"format";
2605 static const char __pyx_k_fwrite[] =
"fwrite";
2606 static const char __pyx_k_import[] =
"__import__";
2607 static const char __pyx_k_matvec[] =
"matvec";
2608 static const char __pyx_k_module[] =
"__module__";
2609 static const char __pyx_k_name_2[] =
"__name__";
2610 static const char __pyx_k_nzvals[] =
"nzvals";
2611 static const char __pyx_k_object[] =
"object";
2612 static const char __pyx_k_pickle[] =
"pickle";
2613 static const char __pyx_k_reduce[] =
"__reduce__";
2614 static const char __pyx_k_rowptr[] =
"rowptr";
2615 static const char __pyx_k_struct[] =
"struct";
2616 static const char __pyx_k_unpack[] =
"unpack";
2617 static const char __pyx_k_update[] =
"update";
2618 static const char __pyx_k_fortran[] =
"fortran";
2619 static const char __pyx_k_memview[] =
"memview";
2620 static const char __pyx_k_prepare[] =
"__prepare__";
2621 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2622 static const char __pyx_k_filename[] =
"filename";
2623 static const char __pyx_k_getstate[] =
"__getstate__";
2624 static const char __pyx_k_itemsize[] =
"itemsize";
2625 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2626 static const char __pyx_k_qualname[] =
"__qualname__";
2627 static const char __pyx_k_setstate[] =
"__setstate__";
2628 static const char __pyx_k_TypeError[] =
"TypeError";
2629 static const char __pyx_k_d_d_13_8e[] =
"%d %d %13.8e\n";
2630 static const char __pyx_k_enumerate[] =
"enumerate";
2631 static const char __pyx_k_metaclass[] =
"__metaclass__";
2632 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2633 static const char __pyx_k_range_end[] =
"range_end";
2634 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2635 static const char __pyx_k_IndexError[] =
"IndexError";
2636 static const char __pyx_k_ValueError[] =
"ValueError";
2637 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2638 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2639 static const char __pyx_k_ImportError[] =
"ImportError";
2640 static const char __pyx_k_MemoryError[] =
"MemoryError";
2641 static const char __pyx_k_PickleError[] =
"PickleError";
2642 static const char __pyx_k_output_file[] =
"output_file";
2643 static const char __pyx_k_range_start[] =
"range_start";
2644 static const char __pyx_k_SparseFactor[] =
"SparseFactor";
2645 static const char __pyx_k_SparseMatrix[] =
"SparseMatrix";
2646 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2647 static const char __pyx_k_sparseFactor[] =
"sparseFactor";
2648 static const char __pyx_k_stringsource[] =
"stringsource";
2649 static const char __pyx_k_cSparseMatrix[] =
"_cSparseMatrix";
2650 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2651 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2652 static const char __pyx_k_sparse_matrix[] =
"sparse_matrix";
2653 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2654 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2655 static const char __pyx_k_cSparseMatrix_2[] =
"cSparseMatrix";
2656 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2657 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2658 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2659 static const char __pyx_k_superluWrappers[] =
"superluWrappers";
2660 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2661 static const char __pyx_k_sparseFactorSolve[] =
"sparseFactorSolve";
2662 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2663 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2664 static const char __pyx_k_SparseMatrix___init[] =
"SparseMatrix.__init__";
2665 static const char __pyx_k_SparseMatrix_fwrite[] =
"SparseMatrix.fwrite";
2666 static const char __pyx_k_SparseMatrix_matvec[] =
"SparseMatrix.matvec";
2667 static const char __pyx_k_sparseFactorPrepare[] =
"sparseFactorPrepare";
2668 static const char __pyx_k_getCSRrepresentation[] =
"getCSRrepresentation";
2669 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2670 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2671 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2672 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2673 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2674 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2675 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2676 static const char __pyx_k_getSubMatCSRrepresentation[] =
"getSubMatCSRrepresentation";
2677 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2678 static const char __pyx_k_proteus_superluWrappers_pyx[] =
"proteus/superluWrappers.pyx";
2679 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2680 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2681 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2682 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2683 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2684 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2685 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2686 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2687 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2688 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2689 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2690 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2691 static const char __pyx_k_SparseMatrix_getCSRrepresentatio[] =
"SparseMatrix.getCSRrepresentation";
2692 static const char __pyx_k_SparseMatrix_getSubMatCSRreprese[] =
"SparseMatrix.getSubMatCSRrepresentation";
2693 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2694 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2695 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2696 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2697 static const char __pyx_k_self_A_self_AC_self_L_self_U_sel[] =
"self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling";
2698 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2699 static PyObject *__pyx_n_s_ASCII;
2700 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2701 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2702 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2703 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2704 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2705 static PyObject *__pyx_n_s_Ellipsis;
2706 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2707 static PyObject *__pyx_n_s_ImportError;
2708 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2709 static PyObject *__pyx_n_s_IndexError;
2710 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2711 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2712 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2713 static PyObject *__pyx_n_s_MemoryError;
2714 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2715 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2716 static PyObject *__pyx_n_b_O;
2717 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2718 static PyObject *__pyx_n_s_PickleError;
2719 static PyObject *__pyx_n_s_SparseFactor;
2720 static PyObject *__pyx_n_s_SparseMatrix;
2721 static PyObject *__pyx_n_s_SparseMatrix___init;
2722 static PyObject *__pyx_n_s_SparseMatrix_fwrite;
2723 static PyObject *__pyx_n_s_SparseMatrix_getCSRrepresentatio;
2724 static PyObject *__pyx_n_s_SparseMatrix_getSubMatCSRreprese;
2725 static PyObject *__pyx_n_s_SparseMatrix_matvec;
2726 static PyObject *__pyx_n_s_TypeError;
2727 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2728 static PyObject *__pyx_n_s_ValueError;
2729 static PyObject *__pyx_n_s_View_MemoryView;
2730 static PyObject *__pyx_n_s_allocate_buffer;
2731 static PyObject *__pyx_n_s_base;
2732 static PyObject *__pyx_n_s_c;
2733 static PyObject *__pyx_n_u_c;
2734 static PyObject *__pyx_n_s_cSparseMatrix;
2735 static PyObject *__pyx_n_s_cSparseMatrix_2;
2736 static PyObject *__pyx_n_s_class;
2737 static PyObject *__pyx_n_s_cline_in_traceback;
2738 static PyObject *__pyx_n_s_colind;
2739 static PyObject *__pyx_kp_s_contiguous_and_direct;
2740 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2741 static PyObject *__pyx_kp_s_d_d_13_8e;
2742 static PyObject *__pyx_n_s_dict;
2743 static PyObject *__pyx_n_s_dim;
2744 static PyObject *__pyx_n_s_doc;
2745 static PyObject *__pyx_n_s_dtype_is_object;
2746 static PyObject *__pyx_n_s_encode;
2747 static PyObject *__pyx_n_s_enter;
2748 static PyObject *__pyx_n_s_enumerate;
2749 static PyObject *__pyx_n_s_error;
2750 static PyObject *__pyx_n_s_exit;
2751 static PyObject *__pyx_n_s_filename;
2752 static PyObject *__pyx_n_s_flags;
2753 static PyObject *__pyx_n_s_format;
2754 static PyObject *__pyx_n_s_fortran;
2755 static PyObject *__pyx_n_u_fortran;
2756 static PyObject *__pyx_n_s_fwrite;
2757 static PyObject *__pyx_n_s_getCSRrepresentation;
2758 static PyObject *__pyx_n_s_getSubMatCSRrepresentation;
2759 static PyObject *__pyx_n_s_getstate;
2760 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2761 static PyObject *__pyx_n_s_i;
2762 static PyObject *__pyx_kp_s_i_i_i;
2763 static PyObject *__pyx_n_s_id;
2764 static PyObject *__pyx_n_s_import;
2765 static PyObject *__pyx_n_s_init;
2766 static PyObject *__pyx_n_s_itemsize;
2767 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2768 static PyObject *__pyx_n_s_k;
2769 static PyObject *__pyx_n_s_main;
2770 static PyObject *__pyx_n_s_matvec;
2771 static PyObject *__pyx_n_s_memview;
2772 static PyObject *__pyx_n_s_metaclass;
2773 static PyObject *__pyx_n_s_mode;
2774 static PyObject *__pyx_n_s_module;
2775 static PyObject *__pyx_n_s_name;
2776 static PyObject *__pyx_n_s_name_2;
2777 static PyObject *__pyx_n_s_nc;
2778 static PyObject *__pyx_n_s_ndim;
2779 static PyObject *__pyx_n_s_new;
2780 static PyObject *__pyx_n_s_nnz;
2781 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2782 static PyObject *__pyx_n_s_np;
2783 static PyObject *__pyx_n_s_nr;
2784 static PyObject *__pyx_n_s_numpy;
2785 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2786 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2787 static PyObject *__pyx_n_s_nzval;
2788 static PyObject *__pyx_n_s_nzvals;
2789 static PyObject *__pyx_n_s_obj;
2790 static PyObject *__pyx_n_s_object;
2791 static PyObject *__pyx_n_s_open;
2792 static PyObject *__pyx_n_s_output_file;
2793 static PyObject *__pyx_n_s_pack;
2794 static PyObject *__pyx_n_s_pickle;
2795 static PyObject *__pyx_n_s_prepare;
2796 static PyObject *__pyx_kp_s_proteus_superluWrappers_pyx;
2797 static PyObject *__pyx_n_s_pyx_PickleError;
2798 static PyObject *__pyx_n_s_pyx_checksum;
2799 static PyObject *__pyx_n_s_pyx_getbuffer;
2800 static PyObject *__pyx_n_s_pyx_result;
2801 static PyObject *__pyx_n_s_pyx_state;
2802 static PyObject *__pyx_n_s_pyx_type;
2803 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2804 static PyObject *__pyx_n_s_pyx_vtable;
2805 static PyObject *__pyx_n_s_qualname;
2806 static PyObject *__pyx_n_s_range;
2807 static PyObject *__pyx_n_s_range_end;
2808 static PyObject *__pyx_n_s_range_start;
2809 static PyObject *__pyx_n_s_reduce;
2810 static PyObject *__pyx_n_s_reduce_cython;
2811 static PyObject *__pyx_n_s_reduce_ex;
2812 static PyObject *__pyx_n_s_rowptr;
2813 static PyObject *__pyx_n_s_rows;
2814 static PyObject *__pyx_n_s_self;
2815 static PyObject *__pyx_kp_s_self_A_self_AC_self_L_self_U_sel;
2816 static PyObject *__pyx_n_s_setstate;
2817 static PyObject *__pyx_n_s_setstate_cython;
2818 static PyObject *__pyx_n_s_shape;
2819 static PyObject *__pyx_n_s_size;
2820 static PyObject *__pyx_n_s_sparseFactor;
2821 static PyObject *__pyx_n_s_sparseFactorPrepare;
2822 static PyObject *__pyx_n_s_sparseFactorSolve;
2823 static PyObject *__pyx_n_s_sparse_matrix;
2824 static PyObject *__pyx_n_s_start;
2825 static PyObject *__pyx_n_s_step;
2826 static PyObject *__pyx_n_s_stop;
2827 static PyObject *__pyx_kp_s_strided_and_direct;
2828 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2829 static PyObject *__pyx_kp_s_strided_and_indirect;
2830 static PyObject *__pyx_kp_s_stringsource;
2831 static PyObject *__pyx_n_s_struct;
2832 static PyObject *__pyx_n_s_superluWrappers;
2833 static PyObject *__pyx_n_s_test;
2834 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2835 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2836 static PyObject *__pyx_n_s_unpack;
2837 static PyObject *__pyx_n_s_update;
2838 static PyObject *__pyx_n_s_w;
2839 static PyObject *__pyx_n_s_write;
2840 static PyObject *__pyx_n_s_x;
2841 static PyObject *__pyx_n_s_y;
2842 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr);
2843 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y);
2844 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base);
2845 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self);
2846 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end);
2847 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self,
int __pyx_v_nr,
int __pyx_v_nc,
int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr);
2848 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self);
2849 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2850 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim);
2851 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
2852 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value);
2853 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
2854 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2855 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor);
2856 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x);
2857 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2858 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2859 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2860 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2861 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2862 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2863 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2864 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2865 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2866 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2867 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2868 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2869 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2870 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2871 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2872 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2873 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2874 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2875 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2876 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2877 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2878 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2879 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2880 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2881 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2882 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2883 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2884 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2885 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2886 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2887 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2888 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2889 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2890 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2891 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2892 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2893 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2894 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2895 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2896 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2897 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2898 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2899 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k);
2900 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2901 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2902 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2903 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2904 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2905 static PyObject *__pyx_int_0;
2906 static PyObject *__pyx_int_1;
2907 static PyObject *__pyx_int_112105877;
2908 static PyObject *__pyx_int_136983863;
2909 static PyObject *__pyx_int_184977713;
2910 static PyObject *__pyx_int_neg_1;
2911 static PyObject *__pyx_tuple_;
2912 static PyObject *__pyx_tuple__2;
2913 static PyObject *__pyx_tuple__3;
2914 static PyObject *__pyx_tuple__4;
2915 static PyObject *__pyx_tuple__5;
2916 static PyObject *__pyx_tuple__6;
2917 static PyObject *__pyx_tuple__7;
2918 static PyObject *__pyx_tuple__8;
2919 static PyObject *__pyx_tuple__9;
2920 static PyObject *__pyx_slice__22;
2921 static PyObject *__pyx_tuple__10;
2922 static PyObject *__pyx_tuple__11;
2923 static PyObject *__pyx_tuple__12;
2924 static PyObject *__pyx_tuple__13;
2925 static PyObject *__pyx_tuple__14;
2926 static PyObject *__pyx_tuple__15;
2927 static PyObject *__pyx_tuple__16;
2928 static PyObject *__pyx_tuple__17;
2929 static PyObject *__pyx_tuple__18;
2930 static PyObject *__pyx_tuple__19;
2931 static PyObject *__pyx_tuple__20;
2932 static PyObject *__pyx_tuple__21;
2933 static PyObject *__pyx_tuple__23;
2934 static PyObject *__pyx_tuple__24;
2935 static PyObject *__pyx_tuple__25;
2936 static PyObject *__pyx_tuple__26;
2937 static PyObject *__pyx_tuple__27;
2938 static PyObject *__pyx_tuple__28;
2939 static PyObject *__pyx_tuple__30;
2940 static PyObject *__pyx_tuple__32;
2941 static PyObject *__pyx_tuple__34;
2942 static PyObject *__pyx_tuple__36;
2943 static PyObject *__pyx_tuple__38;
2944 static PyObject *__pyx_tuple__40;
2945 static PyObject *__pyx_tuple__42;
2946 static PyObject *__pyx_tuple__43;
2947 static PyObject *__pyx_tuple__44;
2948 static PyObject *__pyx_tuple__45;
2949 static PyObject *__pyx_tuple__46;
2950 static PyObject *__pyx_tuple__47;
2951 static PyObject *__pyx_codeobj__29;
2952 static PyObject *__pyx_codeobj__31;
2953 static PyObject *__pyx_codeobj__33;
2954 static PyObject *__pyx_codeobj__35;
2955 static PyObject *__pyx_codeobj__37;
2956 static PyObject *__pyx_codeobj__39;
2957 static PyObject *__pyx_codeobj__41;
2958 static PyObject *__pyx_codeobj__48;
2970 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2971 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2972 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2973 PyObject *__pyx_v_self = 0;
2974 PyObject *__pyx_v_nr = 0;
2975 PyObject *__pyx_v_nc = 0;
2976 PyObject *__pyx_v_nnz = 0;
2977 PyObject *__pyx_v_nzvals = 0;
2978 PyObject *__pyx_v_colind = 0;
2979 PyObject *__pyx_v_rowptr = 0;
2980 int __pyx_lineno = 0;
2981 const char *__pyx_filename = NULL;
2982 int __pyx_clineno = 0;
2983 PyObject *__pyx_r = 0;
2984 __Pyx_RefNannyDeclarations
2985 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2987 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzvals,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
2988 PyObject* values[7] = {0,0,0,0,0,0,0};
2989 if (unlikely(__pyx_kwds)) {
2991 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2993 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2995 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2997 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2999 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3001 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3003 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3005 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3008 default:
goto __pyx_L5_argtuple_error;
3010 kw_args = PyDict_Size(__pyx_kwds);
3013 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3014 else goto __pyx_L5_argtuple_error;
3017 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
3019 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 1); __PYX_ERR(0, 15, __pyx_L3_error)
3023 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
3025 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 2); __PYX_ERR(0, 15, __pyx_L3_error)
3029 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
3031 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 3); __PYX_ERR(0, 15, __pyx_L3_error)
3035 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzvals)) != 0)) kw_args--;
3037 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 4); __PYX_ERR(0, 15, __pyx_L3_error)
3041 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
3043 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 5); __PYX_ERR(0, 15, __pyx_L3_error)
3047 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
3049 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 6); __PYX_ERR(0, 15, __pyx_L3_error)
3052 if (unlikely(kw_args > 0)) {
3053 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
3055 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
3056 goto __pyx_L5_argtuple_error;
3058 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3059 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3060 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3061 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3062 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3063 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3064 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3066 __pyx_v_self = values[0];
3067 __pyx_v_nr = values[1];
3068 __pyx_v_nc = values[2];
3069 __pyx_v_nnz = values[3];
3070 __pyx_v_nzvals = values[4];
3071 __pyx_v_colind = values[5];
3072 __pyx_v_rowptr = values[6];
3074 goto __pyx_L4_argument_unpacking_done;
3075 __pyx_L5_argtuple_error:;
3076 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error)
3078 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3079 __Pyx_RefNannyFinishContext();
3081 __pyx_L4_argument_unpacking_done:;
3082 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
3085 __Pyx_RefNannyFinishContext();
3089 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
3090 PyObject *__pyx_r = NULL;
3091 __Pyx_RefNannyDeclarations
3092 PyObject *__pyx_t_1 = NULL;
3093 PyObject *__pyx_t_2 = NULL;
3094 PyObject *__pyx_t_3 = NULL;
3095 PyObject *__pyx_t_4 = NULL;
3096 int __pyx_lineno = 0;
3097 const char *__pyx_filename = NULL;
3098 int __pyx_clineno = 0;
3099 __Pyx_RefNannySetupContext(
"__init__", 0);
3108 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nr, __pyx_v_nr) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3109 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc, __pyx_v_nc) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3118 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nnz, __pyx_v_nnz) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
3127 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3128 __Pyx_GOTREF(__pyx_t_1);
3129 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3130 __Pyx_GOTREF(__pyx_t_2);
3131 __pyx_t_3 = PyList_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
3132 __Pyx_GOTREF(__pyx_t_3);
3133 __Pyx_GIVEREF(__pyx_t_1);
3134 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3135 __Pyx_GIVEREF(__pyx_t_2);
3136 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3139 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3140 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3149 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nzvals, __pyx_v_nzvals) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3158 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_colind, __pyx_v_colind) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
3167 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowptr, __pyx_v_rowptr) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3176 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3177 __Pyx_GOTREF(__pyx_t_3);
3186 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
3187 __Pyx_GOTREF(__pyx_t_2);
3196 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3197 __Pyx_GOTREF(__pyx_t_1);
3206 __pyx_t_4 = PyTuple_New(6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
3207 __Pyx_GOTREF(__pyx_t_4);
3208 __Pyx_INCREF(__pyx_v_nr);
3209 __Pyx_GIVEREF(__pyx_v_nr);
3210 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nr);
3211 __Pyx_INCREF(__pyx_v_nc);
3212 __Pyx_GIVEREF(__pyx_v_nc);
3213 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nc);
3214 __Pyx_INCREF(__pyx_v_nnz);
3215 __Pyx_GIVEREF(__pyx_v_nnz);
3216 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nnz);
3217 __Pyx_GIVEREF(__pyx_t_3);
3218 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
3219 __Pyx_GIVEREF(__pyx_t_2);
3220 PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
3221 __Pyx_GIVEREF(__pyx_t_1);
3222 PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1);
3226 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_15superluWrappers_cSparseMatrix), __pyx_t_4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3227 __Pyx_GOTREF(__pyx_t_1);
3228 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3229 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3241 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3244 __Pyx_XDECREF(__pyx_t_1);
3245 __Pyx_XDECREF(__pyx_t_2);
3246 __Pyx_XDECREF(__pyx_t_3);
3247 __Pyx_XDECREF(__pyx_t_4);
3248 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3251 __Pyx_XGIVEREF(__pyx_r);
3252 __Pyx_RefNannyFinishContext();
3265 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3266 static char __pyx_doc_15superluWrappers_12SparseMatrix_2matvec[] =
"\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ";
3267 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {
"matvec", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
3268 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3269 PyObject *__pyx_v_self = 0;
3270 PyObject *__pyx_v_x = 0;
3271 PyObject *__pyx_v_y = 0;
3272 int __pyx_lineno = 0;
3273 const char *__pyx_filename = NULL;
3274 int __pyx_clineno = 0;
3275 PyObject *__pyx_r = 0;
3276 __Pyx_RefNannyDeclarations
3277 __Pyx_RefNannySetupContext(
"matvec (wrapper)", 0);
3279 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
3280 PyObject* values[3] = {0,0,0};
3281 if (unlikely(__pyx_kwds)) {
3283 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3285 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3287 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3289 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3292 default:
goto __pyx_L5_argtuple_error;
3294 kw_args = PyDict_Size(__pyx_kwds);
3297 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3298 else goto __pyx_L5_argtuple_error;
3301 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3303 __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3307 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3309 __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3312 if (unlikely(kw_args > 0)) {
3313 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"matvec") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3315 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3316 goto __pyx_L5_argtuple_error;
3318 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3319 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3320 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3322 __pyx_v_self = values[0];
3323 __pyx_v_x = values[1];
3324 __pyx_v_y = values[2];
3326 goto __pyx_L4_argument_unpacking_done;
3327 __pyx_L5_argtuple_error:;
3328 __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3330 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3331 __Pyx_RefNannyFinishContext();
3333 __pyx_L4_argument_unpacking_done:;
3334 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
3337 __Pyx_RefNannyFinishContext();
3341 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
3342 PyObject *__pyx_r = NULL;
3343 __Pyx_RefNannyDeclarations
3344 PyObject *__pyx_t_1 = NULL;
3345 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3346 __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
3347 int __pyx_lineno = 0;
3348 const char *__pyx_filename = NULL;
3349 int __pyx_clineno = 0;
3350 __Pyx_RefNannySetupContext(
"matvec", 0);
3359 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
3360 __Pyx_GOTREF(__pyx_t_1);
3361 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
3362 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3363 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3364 __pyx_f_15superluWrappers_SparseMatrix_matvec(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3);
3365 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3366 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3367 __pyx_t_2.memview = NULL;
3368 __pyx_t_2.data = NULL;
3369 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3370 __pyx_t_3.memview = NULL;
3371 __pyx_t_3.data = NULL;
3382 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3385 __Pyx_XDECREF(__pyx_t_1);
3386 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3387 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3388 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3391 __Pyx_XGIVEREF(__pyx_r);
3392 __Pyx_RefNannyFinishContext();
3405 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3406 static char __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite[] =
" Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ";
3407 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {
"fwrite", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
3408 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3409 PyObject *__pyx_v_self = 0;
3410 PyObject *__pyx_v_filename = 0;
3411 PyObject *__pyx_v_base = 0;
3412 int __pyx_lineno = 0;
3413 const char *__pyx_filename = NULL;
3414 int __pyx_clineno = 0;
3415 PyObject *__pyx_r = 0;
3416 __Pyx_RefNannyDeclarations
3417 __Pyx_RefNannySetupContext(
"fwrite (wrapper)", 0);
3419 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_base,0};
3420 PyObject* values[3] = {0,0,0};
3421 if (unlikely(__pyx_kwds)) {
3423 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3425 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3427 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3429 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3432 default:
goto __pyx_L5_argtuple_error;
3434 kw_args = PyDict_Size(__pyx_kwds);
3437 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3438 else goto __pyx_L5_argtuple_error;
3441 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
3443 __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, 1); __PYX_ERR(0, 46, __pyx_L3_error)
3447 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
3449 __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, 2); __PYX_ERR(0, 46, __pyx_L3_error)
3452 if (unlikely(kw_args > 0)) {
3453 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"fwrite") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
3455 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3456 goto __pyx_L5_argtuple_error;
3458 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3459 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3460 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3462 __pyx_v_self = values[0];
3463 __pyx_v_filename = values[1];
3464 __pyx_v_base = values[2];
3466 goto __pyx_L4_argument_unpacking_done;
3467 __pyx_L5_argtuple_error:;
3468 __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error)
3470 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3471 __Pyx_RefNannyFinishContext();
3473 __pyx_L4_argument_unpacking_done:;
3474 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
3477 __Pyx_RefNannyFinishContext();
3481 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
3482 PyObject *__pyx_v_output_file = NULL;
3483 PyObject *__pyx_v_i = NULL;
3484 PyObject *__pyx_v_k = NULL;
3485 PyObject *__pyx_r = NULL;
3486 __Pyx_RefNannyDeclarations
3487 PyObject *__pyx_t_1 = NULL;
3488 PyObject *__pyx_t_2 = NULL;
3489 PyObject *__pyx_t_3 = NULL;
3490 PyObject *__pyx_t_4 = NULL;
3491 PyObject *__pyx_t_5 = NULL;
3492 PyObject *__pyx_t_6 = NULL;
3493 PyObject *__pyx_t_7 = NULL;
3494 PyObject *__pyx_t_8 = NULL;
3495 PyObject *__pyx_t_9 = NULL;
3496 PyObject *__pyx_t_10 = NULL;
3497 PyObject *__pyx_t_11 = NULL;
3498 Py_ssize_t __pyx_t_12;
3499 PyObject *(*__pyx_t_13)(PyObject *);
3500 Py_ssize_t __pyx_t_14;
3501 PyObject *(*__pyx_t_15)(PyObject *);
3502 PyObject *__pyx_t_16 = NULL;
3503 PyObject *__pyx_t_17 = NULL;
3506 int __pyx_lineno = 0;
3507 const char *__pyx_filename = NULL;
3508 int __pyx_clineno = 0;
3509 __Pyx_RefNannySetupContext(
"fwrite", 0);
3519 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
3520 __Pyx_GOTREF(__pyx_t_1);
3521 __Pyx_INCREF(__pyx_v_filename);
3522 __Pyx_GIVEREF(__pyx_v_filename);
3523 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
3524 __Pyx_INCREF(__pyx_n_s_w);
3525 __Pyx_GIVEREF(__pyx_n_s_w);
3526 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
3527 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
3528 __Pyx_GOTREF(__pyx_t_2);
3529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3530 __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_3);
3532 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L3_error)
3533 __Pyx_GOTREF(__pyx_t_4);
3535 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3536 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3537 if (likely(__pyx_t_5)) {
3538 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3539 __Pyx_INCREF(__pyx_t_5);
3540 __Pyx_INCREF(
function);
3541 __Pyx_DECREF_SET(__pyx_t_4,
function);
3544 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3545 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3546 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3547 __Pyx_GOTREF(__pyx_t_1);
3548 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3549 __pyx_t_4 = __pyx_t_1;
3551 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3554 __Pyx_PyThreadState_declare
3555 __Pyx_PyThreadState_assign
3556 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3557 __Pyx_XGOTREF(__pyx_t_6);
3558 __Pyx_XGOTREF(__pyx_t_7);
3559 __Pyx_XGOTREF(__pyx_t_8);
3561 __pyx_v_output_file = __pyx_t_4;
3571 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
3572 __Pyx_GOTREF(__pyx_t_2);
3573 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L7_error)
3574 __Pyx_GOTREF(__pyx_t_1);
3575 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3576 __Pyx_GOTREF(__pyx_t_5);
3577 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L7_error)
3578 __Pyx_GOTREF(__pyx_t_9);
3579 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3580 __Pyx_GOTREF(__pyx_t_10);
3581 __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3582 __Pyx_GOTREF(__pyx_t_11);
3583 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3584 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3585 __pyx_t_10 = PyTuple_New(3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3586 __Pyx_GOTREF(__pyx_t_10);
3587 __Pyx_GIVEREF(__pyx_t_1);
3588 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
3589 __Pyx_GIVEREF(__pyx_t_5);
3590 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3591 __Pyx_GIVEREF(__pyx_t_11);
3592 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_11);
3596 __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_i_i_i, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3597 __Pyx_GOTREF(__pyx_t_11);
3598 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3600 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3601 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
3602 if (likely(__pyx_t_10)) {
3603 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3604 __Pyx_INCREF(__pyx_t_10);
3605 __Pyx_INCREF(
function);
3606 __Pyx_DECREF_SET(__pyx_t_2,
function);
3609 __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11);
3610 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3611 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3612 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3613 __Pyx_GOTREF(__pyx_t_4);
3614 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3615 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3624 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3625 __Pyx_GOTREF(__pyx_t_4);
3626 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3627 __Pyx_GOTREF(__pyx_t_2);
3628 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3629 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
3630 __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
3633 __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3634 __Pyx_GOTREF(__pyx_t_4);
3635 __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
3637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3639 if (likely(!__pyx_t_13)) {
3640 if (likely(PyList_CheckExact(__pyx_t_4))) {
3641 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4))
break;
3642 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3643 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3645 __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3646 __Pyx_GOTREF(__pyx_t_2);
3649 if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
3650 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3651 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3653 __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3654 __Pyx_GOTREF(__pyx_t_2);
3658 __pyx_t_2 = __pyx_t_13(__pyx_t_4);
3659 if (unlikely(!__pyx_t_2)) {
3660 PyObject* exc_type = PyErr_Occurred();
3662 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3663 else __PYX_ERR(0, 58, __pyx_L7_error)
3667 __Pyx_GOTREF(__pyx_t_2);
3669 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3679 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3680 __Pyx_GOTREF(__pyx_t_2);
3681 __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_i);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3682 __Pyx_GOTREF(__pyx_t_11);
3683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3684 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3685 __Pyx_GOTREF(__pyx_t_2);
3686 __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3687 __Pyx_GOTREF(__pyx_t_10);
3688 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_10);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3689 __Pyx_GOTREF(__pyx_t_5);
3690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3691 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3692 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3693 __Pyx_GOTREF(__pyx_t_10);
3694 __Pyx_GIVEREF(__pyx_t_11);
3695 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
3696 __Pyx_GIVEREF(__pyx_t_5);
3697 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3700 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3701 __Pyx_GOTREF(__pyx_t_5);
3702 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3703 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
3704 __pyx_t_10 = __pyx_t_5; __Pyx_INCREF(__pyx_t_10); __pyx_t_14 = 0;
3707 __pyx_t_14 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3708 __Pyx_GOTREF(__pyx_t_10);
3709 __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext;
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 59, __pyx_L7_error)
3711 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3713 if (likely(!__pyx_t_15)) {
3714 if (likely(PyList_CheckExact(__pyx_t_10))) {
3715 if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_10))
break;
3716 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3717 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3719 __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3720 __Pyx_GOTREF(__pyx_t_5);
3723 if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_10))
break;
3724 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3725 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3727 __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3728 __Pyx_GOTREF(__pyx_t_5);
3732 __pyx_t_5 = __pyx_t_15(__pyx_t_10);
3733 if (unlikely(!__pyx_t_5)) {
3734 PyObject* exc_type = PyErr_Occurred();
3736 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3737 else __PYX_ERR(0, 59, __pyx_L7_error)
3741 __Pyx_GOTREF(__pyx_t_5);
3743 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
3753 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
3754 __Pyx_GOTREF(__pyx_t_11);
3755 __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
3756 __Pyx_GOTREF(__pyx_t_2);
3757 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3758 __Pyx_GOTREF(__pyx_t_1);
3759 __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_k);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3760 __Pyx_GOTREF(__pyx_t_9);
3761 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3762 __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_v_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3763 __Pyx_GOTREF(__pyx_t_1);
3764 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3765 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3766 __Pyx_GOTREF(__pyx_t_9);
3767 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3768 __Pyx_GOTREF(__pyx_t_16);
3769 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3770 __pyx_t_9 = PyTuple_New(3);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3771 __Pyx_GOTREF(__pyx_t_9);
3772 __Pyx_GIVEREF(__pyx_t_2);
3773 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
3774 __Pyx_GIVEREF(__pyx_t_1);
3775 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
3776 __Pyx_GIVEREF(__pyx_t_16);
3777 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_16);
3781 __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_d_d_13_8e, __pyx_t_9);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3782 __Pyx_GOTREF(__pyx_t_16);
3783 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3785 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
3786 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
3787 if (likely(__pyx_t_9)) {
3788 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
3789 __Pyx_INCREF(__pyx_t_9);
3790 __Pyx_INCREF(
function);
3791 __Pyx_DECREF_SET(__pyx_t_11,
function);
3794 __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_9, __pyx_t_16) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_16);
3795 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3796 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3797 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L7_error)
3798 __Pyx_GOTREF(__pyx_t_5);
3799 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3800 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3810 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3820 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3830 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3831 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3832 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3833 goto __pyx_L12_try_end;
3835 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3836 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3837 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3838 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3839 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3840 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3841 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3842 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3844 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3845 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_5) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3846 __Pyx_GOTREF(__pyx_t_4);
3847 __Pyx_GOTREF(__pyx_t_10);
3848 __Pyx_GOTREF(__pyx_t_5);
3849 __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_5);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3850 __Pyx_GOTREF(__pyx_t_11);
3851 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL);
3852 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3853 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3854 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3855 __Pyx_GOTREF(__pyx_t_17);
3856 __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_17);
3857 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3858 if (__pyx_t_18 < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3859 __pyx_t_19 = ((!(__pyx_t_18 != 0)) != 0);
3861 __Pyx_GIVEREF(__pyx_t_4);
3862 __Pyx_GIVEREF(__pyx_t_10);
3863 __Pyx_XGIVEREF(__pyx_t_5);
3864 __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_10, __pyx_t_5);
3865 __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_5 = 0;
3866 __PYX_ERR(0, 56, __pyx_L9_except_error)
3868 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3869 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3870 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3871 goto __pyx_L8_exception_handled;
3873 __pyx_L9_except_error:;
3874 __Pyx_XGIVEREF(__pyx_t_6);
3875 __Pyx_XGIVEREF(__pyx_t_7);
3876 __Pyx_XGIVEREF(__pyx_t_8);
3877 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3878 goto __pyx_L1_error;
3879 __pyx_L8_exception_handled:;
3880 __Pyx_XGIVEREF(__pyx_t_6);
3881 __Pyx_XGIVEREF(__pyx_t_7);
3882 __Pyx_XGIVEREF(__pyx_t_8);
3883 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3890 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL);
3891 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3892 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error)
3893 __Pyx_GOTREF(__pyx_t_8);
3894 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3903 goto __pyx_L1_error;
3916 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3919 __Pyx_XDECREF(__pyx_t_1);
3920 __Pyx_XDECREF(__pyx_t_2);
3921 __Pyx_XDECREF(__pyx_t_4);
3922 __Pyx_XDECREF(__pyx_t_5);
3923 __Pyx_XDECREF(__pyx_t_9);
3924 __Pyx_XDECREF(__pyx_t_10);
3925 __Pyx_XDECREF(__pyx_t_11);
3926 __Pyx_XDECREF(__pyx_t_16);
3927 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3930 __Pyx_XDECREF(__pyx_v_output_file);
3931 __Pyx_XDECREF(__pyx_v_i);
3932 __Pyx_XDECREF(__pyx_v_k);
3933 __Pyx_XGIVEREF(__pyx_r);
3934 __Pyx_RefNannyFinishContext();
3947 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self);
3948 static char __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation[] =
" Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ";
3949 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {
"getCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, METH_O, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
3950 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3951 PyObject *__pyx_r = 0;
3952 __Pyx_RefNannyDeclarations
3953 __Pyx_RefNannySetupContext(
"getCSRrepresentation (wrapper)", 0);
3954 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, ((PyObject *)__pyx_v_self));
3957 __Pyx_RefNannyFinishContext();
3961 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3962 PyObject *__pyx_r = NULL;
3963 __Pyx_RefNannyDeclarations
3964 PyObject *__pyx_t_1 = NULL;
3965 PyObject *__pyx_t_2 = NULL;
3966 PyObject *__pyx_t_3 = NULL;
3967 PyObject *__pyx_t_4 = NULL;
3968 int __pyx_lineno = 0;
3969 const char *__pyx_filename = NULL;
3970 int __pyx_clineno = 0;
3971 __Pyx_RefNannySetupContext(
"getCSRrepresentation", 0);
3980 __Pyx_XDECREF(__pyx_r);
3981 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3982 __Pyx_GOTREF(__pyx_t_1);
3983 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3984 __Pyx_GOTREF(__pyx_t_2);
3985 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
3986 __Pyx_GOTREF(__pyx_t_3);
3987 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
3988 __Pyx_GOTREF(__pyx_t_4);
3989 __Pyx_GIVEREF(__pyx_t_1);
3990 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3991 __Pyx_GIVEREF(__pyx_t_2);
3992 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3993 __Pyx_GIVEREF(__pyx_t_3);
3994 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3998 __pyx_r = __pyx_t_4;
4012 __Pyx_XDECREF(__pyx_t_1);
4013 __Pyx_XDECREF(__pyx_t_2);
4014 __Pyx_XDECREF(__pyx_t_3);
4015 __Pyx_XDECREF(__pyx_t_4);
4016 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4019 __Pyx_XGIVEREF(__pyx_r);
4020 __Pyx_RefNannyFinishContext();
4033 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4034 static char __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation[] =
" Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ";
4035 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {
"getSubMatCSRrepresentation", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
4036 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4037 PyObject *__pyx_v_self = 0;
4038 PyObject *__pyx_v_range_start = 0;
4039 PyObject *__pyx_v_range_end = 0;
4040 int __pyx_lineno = 0;
4041 const char *__pyx_filename = NULL;
4042 int __pyx_clineno = 0;
4043 PyObject *__pyx_r = 0;
4044 __Pyx_RefNannyDeclarations
4045 __Pyx_RefNannySetupContext(
"getSubMatCSRrepresentation (wrapper)", 0);
4047 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_range_start,&__pyx_n_s_range_end,0};
4048 PyObject* values[3] = {0,0,0};
4049 if (unlikely(__pyx_kwds)) {
4051 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4053 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4055 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4057 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4060 default:
goto __pyx_L5_argtuple_error;
4062 kw_args = PyDict_Size(__pyx_kwds);
4065 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4066 else goto __pyx_L5_argtuple_error;
4069 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_start)) != 0)) kw_args--;
4071 __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
4075 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_end)) != 0)) kw_args--;
4077 __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
4080 if (unlikely(kw_args > 0)) {
4081 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getSubMatCSRrepresentation") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
4083 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4084 goto __pyx_L5_argtuple_error;
4086 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4087 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4088 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4090 __pyx_v_self = values[0];
4091 __pyx_v_range_start = values[1];
4092 __pyx_v_range_end = values[2];
4094 goto __pyx_L4_argument_unpacking_done;
4095 __pyx_L5_argtuple_error:;
4096 __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
4098 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4099 __Pyx_RefNannyFinishContext();
4101 __pyx_L4_argument_unpacking_done:;
4102 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
4105 __Pyx_RefNannyFinishContext();
4109 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
4110 PyObject *__pyx_v__rows = NULL;
4111 PyObject *__pyx_v_nnz = NULL;
4112 PyObject *__pyx_v_rowptr = NULL;
4113 PyObject *__pyx_v_colind = NULL;
4114 PyObject *__pyx_v_nzvals = NULL;
4115 PyObject *__pyx_r = NULL;
4116 __Pyx_RefNannyDeclarations
4117 PyObject *__pyx_t_1 = NULL;
4119 PyObject *__pyx_t_3 = NULL;
4120 PyObject *__pyx_t_4 = NULL;
4121 PyObject *__pyx_t_5 = NULL;
4122 int __pyx_lineno = 0;
4123 const char *__pyx_filename = NULL;
4124 int __pyx_clineno = 0;
4125 __Pyx_RefNannySetupContext(
"getSubMatCSRrepresentation", 0);
4134 #ifndef CYTHON_WITHOUT_ASSERTIONS
4135 if (unlikely(!Py_OptimizeFlag)) {
4136 __pyx_t_1 = PyObject_RichCompare(__pyx_v_range_start, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4137 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4138 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4139 if (unlikely(!__pyx_t_2)) {
4140 PyErr_SetNone(PyExc_AssertionError);
4141 __PYX_ERR(0, 87, __pyx_L1_error)
4145 #ifndef CYTHON_WITHOUT_ASSERTIONS
4146 if (unlikely(!Py_OptimizeFlag)) {
4147 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4148 __Pyx_GOTREF(__pyx_t_1);
4149 __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
4150 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4151 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4152 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4153 if (unlikely(!__pyx_t_2)) {
4154 PyErr_SetNone(PyExc_AssertionError);
4155 __PYX_ERR(0, 87, __pyx_L1_error)
4167 #ifndef CYTHON_WITHOUT_ASSERTIONS
4168 if (unlikely(!Py_OptimizeFlag)) {
4169 __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_v_range_start, Py_GT); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
4170 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
4171 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4172 if (unlikely(!__pyx_t_2)) {
4173 PyErr_SetNone(PyExc_AssertionError);
4174 __PYX_ERR(0, 88, __pyx_L1_error)
4186 __pyx_t_3 = PyNumber_Subtract(__pyx_v_range_end, __pyx_v_range_start);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
4187 __Pyx_GOTREF(__pyx_t_3);
4188 __pyx_v__rows = __pyx_t_3;
4198 #ifndef CYTHON_WITHOUT_ASSERTIONS
4199 if (unlikely(!Py_OptimizeFlag)) {
4200 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
4201 __Pyx_GOTREF(__pyx_t_3);
4202 __pyx_t_1 = PyObject_RichCompare(__pyx_v__rows, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4204 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
4205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4206 if (unlikely(!__pyx_t_2)) {
4207 PyErr_SetNone(PyExc_AssertionError);
4208 __PYX_ERR(0, 90, __pyx_L1_error)
4220 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4221 __Pyx_GOTREF(__pyx_t_1);
4222 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_end);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
4223 __Pyx_GOTREF(__pyx_t_3);
4224 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4225 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4226 __Pyx_GOTREF(__pyx_t_1);
4227 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_start);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
4228 __Pyx_GOTREF(__pyx_t_4);
4229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4230 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4231 __Pyx_GOTREF(__pyx_t_1);
4232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4233 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4234 __pyx_v_nnz = __pyx_t_1;
4244 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4245 __Pyx_GOTREF(__pyx_t_1);
4246 __pyx_t_4 = PyNumber_Add(__pyx_v_range_start, __pyx_v__rows);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4247 __Pyx_GOTREF(__pyx_t_4);
4248 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
4249 __Pyx_GOTREF(__pyx_t_3);
4250 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4251 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4252 __Pyx_GOTREF(__pyx_t_4);
4253 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4254 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4255 __pyx_v_rowptr = __pyx_t_4;
4265 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
4266 __Pyx_GOTREF(__pyx_t_4);
4267 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4268 __Pyx_GOTREF(__pyx_t_3);
4269 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
4270 __Pyx_GOTREF(__pyx_t_1);
4271 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4272 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4273 __Pyx_GOTREF(__pyx_t_3);
4274 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4275 __Pyx_GOTREF(__pyx_t_5);
4276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4277 __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4278 __Pyx_GOTREF(__pyx_t_3);
4279 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4280 __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4281 __Pyx_GOTREF(__pyx_t_5);
4282 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4284 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4285 __pyx_v_colind = __pyx_t_5;
4295 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
4296 __Pyx_GOTREF(__pyx_t_5);
4297 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4298 __Pyx_GOTREF(__pyx_t_3);
4299 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
4300 __Pyx_GOTREF(__pyx_t_1);
4301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4302 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4303 __Pyx_GOTREF(__pyx_t_3);
4304 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4305 __Pyx_GOTREF(__pyx_t_4);
4306 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4307 __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4308 __Pyx_GOTREF(__pyx_t_3);
4309 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4310 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4311 __Pyx_GOTREF(__pyx_t_4);
4312 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4314 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4315 __pyx_v_nzvals = __pyx_t_4;
4325 __Pyx_XDECREF(__pyx_r);
4326 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
4327 __Pyx_GOTREF(__pyx_t_4);
4328 __Pyx_INCREF(__pyx_v_rowptr);
4329 __Pyx_GIVEREF(__pyx_v_rowptr);
4330 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr);
4331 __Pyx_INCREF(__pyx_v_colind);
4332 __Pyx_GIVEREF(__pyx_v_colind);
4333 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind);
4334 __Pyx_INCREF(__pyx_v_nzvals);
4335 __Pyx_GIVEREF(__pyx_v_nzvals);
4336 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals);
4337 __pyx_r = __pyx_t_4;
4351 __Pyx_XDECREF(__pyx_t_1);
4352 __Pyx_XDECREF(__pyx_t_3);
4353 __Pyx_XDECREF(__pyx_t_4);
4354 __Pyx_XDECREF(__pyx_t_5);
4355 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4358 __Pyx_XDECREF(__pyx_v__rows);
4359 __Pyx_XDECREF(__pyx_v_nnz);
4360 __Pyx_XDECREF(__pyx_v_rowptr);
4361 __Pyx_XDECREF(__pyx_v_colind);
4362 __Pyx_XDECREF(__pyx_v_nzvals);
4363 __Pyx_XGIVEREF(__pyx_r);
4364 __Pyx_RefNannyFinishContext();
4377 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4378 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4382 __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
4383 __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
4384 __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
4385 int __pyx_lineno = 0;
4386 const char *__pyx_filename = NULL;
4387 int __pyx_clineno = 0;
4389 __Pyx_RefNannyDeclarations
4390 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
4392 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzval,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
4393 PyObject* values[6] = {0,0,0,0,0,0};
4394 if (unlikely(__pyx_kwds)) {
4396 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4398 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4400 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4402 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4404 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4406 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4408 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4411 default:
goto __pyx_L5_argtuple_error;
4413 kw_args = PyDict_Size(__pyx_kwds);
4416 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
4417 else goto __pyx_L5_argtuple_error;
4420 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
4422 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4426 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
4428 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4432 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzval)) != 0)) kw_args--;
4434 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4438 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4440 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4444 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4446 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 102, __pyx_L3_error)
4449 if (unlikely(kw_args > 0)) {
4450 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4452 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4453 goto __pyx_L5_argtuple_error;
4455 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4456 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4457 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4458 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4459 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4460 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4462 __pyx_v_nr = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nr == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
4463 __pyx_v_nc = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nc == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
4464 __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nnz == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
4465 __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
4466 __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
4467 __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
4469 goto __pyx_L4_argument_unpacking_done;
4470 __pyx_L5_argtuple_error:;
4471 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4473 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4474 __Pyx_RefNannyFinishContext();
4476 __pyx_L4_argument_unpacking_done:;
4477 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
4480 __Pyx_RefNannyFinishContext();
4484 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self,
int __pyx_v_nr,
int __pyx_v_nc,
int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
4486 __Pyx_RefNannyDeclarations
4487 Py_ssize_t __pyx_t_1;
4488 __Pyx_RefNannySetupContext(
"__cinit__", 0);
4497 (__pyx_v_self->dim[0]) = __pyx_v_nr;
4498 (__pyx_v_self->dim[1]) = __pyx_v_nc;
4507 __pyx_v_self->A.nnz = __pyx_v_nnz;
4517 __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
4527 __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( (__pyx_v_colind.data + __pyx_t_1 * __pyx_v_colind.strides[0]) ))));
4537 __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( (__pyx_v_rowptr.data + __pyx_t_1 * __pyx_v_rowptr.strides[0]) ))));
4549 __PYX_XDEC_MEMVIEW(&__pyx_v_nzval, 1);
4550 __PYX_XDEC_MEMVIEW(&__pyx_v_colind, 1);
4551 __PYX_XDEC_MEMVIEW(&__pyx_v_rowptr, 1);
4552 __Pyx_RefNannyFinishContext();
4563 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4564 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4565 PyObject *__pyx_r = 0;
4566 __Pyx_RefNannyDeclarations
4567 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4568 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
4571 __Pyx_RefNannyFinishContext();
4575 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
4576 PyObject *__pyx_r = NULL;
4577 __Pyx_RefNannyDeclarations
4578 PyObject *__pyx_t_1 = NULL;
4579 int __pyx_lineno = 0;
4580 const char *__pyx_filename = NULL;
4581 int __pyx_clineno = 0;
4582 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4590 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4591 __Pyx_GOTREF(__pyx_t_1);
4592 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4593 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4594 __PYX_ERR(1, 2, __pyx_L1_error)
4604 __Pyx_XDECREF(__pyx_t_1);
4605 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4607 __Pyx_XGIVEREF(__pyx_r);
4608 __Pyx_RefNannyFinishContext();
4620 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4621 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4622 PyObject *__pyx_r = 0;
4623 __Pyx_RefNannyDeclarations
4624 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4625 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4628 __Pyx_RefNannyFinishContext();
4632 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4633 PyObject *__pyx_r = NULL;
4634 __Pyx_RefNannyDeclarations
4635 PyObject *__pyx_t_1 = NULL;
4636 int __pyx_lineno = 0;
4637 const char *__pyx_filename = NULL;
4638 int __pyx_clineno = 0;
4639 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4646 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4647 __Pyx_GOTREF(__pyx_t_1);
4648 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4649 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4650 __PYX_ERR(1, 4, __pyx_L1_error)
4661 __Pyx_XDECREF(__pyx_t_1);
4662 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4664 __Pyx_XGIVEREF(__pyx_r);
4665 __Pyx_RefNannyFinishContext();
4677 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
4678 __pyx_t_5numpy_float64_t __pyx_v_tmp;
4681 __Pyx_RefNannyDeclarations
4682 __pyx_t_5numpy_int32_t __pyx_t_1;
4683 __pyx_t_5numpy_int32_t __pyx_t_2;
4685 __pyx_t_5numpy_int32_t __pyx_t_4;
4686 __pyx_t_5numpy_int32_t __pyx_t_5;
4688 Py_ssize_t __pyx_t_7;
4689 __Pyx_RefNannySetupContext(
"SparseMatrix_matvec", 0);
4707 __pyx_t_1 = (__pyx_v_sm->dim[0]);
4708 __pyx_t_2 = __pyx_t_1;
4709 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4710 __pyx_v_i = __pyx_t_3;
4728 __pyx_t_4 = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
4729 __pyx_t_5 = __pyx_t_4;
4730 for (__pyx_t_6 = (__pyx_v_sm->A.rowptr[__pyx_v_i]); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4731 __pyx_v_k = __pyx_t_6;
4740 __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
4741 __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
4751 __pyx_t_7 = __pyx_v_i;
4752 *((__pyx_t_5numpy_float64_t *) ( (__pyx_v_yp.data + __pyx_t_7 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
4764 __Pyx_RefNannyFinishContext();
4776 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4777 static char __pyx_doc_15superluWrappers_12SparseFactor___init__[] =
"\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ";
4778 #if CYTHON_UPDATE_DESCRIPTOR_DOC
4779 struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
4781 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4782 PyObject *__pyx_v_dim = 0;
4783 int __pyx_lineno = 0;
4784 const char *__pyx_filename = NULL;
4785 int __pyx_clineno = 0;
4787 __Pyx_RefNannyDeclarations
4788 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4790 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0};
4791 PyObject* values[1] = {0};
4792 if (unlikely(__pyx_kwds)) {
4794 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4796 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4799 default:
goto __pyx_L5_argtuple_error;
4801 kw_args = PyDict_Size(__pyx_kwds);
4804 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
4805 else goto __pyx_L5_argtuple_error;
4807 if (unlikely(kw_args > 0)) {
4808 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 170, __pyx_L3_error)
4810 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4811 goto __pyx_L5_argtuple_error;
4813 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4815 __pyx_v_dim = values[0];
4817 goto __pyx_L4_argument_unpacking_done;
4818 __pyx_L5_argtuple_error:;
4819 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error)
4821 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4822 __Pyx_RefNannyFinishContext();
4824 __pyx_L4_argument_unpacking_done:;
4825 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
4828 __Pyx_RefNannyFinishContext();
4832 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
4834 __Pyx_RefNannyDeclarations
4835 PyObject *__pyx_t_1 = NULL;
4837 __pyx_t_5numpy_int32_t __pyx_t_3;
4838 PyObject *__pyx_t_4 = NULL;
4840 int __pyx_lineno = 0;
4841 const char *__pyx_filename = NULL;
4842 int __pyx_clineno = 0;
4843 __Pyx_RefNannySetupContext(
"__init__", 0);
4852 StatInit((&__pyx_v_self->stat));
4861 set_default_options((&__pyx_v_self->options));
4870 __pyx_t_1 = ((
struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4871 __Pyx_GOTREF(__pyx_t_1);
4872 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4881 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
4882 __pyx_v_self->dim = __pyx_t_2;
4891 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4892 __pyx_v_self->A.nrow = __pyx_t_2;
4893 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4894 __pyx_v_self->A.ncol = __pyx_t_2;
4903 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4904 __pyx_v_self->AC.nrow = __pyx_t_2;
4905 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4906 __pyx_v_self->AC.ncol = __pyx_t_2;
4915 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4916 __pyx_v_self->L.nrow = __pyx_t_2;
4917 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4918 __pyx_v_self->L.ncol = __pyx_t_2;
4927 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4928 __pyx_v_self->U.nrow = __pyx_t_2;
4929 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4930 __pyx_v_self->U.ncol = __pyx_t_2;
4939 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4940 __pyx_v_self->X.nrow = __pyx_t_2;
4941 __pyx_v_self->X.ncol = 1;
4950 __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_dim);
if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4951 __pyx_v_self->storeX.lda = __pyx_t_3;
4960 __pyx_v_self->use_same_perm_c = 0;
4969 __pyx_v_self->use_same_sparsity = 0;
4978 __pyx_t_1 = __Pyx_PyInt_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
4979 __Pyx_GOTREF(__pyx_t_1);
4980 __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
4981 __Pyx_GOTREF(__pyx_t_4);
4982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4983 __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
4984 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4985 __pyx_v_self->perm_c = ((
int *)malloc(__pyx_t_5));
4994 __pyx_t_4 = __Pyx_PyInt_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
4995 __Pyx_GOTREF(__pyx_t_4);
4996 __pyx_t_1 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
4997 __Pyx_GOTREF(__pyx_t_1);
4998 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4999 __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error)
5000 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5001 __pyx_v_self->perm_r = ((
int *)malloc(__pyx_t_5));
5010 __pyx_t_1 = __Pyx_PyInt_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
5011 __Pyx_GOTREF(__pyx_t_1);
5012 __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
5013 __Pyx_GOTREF(__pyx_t_4);
5014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5015 __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
5016 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5017 __pyx_v_self->etree = ((
int *)malloc(__pyx_t_5));
5031 __Pyx_XDECREF(__pyx_t_1);
5032 __Pyx_XDECREF(__pyx_t_4);
5033 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5036 __Pyx_RefNannyFinishContext();
5048 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5049 PyObject *__pyx_r = NULL;
5050 __Pyx_RefNannyDeclarations
5051 __Pyx_RefNannySetupContext(
"_set_mat_types", 0);
5060 __pyx_v_self->A.Stype = SLU_NC;
5069 __pyx_v_self->A.Dtype = SLU_D;
5078 __pyx_v_self->A.Mtype = SLU_GE;
5087 __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
5096 __pyx_v_self->AC.Stype = SLU_NCP;
5105 __pyx_v_self->AC.Dtype = SLU_D;
5114 __pyx_v_self->AC.Mtype = SLU_GE;
5123 __pyx_v_self->AC.Store = NULL;
5132 __pyx_v_self->L.Stype = SLU_NC;
5141 __pyx_v_self->L.Dtype = SLU_D;
5150 __pyx_v_self->L.Mtype = SLU_TRLU;
5159 __pyx_v_self->L.Store = NULL;
5168 __pyx_v_self->U.Stype = SLU_NC;
5177 __pyx_v_self->U.Dtype = SLU_D;
5186 __pyx_v_self->U.Mtype = SLU_TRU;
5195 __pyx_v_self->U.Store = NULL;
5204 __pyx_v_self->X.Stype = SLU_DN;
5213 __pyx_v_self->X.Dtype = SLU_D;
5222 __pyx_v_self->X.Mtype = SLU_GE;
5231 __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
5242 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5243 __Pyx_XGIVEREF(__pyx_r);
5244 __Pyx_RefNannyFinishContext();
5257 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self);
5258 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
5259 PyObject *__pyx_r = 0;
5260 __Pyx_RefNannyDeclarations
5261 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5262 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5265 __Pyx_RefNannyFinishContext();
5269 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5270 PyObject *__pyx_r = NULL;
5271 __Pyx_RefNannyDeclarations
5272 PyObject *__pyx_t_1 = NULL;
5273 int __pyx_lineno = 0;
5274 const char *__pyx_filename = NULL;
5275 int __pyx_clineno = 0;
5276 __Pyx_RefNannySetupContext(
"__get__", 0);
5277 __Pyx_XDECREF(__pyx_r);
5278 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5279 __Pyx_GOTREF(__pyx_t_1);
5280 __pyx_r = __pyx_t_1;
5286 __Pyx_XDECREF(__pyx_t_1);
5287 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5290 __Pyx_XGIVEREF(__pyx_r);
5291 __Pyx_RefNannyFinishContext();
5296 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
5297 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5299 __Pyx_RefNannyDeclarations
5300 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
5301 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5304 __Pyx_RefNannyFinishContext();
5308 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
5310 __Pyx_RefNannyDeclarations
5312 int __pyx_lineno = 0;
5313 const char *__pyx_filename = NULL;
5314 int __pyx_clineno = 0;
5315 __Pyx_RefNannySetupContext(
"__set__", 0);
5316 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
5317 __pyx_v_self->dim = __pyx_t_1;
5323 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5326 __Pyx_RefNannyFinishContext();
5337 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5338 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5339 PyObject *__pyx_r = 0;
5340 __Pyx_RefNannyDeclarations
5341 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5342 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5345 __Pyx_RefNannyFinishContext();
5349 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5350 PyObject *__pyx_r = NULL;
5351 __Pyx_RefNannyDeclarations
5352 PyObject *__pyx_t_1 = NULL;
5353 int __pyx_lineno = 0;
5354 const char *__pyx_filename = NULL;
5355 int __pyx_clineno = 0;
5356 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5364 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5365 __Pyx_GOTREF(__pyx_t_1);
5366 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5367 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5368 __PYX_ERR(1, 2, __pyx_L1_error)
5378 __Pyx_XDECREF(__pyx_t_1);
5379 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5381 __Pyx_XGIVEREF(__pyx_r);
5382 __Pyx_RefNannyFinishContext();
5394 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5395 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5396 PyObject *__pyx_r = 0;
5397 __Pyx_RefNannyDeclarations
5398 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5399 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5402 __Pyx_RefNannyFinishContext();
5406 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5407 PyObject *__pyx_r = NULL;
5408 __Pyx_RefNannyDeclarations
5409 PyObject *__pyx_t_1 = NULL;
5410 int __pyx_lineno = 0;
5411 const char *__pyx_filename = NULL;
5412 int __pyx_clineno = 0;
5413 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5420 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5421 __Pyx_GOTREF(__pyx_t_1);
5422 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5424 __PYX_ERR(1, 4, __pyx_L1_error)
5435 __Pyx_XDECREF(__pyx_t_1);
5436 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5438 __Pyx_XGIVEREF(__pyx_r);
5439 __Pyx_RefNannyFinishContext();
5452 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5453 static char __pyx_doc_15superluWrappers_sparseFactorPrepare[] =
" Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ";
5454 static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {
"sparseFactorPrepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_1sparseFactorPrepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
5455 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5456 PyObject *__pyx_v_sparse_matrix = 0;
5457 PyObject *__pyx_v_sparseFactor = 0;
5458 int __pyx_lineno = 0;
5459 const char *__pyx_filename = NULL;
5460 int __pyx_clineno = 0;
5461 PyObject *__pyx_r = 0;
5462 __Pyx_RefNannyDeclarations
5463 __Pyx_RefNannySetupContext(
"sparseFactorPrepare (wrapper)", 0);
5465 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparse_matrix,&__pyx_n_s_sparseFactor,0};
5466 PyObject* values[2] = {0,0};
5467 if (unlikely(__pyx_kwds)) {
5469 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5471 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5473 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5476 default:
goto __pyx_L5_argtuple_error;
5478 kw_args = PyDict_Size(__pyx_kwds);
5481 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_matrix)) != 0)) kw_args--;
5482 else goto __pyx_L5_argtuple_error;
5485 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5487 __Pyx_RaiseArgtupleInvalid(
"sparseFactorPrepare", 1, 2, 2, 1); __PYX_ERR(0, 219, __pyx_L3_error)
5490 if (unlikely(kw_args > 0)) {
5491 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sparseFactorPrepare") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
5493 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5494 goto __pyx_L5_argtuple_error;
5496 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5497 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5499 __pyx_v_sparse_matrix = values[0];
5500 __pyx_v_sparseFactor = values[1];
5502 goto __pyx_L4_argument_unpacking_done;
5503 __pyx_L5_argtuple_error:;
5504 __Pyx_RaiseArgtupleInvalid(
"sparseFactorPrepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
5506 __Pyx_AddTraceback(
"superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5507 __Pyx_RefNannyFinishContext();
5509 __pyx_L4_argument_unpacking_done:;
5510 __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
5513 __Pyx_RefNannyFinishContext();
5517 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
5518 PyObject *__pyx_r = NULL;
5519 __Pyx_RefNannyDeclarations
5520 PyObject *__pyx_t_1 = NULL;
5521 int __pyx_lineno = 0;
5522 const char *__pyx_filename = NULL;
5523 int __pyx_clineno = 0;
5524 __Pyx_RefNannySetupContext(
"sparseFactorPrepare", 0);
5533 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5534 __Pyx_GOTREF(__pyx_t_1);
5535 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5544 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 230, __pyx_L1_error)
5553 __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor));
5554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5565 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5568 __Pyx_XDECREF(__pyx_t_1);
5569 __Pyx_AddTraceback(
"superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5572 __Pyx_XGIVEREF(__pyx_r);
5573 __Pyx_RefNannyFinishContext();
5585 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
5586 int __pyx_v_permc_spec;
5589 int __pyx_v_panel_size;
5593 PyObject *__pyx_v_i = NULL;
5594 __Pyx_RefNannyDeclarations
5595 __pyx_t_5numpy_int32_t __pyx_t_1;
5598 PyObject *__pyx_t_4 = NULL;
5599 PyObject *__pyx_t_5 = NULL;
5600 Py_ssize_t __pyx_t_6;
5601 PyObject *(*__pyx_t_7)(PyObject *);
5602 Py_ssize_t __pyx_t_8;
5603 Py_ssize_t __pyx_t_9;
5604 int __pyx_lineno = 0;
5605 const char *__pyx_filename = NULL;
5606 int __pyx_clineno = 0;
5607 __Pyx_RefNannySetupContext(
"superluWrappersSparseFactorPrepare", 0);
5616 __pyx_v_permc_spec = 3;
5634 __pyx_v_panel_size = 10;
5661 __pyx_v_work = NULL;
5670 __pyx_t_1 = __pyx_v_sm->A.nnz;
5671 __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
5680 __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
5689 __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
5698 __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
5707 __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_perm_c == 0) != 0);
5717 get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
5726 __pyx_v_sparseFactor->use_same_perm_c = 1;
5744 __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_sparsity == 0) != 0);
5754 __pyx_t_2 = ((__pyx_v_sparseFactor->AC.Store != NULL) != 0);
5764 Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
5773 Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
5782 Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
5800 sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
5809 __pyx_v_sparseFactor->use_same_sparsity = 1;
5829 __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
5838 __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
5839 __pyx_v_n = __pyx_t_3;
5848 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5849 __Pyx_GOTREF(__pyx_t_4);
5850 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5851 __Pyx_GOTREF(__pyx_t_5);
5852 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5853 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
5854 __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
5857 __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5858 __Pyx_GOTREF(__pyx_t_4);
5859 __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
5861 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5863 if (likely(!__pyx_t_7)) {
5864 if (likely(PyList_CheckExact(__pyx_t_4))) {
5865 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4))
break;
5866 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5867 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5869 __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5870 __Pyx_GOTREF(__pyx_t_5);
5873 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
5874 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5875 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5877 __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5878 __Pyx_GOTREF(__pyx_t_5);
5882 __pyx_t_5 = __pyx_t_7(__pyx_t_4);
5883 if (unlikely(!__pyx_t_5)) {
5884 PyObject* exc_type = PyErr_Occurred();
5886 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5887 else __PYX_ERR(0, 268, __pyx_L1_error)
5891 __Pyx_GOTREF(__pyx_t_5);
5893 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
5903 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5904 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5905 (((
struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((
struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5914 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
5915 __Pyx_GOTREF(__pyx_t_5);
5916 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5917 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5918 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5919 (((
struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((
struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5929 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5940 dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5953 __Pyx_XDECREF(__pyx_t_4);
5954 __Pyx_XDECREF(__pyx_t_5);
5955 __Pyx_WriteUnraisable(
"superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5957 __Pyx_XDECREF(__pyx_v_i);
5958 __Pyx_RefNannyFinishContext();
5970 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5971 static char __pyx_doc_15superluWrappers_2sparseFactorSolve[] =
" Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ";
5972 static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {
"sparseFactorSolve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_3sparseFactorSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
5973 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5974 PyObject *__pyx_v_sparseFactor = 0;
5975 PyObject *__pyx_v_x = 0;
5976 int __pyx_lineno = 0;
5977 const char *__pyx_filename = NULL;
5978 int __pyx_clineno = 0;
5979 PyObject *__pyx_r = 0;
5980 __Pyx_RefNannyDeclarations
5981 __Pyx_RefNannySetupContext(
"sparseFactorSolve (wrapper)", 0);
5983 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparseFactor,&__pyx_n_s_x,0};
5984 PyObject* values[2] = {0,0};
5985 if (unlikely(__pyx_kwds)) {
5987 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5989 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5991 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5994 default:
goto __pyx_L5_argtuple_error;
5996 kw_args = PyDict_Size(__pyx_kwds);
5999 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
6000 else goto __pyx_L5_argtuple_error;
6003 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6005 __Pyx_RaiseArgtupleInvalid(
"sparseFactorSolve", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
6008 if (unlikely(kw_args > 0)) {
6009 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sparseFactorSolve") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
6011 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6012 goto __pyx_L5_argtuple_error;
6014 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6015 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6017 __pyx_v_sparseFactor = values[0];
6018 __pyx_v_x = values[1];
6020 goto __pyx_L4_argument_unpacking_done;
6021 __pyx_L5_argtuple_error:;
6022 __Pyx_RaiseArgtupleInvalid(
"sparseFactorSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error)
6024 __Pyx_AddTraceback(
"superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6025 __Pyx_RefNannyFinishContext();
6027 __pyx_L4_argument_unpacking_done:;
6028 __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
6031 __Pyx_RefNannyFinishContext();
6035 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
6036 PyObject *__pyx_r = NULL;
6037 __Pyx_RefNannyDeclarations
6038 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
6039 int __pyx_lineno = 0;
6040 const char *__pyx_filename = NULL;
6041 int __pyx_clineno = 0;
6042 __Pyx_RefNannySetupContext(
"sparseFactorSolve", 0);
6051 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 296, __pyx_L1_error)
6060 __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
6069 __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1);
6070 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
6071 __pyx_t_1.memview = NULL;
6072 __pyx_t_1.data = NULL;
6083 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6086 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
6087 __Pyx_AddTraceback(
"superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6090 __Pyx_XGIVEREF(__pyx_r);
6091 __Pyx_RefNannyFinishContext();
6103 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
6104 trans_t __pyx_v_trans;
6106 __Pyx_RefNannyDeclarations
6107 Py_ssize_t __pyx_t_1;
6108 __Pyx_RefNannySetupContext(
"superluWrappersSparseFactorSolve", 0);
6117 __pyx_v_trans = TRANS;
6136 __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
6145 dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
6156 __Pyx_RefNannyFinishContext();
6167 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6168 PyObject *__pyx_r = NULL;
6169 __Pyx_RefNannyDeclarations
6170 PyObject *__pyx_t_1 = NULL;
6171 int __pyx_lineno = 0;
6172 const char *__pyx_filename = NULL;
6173 int __pyx_clineno = 0;
6174 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
6183 __Pyx_XDECREF(__pyx_r);
6184 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
6185 __Pyx_GOTREF(__pyx_t_1);
6186 __pyx_r = __pyx_t_1;
6200 __Pyx_XDECREF(__pyx_t_1);
6201 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6204 __Pyx_XGIVEREF(__pyx_r);
6205 __Pyx_RefNannyFinishContext();
6217 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6218 PyObject *__pyx_r = NULL;
6219 __Pyx_RefNannyDeclarations
6220 PyObject *__pyx_t_1 = NULL;
6221 int __pyx_lineno = 0;
6222 const char *__pyx_filename = NULL;
6223 int __pyx_clineno = 0;
6224 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
6233 __Pyx_XDECREF(__pyx_r);
6234 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
6235 __Pyx_GOTREF(__pyx_t_1);
6236 __pyx_r = __pyx_t_1;
6250 __Pyx_XDECREF(__pyx_t_1);
6251 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6254 __Pyx_XGIVEREF(__pyx_r);
6255 __Pyx_RefNannyFinishContext();
6267 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6268 PyObject *__pyx_r = NULL;
6269 __Pyx_RefNannyDeclarations
6270 PyObject *__pyx_t_1 = NULL;
6271 int __pyx_lineno = 0;
6272 const char *__pyx_filename = NULL;
6273 int __pyx_clineno = 0;
6274 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
6283 __Pyx_XDECREF(__pyx_r);
6284 __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, 742, __pyx_L1_error)
6285 __Pyx_GOTREF(__pyx_t_1);
6286 __pyx_r = __pyx_t_1;
6300 __Pyx_XDECREF(__pyx_t_1);
6301 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6304 __Pyx_XGIVEREF(__pyx_r);
6305 __Pyx_RefNannyFinishContext();
6317 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) {
6318 PyObject *__pyx_r = NULL;
6319 __Pyx_RefNannyDeclarations
6320 PyObject *__pyx_t_1 = NULL;
6321 int __pyx_lineno = 0;
6322 const char *__pyx_filename = NULL;
6323 int __pyx_clineno = 0;
6324 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6333 __Pyx_XDECREF(__pyx_r);
6334 __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, 745, __pyx_L1_error)
6335 __Pyx_GOTREF(__pyx_t_1);
6336 __pyx_r = __pyx_t_1;
6350 __Pyx_XDECREF(__pyx_t_1);
6351 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6354 __Pyx_XGIVEREF(__pyx_r);
6355 __Pyx_RefNannyFinishContext();
6367 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) {
6368 PyObject *__pyx_r = NULL;
6369 __Pyx_RefNannyDeclarations
6370 PyObject *__pyx_t_1 = NULL;
6371 int __pyx_lineno = 0;
6372 const char *__pyx_filename = NULL;
6373 int __pyx_clineno = 0;
6374 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
6383 __Pyx_XDECREF(__pyx_r);
6384 __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, 748, __pyx_L1_error)
6385 __Pyx_GOTREF(__pyx_t_1);
6386 __pyx_r = __pyx_t_1;
6400 __Pyx_XDECREF(__pyx_t_1);
6401 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6404 __Pyx_XGIVEREF(__pyx_r);
6405 __Pyx_RefNannyFinishContext();
6417 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6418 PyObject *__pyx_r = NULL;
6419 __Pyx_RefNannyDeclarations
6421 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
6430 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6440 __Pyx_XDECREF(__pyx_r);
6441 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6442 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6462 __Pyx_XDECREF(__pyx_r);
6463 __Pyx_INCREF(__pyx_empty_tuple);
6464 __pyx_r = __pyx_empty_tuple;
6478 __Pyx_XGIVEREF(__pyx_r);
6479 __Pyx_RefNannyFinishContext();
6491 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
6492 __Pyx_RefNannyDeclarations
6493 __Pyx_RefNannySetupContext(
"set_array_base", 0);
6502 Py_INCREF(__pyx_v_base);
6511 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6522 __Pyx_RefNannyFinishContext();
6533 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
6534 PyObject *__pyx_v_base;
6535 PyObject *__pyx_r = NULL;
6536 __Pyx_RefNannyDeclarations
6538 __Pyx_RefNannySetupContext(
"get_array_base", 0);
6547 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6556 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
6566 __Pyx_XDECREF(__pyx_r);
6567 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6586 __Pyx_XDECREF(__pyx_r);
6587 __Pyx_INCREF(((PyObject *)__pyx_v_base));
6588 __pyx_r = ((PyObject *)__pyx_v_base);
6601 __Pyx_XGIVEREF(__pyx_r);
6602 __Pyx_RefNannyFinishContext();
6614 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
6616 __Pyx_RefNannyDeclarations
6617 PyObject *__pyx_t_1 = NULL;
6618 PyObject *__pyx_t_2 = NULL;
6619 PyObject *__pyx_t_3 = NULL;
6621 PyObject *__pyx_t_5 = NULL;
6622 PyObject *__pyx_t_6 = NULL;
6623 PyObject *__pyx_t_7 = NULL;
6624 PyObject *__pyx_t_8 = NULL;
6625 int __pyx_lineno = 0;
6626 const char *__pyx_filename = NULL;
6627 int __pyx_clineno = 0;
6628 __Pyx_RefNannySetupContext(
"import_array", 0);
6638 __Pyx_PyThreadState_declare
6639 __Pyx_PyThreadState_assign
6640 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6641 __Pyx_XGOTREF(__pyx_t_1);
6642 __Pyx_XGOTREF(__pyx_t_2);
6643 __Pyx_XGOTREF(__pyx_t_3);
6653 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
6663 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6664 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6665 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6666 goto __pyx_L8_try_end;
6676 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6678 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6679 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
6680 __Pyx_GOTREF(__pyx_t_5);
6681 __Pyx_GOTREF(__pyx_t_6);
6682 __Pyx_GOTREF(__pyx_t_7);
6691 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
6692 __Pyx_GOTREF(__pyx_t_8);
6693 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6694 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6695 __PYX_ERR(2, 945, __pyx_L5_except_error)
6697 goto __pyx_L5_except_error;
6698 __pyx_L5_except_error:;
6707 __Pyx_XGIVEREF(__pyx_t_1);
6708 __Pyx_XGIVEREF(__pyx_t_2);
6709 __Pyx_XGIVEREF(__pyx_t_3);
6710 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6711 goto __pyx_L1_error;
6727 __Pyx_XDECREF(__pyx_t_5);
6728 __Pyx_XDECREF(__pyx_t_6);
6729 __Pyx_XDECREF(__pyx_t_7);
6730 __Pyx_XDECREF(__pyx_t_8);
6731 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6734 __Pyx_RefNannyFinishContext();
6746 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
6748 __Pyx_RefNannyDeclarations
6749 PyObject *__pyx_t_1 = NULL;
6750 PyObject *__pyx_t_2 = NULL;
6751 PyObject *__pyx_t_3 = NULL;
6753 PyObject *__pyx_t_5 = NULL;
6754 PyObject *__pyx_t_6 = NULL;
6755 PyObject *__pyx_t_7 = NULL;
6756 PyObject *__pyx_t_8 = NULL;
6757 int __pyx_lineno = 0;
6758 const char *__pyx_filename = NULL;
6759 int __pyx_clineno = 0;
6760 __Pyx_RefNannySetupContext(
"import_umath", 0);
6770 __Pyx_PyThreadState_declare
6771 __Pyx_PyThreadState_assign
6772 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6773 __Pyx_XGOTREF(__pyx_t_1);
6774 __Pyx_XGOTREF(__pyx_t_2);
6775 __Pyx_XGOTREF(__pyx_t_3);
6785 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
6795 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6796 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6797 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6798 goto __pyx_L8_try_end;
6808 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6810 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6811 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
6812 __Pyx_GOTREF(__pyx_t_5);
6813 __Pyx_GOTREF(__pyx_t_6);
6814 __Pyx_GOTREF(__pyx_t_7);
6823 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
6824 __Pyx_GOTREF(__pyx_t_8);
6825 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6826 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6827 __PYX_ERR(2, 951, __pyx_L5_except_error)
6829 goto __pyx_L5_except_error;
6830 __pyx_L5_except_error:;
6839 __Pyx_XGIVEREF(__pyx_t_1);
6840 __Pyx_XGIVEREF(__pyx_t_2);
6841 __Pyx_XGIVEREF(__pyx_t_3);
6842 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6843 goto __pyx_L1_error;
6859 __Pyx_XDECREF(__pyx_t_5);
6860 __Pyx_XDECREF(__pyx_t_6);
6861 __Pyx_XDECREF(__pyx_t_7);
6862 __Pyx_XDECREF(__pyx_t_8);
6863 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6866 __Pyx_RefNannyFinishContext();
6878 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
6880 __Pyx_RefNannyDeclarations
6881 PyObject *__pyx_t_1 = NULL;
6882 PyObject *__pyx_t_2 = NULL;
6883 PyObject *__pyx_t_3 = NULL;
6885 PyObject *__pyx_t_5 = NULL;
6886 PyObject *__pyx_t_6 = NULL;
6887 PyObject *__pyx_t_7 = NULL;
6888 PyObject *__pyx_t_8 = NULL;
6889 int __pyx_lineno = 0;
6890 const char *__pyx_filename = NULL;
6891 int __pyx_clineno = 0;
6892 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
6902 __Pyx_PyThreadState_declare
6903 __Pyx_PyThreadState_assign
6904 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6905 __Pyx_XGOTREF(__pyx_t_1);
6906 __Pyx_XGOTREF(__pyx_t_2);
6907 __Pyx_XGOTREF(__pyx_t_3);
6917 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
6927 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6928 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6929 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6930 goto __pyx_L8_try_end;
6940 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6942 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6943 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
6944 __Pyx_GOTREF(__pyx_t_5);
6945 __Pyx_GOTREF(__pyx_t_6);
6946 __Pyx_GOTREF(__pyx_t_7);
6955 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
6956 __Pyx_GOTREF(__pyx_t_8);
6957 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6958 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6959 __PYX_ERR(2, 957, __pyx_L5_except_error)
6961 goto __pyx_L5_except_error;
6962 __pyx_L5_except_error:;
6971 __Pyx_XGIVEREF(__pyx_t_1);
6972 __Pyx_XGIVEREF(__pyx_t_2);
6973 __Pyx_XGIVEREF(__pyx_t_3);
6974 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6975 goto __pyx_L1_error;
6991 __Pyx_XDECREF(__pyx_t_5);
6992 __Pyx_XDECREF(__pyx_t_6);
6993 __Pyx_XDECREF(__pyx_t_7);
6994 __Pyx_XDECREF(__pyx_t_8);
6995 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6998 __Pyx_RefNannyFinishContext();
7010 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7012 __Pyx_RefNannyDeclarations
7013 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
7022 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7035 __Pyx_RefNannyFinishContext();
7047 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7049 __Pyx_RefNannyDeclarations
7050 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
7059 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7072 __Pyx_RefNannyFinishContext();
7084 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
7085 npy_datetime __pyx_r;
7094 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
7118 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7119 npy_timedelta __pyx_r;
7128 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7152 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7153 NPY_DATETIMEUNIT __pyx_r;
7160 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
7185 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7186 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7187 PyObject *__pyx_v_shape = 0;
7188 Py_ssize_t __pyx_v_itemsize;
7189 PyObject *__pyx_v_format = 0;
7190 PyObject *__pyx_v_mode = 0;
7191 int __pyx_v_allocate_buffer;
7192 int __pyx_lineno = 0;
7193 const char *__pyx_filename = NULL;
7194 int __pyx_clineno = 0;
7196 __Pyx_RefNannyDeclarations
7197 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7199 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7200 PyObject* values[5] = {0,0,0,0,0};
7201 values[3] = ((PyObject *)__pyx_n_s_c);
7202 if (unlikely(__pyx_kwds)) {
7204 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7206 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7208 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7210 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7212 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7214 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7217 default:
goto __pyx_L5_argtuple_error;
7219 kw_args = PyDict_Size(__pyx_kwds);
7222 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7223 else goto __pyx_L5_argtuple_error;
7226 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7228 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7232 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7234 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7239 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7240 if (value) { values[3] = value; kw_args--; }
7245 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7246 if (value) { values[4] = value; kw_args--; }
7249 if (unlikely(kw_args > 0)) {
7250 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
7253 switch (PyTuple_GET_SIZE(__pyx_args)) {
7254 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7256 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7258 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7259 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7260 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7262 default:
goto __pyx_L5_argtuple_error;
7265 __pyx_v_shape = ((PyObject*)values[0]);
7266 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
7267 __pyx_v_format = values[2];
7268 __pyx_v_mode = values[3];
7270 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7280 __pyx_v_allocate_buffer = ((int)1);
7283 goto __pyx_L4_argument_unpacking_done;
7284 __pyx_L5_argtuple_error:;
7285 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
7287 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7288 __Pyx_RefNannyFinishContext();
7290 __pyx_L4_argument_unpacking_done:;
7291 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
7292 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7293 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
7295 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7310 __Pyx_RefNannyFinishContext();
7314 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
7316 Py_ssize_t __pyx_v_i;
7317 Py_ssize_t __pyx_v_dim;
7318 PyObject **__pyx_v_p;
7321 __Pyx_RefNannyDeclarations
7322 Py_ssize_t __pyx_t_1;
7324 PyObject *__pyx_t_3 = NULL;
7326 PyObject *__pyx_t_5 = NULL;
7327 PyObject *__pyx_t_6 = NULL;
7330 Py_ssize_t __pyx_t_9;
7331 PyObject *__pyx_t_10 = NULL;
7332 Py_ssize_t __pyx_t_11;
7333 int __pyx_lineno = 0;
7334 const char *__pyx_filename = NULL;
7335 int __pyx_clineno = 0;
7336 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7337 __Pyx_INCREF(__pyx_v_format);
7346 if (unlikely(__pyx_v_shape == Py_None)) {
7347 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
7348 __PYX_ERR(1, 129, __pyx_L1_error)
7350 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
7351 __pyx_v_self->ndim = ((int)__pyx_t_1);
7360 __pyx_v_self->itemsize = __pyx_v_itemsize;
7369 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7370 if (unlikely(__pyx_t_2)) {
7379 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
7380 __Pyx_GOTREF(__pyx_t_3);
7381 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7382 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7383 __PYX_ERR(1, 133, __pyx_L1_error)
7401 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7402 if (unlikely(__pyx_t_2)) {
7411 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
7412 __Pyx_GOTREF(__pyx_t_3);
7413 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7415 __PYX_ERR(1, 136, __pyx_L1_error)
7433 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7434 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7444 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
7445 __Pyx_GOTREF(__pyx_t_5);
7447 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7448 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7449 if (likely(__pyx_t_6)) {
7450 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7451 __Pyx_INCREF(__pyx_t_6);
7452 __Pyx_INCREF(
function);
7453 __Pyx_DECREF_SET(__pyx_t_5,
function);
7456 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7457 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7458 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
7459 __Pyx_GOTREF(__pyx_t_3);
7460 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7461 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7480 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
7481 __pyx_t_3 = __pyx_v_format;
7482 __Pyx_INCREF(__pyx_t_3);
7483 __Pyx_GIVEREF(__pyx_t_3);
7484 __Pyx_GOTREF(__pyx_v_self->_format);
7485 __Pyx_DECREF(__pyx_v_self->_format);
7486 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7496 if (unlikely(__pyx_v_self->_format == Py_None)) {
7497 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
7498 __PYX_ERR(1, 141, __pyx_L1_error)
7500 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
7501 __pyx_v_self->format = __pyx_t_7;
7510 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7519 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7528 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7529 if (unlikely(__pyx_t_4)) {
7538 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
7539 __Pyx_GOTREF(__pyx_t_3);
7540 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7541 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7542 __PYX_ERR(1, 148, __pyx_L1_error)
7561 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7563 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
7564 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7565 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
7567 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
7568 __Pyx_GOTREF(__pyx_t_5);
7570 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
7571 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7572 __pyx_v_dim = __pyx_t_9;
7573 __pyx_v_idx = __pyx_t_8;
7574 __pyx_t_8 = (__pyx_t_8 + 1);
7583 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7584 if (unlikely(__pyx_t_4)) {
7593 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
7594 __Pyx_GOTREF(__pyx_t_5);
7595 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7596 __Pyx_GOTREF(__pyx_t_6);
7597 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7598 __Pyx_GOTREF(__pyx_t_10);
7599 __Pyx_GIVEREF(__pyx_t_5);
7600 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7601 __Pyx_GIVEREF(__pyx_t_6);
7602 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7605 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7606 __Pyx_GOTREF(__pyx_t_6);
7607 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7608 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7609 __Pyx_GOTREF(__pyx_t_10);
7610 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7611 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7612 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7613 __PYX_ERR(1, 153, __pyx_L1_error)
7631 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7641 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7650 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
7660 __pyx_v_order =
'F';
7669 __Pyx_INCREF(__pyx_n_u_fortran);
7670 __Pyx_GIVEREF(__pyx_n_u_fortran);
7671 __Pyx_GOTREF(__pyx_v_self->mode);
7672 __Pyx_DECREF(__pyx_v_self->mode);
7673 __pyx_v_self->mode = __pyx_n_u_fortran;
7692 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
7693 if (likely(__pyx_t_4)) {
7702 __pyx_v_order =
'C';
7711 __Pyx_INCREF(__pyx_n_u_c);
7712 __Pyx_GIVEREF(__pyx_n_u_c);
7713 __Pyx_GOTREF(__pyx_v_self->mode);
7714 __Pyx_DECREF(__pyx_v_self->mode);
7715 __pyx_v_self->mode = __pyx_n_u_c;
7735 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
7736 __Pyx_GOTREF(__pyx_t_3);
7737 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
7738 __Pyx_GOTREF(__pyx_t_10);
7739 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7740 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7741 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7742 __PYX_ERR(1, 164, __pyx_L1_error)
7753 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7762 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7771 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
7772 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
7773 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7774 __pyx_v_self->dtype_is_object = __pyx_t_4;
7783 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7793 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
7802 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7803 if (unlikely(__pyx_t_4)) {
7812 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
7813 __Pyx_GOTREF(__pyx_t_10);
7814 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7815 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7816 __PYX_ERR(1, 176, __pyx_L1_error)
7834 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7844 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7853 if (unlikely(__pyx_v_itemsize == 0)) {
7854 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
7855 __PYX_ERR(1, 180, __pyx_L1_error)
7857 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7858 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
7859 __PYX_ERR(1, 180, __pyx_L1_error)
7861 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
7862 __pyx_t_9 = __pyx_t_1;
7863 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7864 __pyx_v_i = __pyx_t_11;
7873 (__pyx_v_p[__pyx_v_i]) = Py_None;
7915 __Pyx_XDECREF(__pyx_t_3);
7916 __Pyx_XDECREF(__pyx_t_5);
7917 __Pyx_XDECREF(__pyx_t_6);
7918 __Pyx_XDECREF(__pyx_t_10);
7919 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7922 __Pyx_XDECREF(__pyx_v_format);
7923 __Pyx_RefNannyFinishContext();
7936 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7937 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7939 __Pyx_RefNannyDeclarations
7940 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
7941 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
7944 __Pyx_RefNannyFinishContext();
7948 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7949 int __pyx_v_bufmode;
7951 __Pyx_RefNannyDeclarations
7954 PyObject *__pyx_t_3 = NULL;
7956 Py_ssize_t __pyx_t_5;
7958 Py_ssize_t *__pyx_t_7;
7959 int __pyx_lineno = 0;
7960 const char *__pyx_filename = NULL;
7961 int __pyx_clineno = 0;
7962 if (__pyx_v_info == NULL) {
7963 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
7966 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
7967 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7968 __Pyx_GIVEREF(__pyx_v_info->obj);
7977 __pyx_v_bufmode = -1;
7986 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
7987 __pyx_t_2 = (__pyx_t_1 != 0);
7997 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8016 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8017 __pyx_t_1 = (__pyx_t_2 != 0);
8027 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8046 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8047 if (unlikely(__pyx_t_1)) {
8056 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8057 __Pyx_GOTREF(__pyx_t_3);
8058 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8059 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8060 __PYX_ERR(1, 192, __pyx_L1_error)
8078 __pyx_t_4 = __pyx_v_self->data;
8079 __pyx_v_info->buf = __pyx_t_4;
8088 __pyx_t_5 = __pyx_v_self->len;
8089 __pyx_v_info->len = __pyx_t_5;
8098 __pyx_t_6 = __pyx_v_self->ndim;
8099 __pyx_v_info->ndim = __pyx_t_6;
8108 __pyx_t_7 = __pyx_v_self->_shape;
8109 __pyx_v_info->shape = __pyx_t_7;
8118 __pyx_t_7 = __pyx_v_self->_strides;
8119 __pyx_v_info->strides = __pyx_t_7;
8128 __pyx_v_info->suboffsets = NULL;
8137 __pyx_t_5 = __pyx_v_self->itemsize;
8138 __pyx_v_info->itemsize = __pyx_t_5;
8147 __pyx_v_info->readonly = 0;
8156 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8166 __pyx_t_4 = __pyx_v_self->format;
8167 __pyx_v_info->format = __pyx_t_4;
8187 __pyx_v_info->format = NULL;
8198 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8199 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8200 __Pyx_GOTREF(__pyx_v_info->obj);
8201 __Pyx_DECREF(__pyx_v_info->obj);
8202 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8216 __Pyx_XDECREF(__pyx_t_3);
8217 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8219 if (__pyx_v_info->obj != NULL) {
8220 __Pyx_GOTREF(__pyx_v_info->obj);
8221 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8225 if (__pyx_v_info->obj == Py_None) {
8226 __Pyx_GOTREF(__pyx_v_info->obj);
8227 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8230 __Pyx_RefNannyFinishContext();
8243 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
8244 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8245 __Pyx_RefNannyDeclarations
8246 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
8247 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
8250 __Pyx_RefNannyFinishContext();
8253 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
8254 __Pyx_RefNannyDeclarations
8256 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
8265 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8275 __pyx_v_self->callback_free_data(__pyx_v_self->data);
8294 __pyx_t_1 = (__pyx_v_self->free_data != 0);
8304 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8314 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8332 free(__pyx_v_self->data);
8351 PyObject_Free(__pyx_v_self->_shape);
8362 __Pyx_RefNannyFinishContext();
8374 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
8375 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8376 PyObject *__pyx_r = 0;
8377 __Pyx_RefNannyDeclarations
8378 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
8379 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
8382 __Pyx_RefNannyFinishContext();
8386 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
8387 PyObject *__pyx_r = NULL;
8388 __Pyx_RefNannyDeclarations
8389 PyObject *__pyx_t_1 = NULL;
8390 int __pyx_lineno = 0;
8391 const char *__pyx_filename = NULL;
8392 int __pyx_clineno = 0;
8393 __Pyx_RefNannySetupContext(
"__get__", 0);
8402 __Pyx_XDECREF(__pyx_r);
8403 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
8404 __Pyx_GOTREF(__pyx_t_1);
8405 __pyx_r = __pyx_t_1;
8419 __Pyx_XDECREF(__pyx_t_1);
8420 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8423 __Pyx_XGIVEREF(__pyx_r);
8424 __Pyx_RefNannyFinishContext();
8436 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
8438 PyObject *__pyx_r = NULL;
8439 __Pyx_RefNannyDeclarations
8440 PyObject *__pyx_t_1 = NULL;
8441 PyObject *__pyx_t_2 = NULL;
8442 PyObject *__pyx_t_3 = NULL;
8443 int __pyx_lineno = 0;
8444 const char *__pyx_filename = NULL;
8445 int __pyx_clineno = 0;
8446 __Pyx_RefNannySetupContext(
"get_memview", 0);
8455 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8464 __Pyx_XDECREF(__pyx_r);
8465 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
8466 __Pyx_GOTREF(__pyx_t_1);
8467 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8468 __Pyx_GOTREF(__pyx_t_2);
8469 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
8470 __Pyx_GOTREF(__pyx_t_3);
8471 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8472 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8473 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8474 __Pyx_GIVEREF(__pyx_t_1);
8475 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8476 __Pyx_GIVEREF(__pyx_t_2);
8477 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8480 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8481 __Pyx_GOTREF(__pyx_t_2);
8482 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8483 __pyx_r = __pyx_t_2;
8497 __Pyx_XDECREF(__pyx_t_1);
8498 __Pyx_XDECREF(__pyx_t_2);
8499 __Pyx_XDECREF(__pyx_t_3);
8500 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8503 __Pyx_XGIVEREF(__pyx_r);
8504 __Pyx_RefNannyFinishContext();
8517 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
8518 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8520 __Pyx_RefNannyDeclarations
8521 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
8522 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
8525 __Pyx_RefNannyFinishContext();
8529 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
8531 __Pyx_RefNannyDeclarations
8532 __Pyx_RefNannySetupContext(
"__len__", 0);
8541 __pyx_r = (__pyx_v_self->_shape[0]);
8554 __Pyx_RefNannyFinishContext();
8567 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
8568 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8569 PyObject *__pyx_r = 0;
8570 __Pyx_RefNannyDeclarations
8571 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
8572 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8575 __Pyx_RefNannyFinishContext();
8579 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8580 PyObject *__pyx_r = NULL;
8581 __Pyx_RefNannyDeclarations
8582 PyObject *__pyx_t_1 = NULL;
8583 PyObject *__pyx_t_2 = NULL;
8584 int __pyx_lineno = 0;
8585 const char *__pyx_filename = NULL;
8586 int __pyx_clineno = 0;
8587 __Pyx_RefNannySetupContext(
"__getattr__", 0);
8596 __Pyx_XDECREF(__pyx_r);
8597 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
8598 __Pyx_GOTREF(__pyx_t_1);
8599 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
8600 __Pyx_GOTREF(__pyx_t_2);
8601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8602 __pyx_r = __pyx_t_2;
8616 __Pyx_XDECREF(__pyx_t_1);
8617 __Pyx_XDECREF(__pyx_t_2);
8618 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8621 __Pyx_XGIVEREF(__pyx_r);
8622 __Pyx_RefNannyFinishContext();
8635 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
8636 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8637 PyObject *__pyx_r = 0;
8638 __Pyx_RefNannyDeclarations
8639 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8640 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8643 __Pyx_RefNannyFinishContext();
8647 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8648 PyObject *__pyx_r = NULL;
8649 __Pyx_RefNannyDeclarations
8650 PyObject *__pyx_t_1 = NULL;
8651 PyObject *__pyx_t_2 = NULL;
8652 int __pyx_lineno = 0;
8653 const char *__pyx_filename = NULL;
8654 int __pyx_clineno = 0;
8655 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8664 __Pyx_XDECREF(__pyx_r);
8665 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
8666 __Pyx_GOTREF(__pyx_t_1);
8667 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
8668 __Pyx_GOTREF(__pyx_t_2);
8669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8670 __pyx_r = __pyx_t_2;
8684 __Pyx_XDECREF(__pyx_t_1);
8685 __Pyx_XDECREF(__pyx_t_2);
8686 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8689 __Pyx_XGIVEREF(__pyx_r);
8690 __Pyx_RefNannyFinishContext();
8703 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
8704 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8706 __Pyx_RefNannyDeclarations
8707 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8708 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8711 __Pyx_RefNannyFinishContext();
8715 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8717 __Pyx_RefNannyDeclarations
8718 PyObject *__pyx_t_1 = NULL;
8719 int __pyx_lineno = 0;
8720 const char *__pyx_filename = NULL;
8721 int __pyx_clineno = 0;
8722 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8731 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
8732 __Pyx_GOTREF(__pyx_t_1);
8733 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
8734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8748 __Pyx_XDECREF(__pyx_t_1);
8749 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8752 __Pyx_RefNannyFinishContext();
8763 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8764 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8765 PyObject *__pyx_r = 0;
8766 __Pyx_RefNannyDeclarations
8767 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8768 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
8771 __Pyx_RefNannyFinishContext();
8775 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
8776 PyObject *__pyx_r = NULL;
8777 __Pyx_RefNannyDeclarations
8778 PyObject *__pyx_t_1 = NULL;
8779 int __pyx_lineno = 0;
8780 const char *__pyx_filename = NULL;
8781 int __pyx_clineno = 0;
8782 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8790 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8791 __Pyx_GOTREF(__pyx_t_1);
8792 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8794 __PYX_ERR(1, 2, __pyx_L1_error)
8804 __Pyx_XDECREF(__pyx_t_1);
8805 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8807 __Pyx_XGIVEREF(__pyx_r);
8808 __Pyx_RefNannyFinishContext();
8820 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8821 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8822 PyObject *__pyx_r = 0;
8823 __Pyx_RefNannyDeclarations
8824 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8825 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8828 __Pyx_RefNannyFinishContext();
8832 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8833 PyObject *__pyx_r = NULL;
8834 __Pyx_RefNannyDeclarations
8835 PyObject *__pyx_t_1 = NULL;
8836 int __pyx_lineno = 0;
8837 const char *__pyx_filename = NULL;
8838 int __pyx_clineno = 0;
8839 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8846 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8847 __Pyx_GOTREF(__pyx_t_1);
8848 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8849 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8850 __PYX_ERR(1, 4, __pyx_L1_error)
8861 __Pyx_XDECREF(__pyx_t_1);
8862 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8864 __Pyx_XGIVEREF(__pyx_r);
8865 __Pyx_RefNannyFinishContext();
8877 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
8878 struct __pyx_array_obj *__pyx_v_result = 0;
8879 struct __pyx_array_obj *__pyx_r = NULL;
8880 __Pyx_RefNannyDeclarations
8882 PyObject *__pyx_t_2 = NULL;
8883 PyObject *__pyx_t_3 = NULL;
8884 PyObject *__pyx_t_4 = NULL;
8885 PyObject *__pyx_t_5 = NULL;
8886 int __pyx_lineno = 0;
8887 const char *__pyx_filename = NULL;
8888 int __pyx_clineno = 0;
8889 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
8898 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8908 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
8909 __Pyx_GOTREF(__pyx_t_2);
8910 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
8911 __Pyx_GOTREF(__pyx_t_3);
8912 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8913 __Pyx_GOTREF(__pyx_t_4);
8914 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
8915 __Pyx_GOTREF(__pyx_t_5);
8916 __Pyx_INCREF(__pyx_v_shape);
8917 __Pyx_GIVEREF(__pyx_v_shape);
8918 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8919 __Pyx_GIVEREF(__pyx_t_2);
8920 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8921 __Pyx_GIVEREF(__pyx_t_3);
8922 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8923 __Pyx_GIVEREF(__pyx_t_4);
8924 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8928 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8929 __Pyx_GOTREF(__pyx_t_4);
8930 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8931 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
8952 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
8953 __Pyx_GOTREF(__pyx_t_4);
8954 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8955 __Pyx_GOTREF(__pyx_t_5);
8956 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
8957 __Pyx_GOTREF(__pyx_t_3);
8958 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
8959 __Pyx_GOTREF(__pyx_t_2);
8960 __Pyx_INCREF(__pyx_v_shape);
8961 __Pyx_GIVEREF(__pyx_v_shape);
8962 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8963 __Pyx_GIVEREF(__pyx_t_4);
8964 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8965 __Pyx_GIVEREF(__pyx_t_5);
8966 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8967 __Pyx_GIVEREF(__pyx_t_3);
8968 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8980 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8981 __Pyx_GOTREF(__pyx_t_3);
8982 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
8991 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8992 __Pyx_GOTREF(__pyx_t_5);
8993 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8994 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8995 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
9005 __pyx_v_result->data = __pyx_v_buf;
9016 __Pyx_XDECREF(((PyObject *)__pyx_r));
9017 __Pyx_INCREF(((PyObject *)__pyx_v_result));
9018 __pyx_r = __pyx_v_result;
9031 __Pyx_XDECREF(__pyx_t_2);
9032 __Pyx_XDECREF(__pyx_t_3);
9033 __Pyx_XDECREF(__pyx_t_4);
9034 __Pyx_XDECREF(__pyx_t_5);
9035 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9038 __Pyx_XDECREF((PyObject *)__pyx_v_result);
9039 __Pyx_XGIVEREF((PyObject *)__pyx_r);
9040 __Pyx_RefNannyFinishContext();
9053 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9054 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9055 PyObject *__pyx_v_name = 0;
9056 int __pyx_lineno = 0;
9057 const char *__pyx_filename = NULL;
9058 int __pyx_clineno = 0;
9060 __Pyx_RefNannyDeclarations
9061 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9063 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9064 PyObject* values[1] = {0};
9065 if (unlikely(__pyx_kwds)) {
9067 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9069 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9072 default:
goto __pyx_L5_argtuple_error;
9074 kw_args = PyDict_Size(__pyx_kwds);
9077 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9078 else goto __pyx_L5_argtuple_error;
9080 if (unlikely(kw_args > 0)) {
9081 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
9083 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9084 goto __pyx_L5_argtuple_error;
9086 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9088 __pyx_v_name = values[0];
9090 goto __pyx_L4_argument_unpacking_done;
9091 __pyx_L5_argtuple_error:;
9092 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
9094 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9095 __Pyx_RefNannyFinishContext();
9097 __pyx_L4_argument_unpacking_done:;
9098 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9101 __Pyx_RefNannyFinishContext();
9105 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9107 __Pyx_RefNannyDeclarations
9108 __Pyx_RefNannySetupContext(
"__init__", 0);
9117 __Pyx_INCREF(__pyx_v_name);
9118 __Pyx_GIVEREF(__pyx_v_name);
9119 __Pyx_GOTREF(__pyx_v_self->name);
9120 __Pyx_DECREF(__pyx_v_self->name);
9121 __pyx_v_self->name = __pyx_v_name;
9133 __Pyx_RefNannyFinishContext();
9146 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
9147 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9148 PyObject *__pyx_r = 0;
9149 __Pyx_RefNannyDeclarations
9150 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
9151 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9154 __Pyx_RefNannyFinishContext();
9158 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9159 PyObject *__pyx_r = NULL;
9160 __Pyx_RefNannyDeclarations
9161 __Pyx_RefNannySetupContext(
"__repr__", 0);
9170 __Pyx_XDECREF(__pyx_r);
9171 __Pyx_INCREF(__pyx_v_self->name);
9172 __pyx_r = __pyx_v_self->name;
9185 __Pyx_XGIVEREF(__pyx_r);
9186 __Pyx_RefNannyFinishContext();
9197 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9198 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9199 PyObject *__pyx_r = 0;
9200 __Pyx_RefNannyDeclarations
9201 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9202 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9205 __Pyx_RefNannyFinishContext();
9209 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9210 PyObject *__pyx_v_state = 0;
9211 PyObject *__pyx_v__dict = 0;
9212 int __pyx_v_use_setstate;
9213 PyObject *__pyx_r = NULL;
9214 __Pyx_RefNannyDeclarations
9215 PyObject *__pyx_t_1 = NULL;
9218 PyObject *__pyx_t_4 = NULL;
9219 PyObject *__pyx_t_5 = NULL;
9220 int __pyx_lineno = 0;
9221 const char *__pyx_filename = NULL;
9222 int __pyx_clineno = 0;
9223 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9232 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9233 __Pyx_GOTREF(__pyx_t_1);
9234 __Pyx_INCREF(__pyx_v_self->name);
9235 __Pyx_GIVEREF(__pyx_v_self->name);
9236 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9237 __pyx_v_state = ((PyObject*)__pyx_t_1);
9247 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9248 __Pyx_GOTREF(__pyx_t_1);
9249 __pyx_v__dict = __pyx_t_1;
9259 __pyx_t_2 = (__pyx_v__dict != Py_None);
9260 __pyx_t_3 = (__pyx_t_2 != 0);
9270 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9271 __Pyx_GOTREF(__pyx_t_1);
9272 __Pyx_INCREF(__pyx_v__dict);
9273 __Pyx_GIVEREF(__pyx_v__dict);
9274 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9275 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9276 __Pyx_GOTREF(__pyx_t_4);
9277 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9278 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9288 __pyx_v_use_setstate = 1;
9308 __pyx_t_3 = (__pyx_v_self->name != Py_None);
9309 __pyx_v_use_setstate = __pyx_t_3;
9320 __pyx_t_3 = (__pyx_v_use_setstate != 0);
9330 __Pyx_XDECREF(__pyx_r);
9331 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9332 __Pyx_GOTREF(__pyx_t_4);
9333 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9334 __Pyx_GOTREF(__pyx_t_1);
9335 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9336 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9337 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9338 __Pyx_INCREF(__pyx_int_184977713);
9339 __Pyx_GIVEREF(__pyx_int_184977713);
9340 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9341 __Pyx_INCREF(Py_None);
9342 __Pyx_GIVEREF(Py_None);
9343 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9344 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9345 __Pyx_GOTREF(__pyx_t_5);
9346 __Pyx_GIVEREF(__pyx_t_4);
9347 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9348 __Pyx_GIVEREF(__pyx_t_1);
9349 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9350 __Pyx_INCREF(__pyx_v_state);
9351 __Pyx_GIVEREF(__pyx_v_state);
9352 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9355 __pyx_r = __pyx_t_5;
9376 __Pyx_XDECREF(__pyx_r);
9377 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9378 __Pyx_GOTREF(__pyx_t_5);
9379 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9380 __Pyx_GOTREF(__pyx_t_1);
9381 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9382 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9383 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9384 __Pyx_INCREF(__pyx_int_184977713);
9385 __Pyx_GIVEREF(__pyx_int_184977713);
9386 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9387 __Pyx_INCREF(__pyx_v_state);
9388 __Pyx_GIVEREF(__pyx_v_state);
9389 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9390 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9391 __Pyx_GOTREF(__pyx_t_4);
9392 __Pyx_GIVEREF(__pyx_t_5);
9393 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9394 __Pyx_GIVEREF(__pyx_t_1);
9395 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9398 __pyx_r = __pyx_t_4;
9411 __Pyx_XDECREF(__pyx_t_1);
9412 __Pyx_XDECREF(__pyx_t_4);
9413 __Pyx_XDECREF(__pyx_t_5);
9414 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9417 __Pyx_XDECREF(__pyx_v_state);
9418 __Pyx_XDECREF(__pyx_v__dict);
9419 __Pyx_XGIVEREF(__pyx_r);
9420 __Pyx_RefNannyFinishContext();
9432 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9433 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9434 PyObject *__pyx_r = 0;
9435 __Pyx_RefNannyDeclarations
9436 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9437 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9440 __Pyx_RefNannyFinishContext();
9444 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9445 PyObject *__pyx_r = NULL;
9446 __Pyx_RefNannyDeclarations
9447 PyObject *__pyx_t_1 = NULL;
9448 int __pyx_lineno = 0;
9449 const char *__pyx_filename = NULL;
9450 int __pyx_clineno = 0;
9451 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9458 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9459 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9460 __Pyx_GOTREF(__pyx_t_1);
9461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9471 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9474 __Pyx_XDECREF(__pyx_t_1);
9475 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9478 __Pyx_XGIVEREF(__pyx_r);
9479 __Pyx_RefNannyFinishContext();
9491 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
9492 Py_intptr_t __pyx_v_aligned_p;
9493 size_t __pyx_v_offset;
9504 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9513 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9522 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9532 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9550 __pyx_r = ((
void *)__pyx_v_aligned_p);
9575 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9576 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9577 PyObject *__pyx_v_obj = 0;
9579 int __pyx_v_dtype_is_object;
9580 int __pyx_lineno = 0;
9581 const char *__pyx_filename = NULL;
9582 int __pyx_clineno = 0;
9584 __Pyx_RefNannyDeclarations
9585 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
9587 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9588 PyObject* values[3] = {0,0,0};
9589 if (unlikely(__pyx_kwds)) {
9591 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9593 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9595 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9597 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9600 default:
goto __pyx_L5_argtuple_error;
9602 kw_args = PyDict_Size(__pyx_kwds);
9605 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9606 else goto __pyx_L5_argtuple_error;
9609 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9611 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
9616 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9617 if (value) { values[2] = value; kw_args--; }
9620 if (unlikely(kw_args > 0)) {
9621 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
9624 switch (PyTuple_GET_SIZE(__pyx_args)) {
9625 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9627 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9628 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9630 default:
goto __pyx_L5_argtuple_error;
9633 __pyx_v_obj = values[0];
9634 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9636 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9638 __pyx_v_dtype_is_object = ((int)0);
9641 goto __pyx_L4_argument_unpacking_done;
9642 __pyx_L5_argtuple_error:;
9643 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
9645 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9646 __Pyx_RefNannyFinishContext();
9648 __pyx_L4_argument_unpacking_done:;
9649 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9652 __Pyx_RefNannyFinishContext();
9656 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
9658 __Pyx_RefNannyDeclarations
9663 int __pyx_lineno = 0;
9664 const char *__pyx_filename = NULL;
9665 int __pyx_clineno = 0;
9666 __Pyx_RefNannySetupContext(
"__cinit__", 0);
9675 __Pyx_INCREF(__pyx_v_obj);
9676 __Pyx_GIVEREF(__pyx_v_obj);
9677 __Pyx_GOTREF(__pyx_v_self->obj);
9678 __Pyx_DECREF(__pyx_v_self->obj);
9679 __pyx_v_self->obj = __pyx_v_obj;
9688 __pyx_v_self->flags = __pyx_v_flags;
9697 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9698 __pyx_t_3 = (__pyx_t_2 != 0);
9701 __pyx_t_1 = __pyx_t_3;
9702 goto __pyx_L4_bool_binop_done;
9704 __pyx_t_3 = (__pyx_v_obj != Py_None);
9705 __pyx_t_2 = (__pyx_t_3 != 0);
9706 __pyx_t_1 = __pyx_t_2;
9707 __pyx_L4_bool_binop_done:;
9717 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
9726 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9736 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9772 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9782 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9791 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9809 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9819 __pyx_v_self->lock = PyThread_allocate_lock();
9828 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9829 if (unlikely(__pyx_t_1)) {
9838 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
9865 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9875 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
9878 __pyx_t_1 = __pyx_t_2;
9879 goto __pyx_L11_bool_binop_done;
9881 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
9882 __pyx_t_1 = __pyx_t_2;
9883 __pyx_L11_bool_binop_done:;
9884 __pyx_v_self->dtype_is_object = __pyx_t_1;
9904 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9915 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
9924 __pyx_v_self->typeinfo = NULL;
9938 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9941 __Pyx_RefNannyFinishContext();
9954 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
9955 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9956 __Pyx_RefNannyDeclarations
9957 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9958 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
9961 __Pyx_RefNannyFinishContext();
9964 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
9966 __Pyx_RefNannyDeclarations
9972 PyThread_type_lock __pyx_t_6;
9973 PyThread_type_lock __pyx_t_7;
9974 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9983 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9984 __pyx_t_2 = (__pyx_t_1 != 0);
9994 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10013 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10023 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10032 Py_DECREF(Py_None);
10051 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10061 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10062 __pyx_t_4 = __pyx_t_3;
10063 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10064 __pyx_v_i = __pyx_t_5;
10073 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10083 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10092 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10102 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10103 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10112 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10113 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10131 goto __pyx_L6_break;
10151 PyThread_free_lock(__pyx_v_self->lock);
10173 __Pyx_RefNannyFinishContext();
10184 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10185 Py_ssize_t __pyx_v_dim;
10186 char *__pyx_v_itemp;
10187 PyObject *__pyx_v_idx = NULL;
10189 __Pyx_RefNannyDeclarations
10190 Py_ssize_t __pyx_t_1;
10191 PyObject *__pyx_t_2 = NULL;
10192 Py_ssize_t __pyx_t_3;
10193 PyObject *(*__pyx_t_4)(PyObject *);
10194 PyObject *__pyx_t_5 = NULL;
10195 Py_ssize_t __pyx_t_6;
10197 int __pyx_lineno = 0;
10198 const char *__pyx_filename = NULL;
10199 int __pyx_clineno = 0;
10200 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
10209 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
10219 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10220 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10223 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10224 __Pyx_GOTREF(__pyx_t_2);
10225 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10228 if (likely(!__pyx_t_4)) {
10229 if (likely(PyList_CheckExact(__pyx_t_2))) {
10230 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
10231 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10232 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10234 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10235 __Pyx_GOTREF(__pyx_t_5);
10238 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
10239 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10240 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10242 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10243 __Pyx_GOTREF(__pyx_t_5);
10247 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10248 if (unlikely(!__pyx_t_5)) {
10249 PyObject* exc_type = PyErr_Occurred();
10251 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10252 else __PYX_ERR(1, 397, __pyx_L1_error)
10256 __Pyx_GOTREF(__pyx_t_5);
10258 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10260 __pyx_v_dim = __pyx_t_1;
10261 __pyx_t_1 = (__pyx_t_1 + 1);
10270 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10271 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10272 __pyx_v_itemp = __pyx_t_7;
10282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10291 __pyx_r = __pyx_v_itemp;
10304 __Pyx_XDECREF(__pyx_t_2);
10305 __Pyx_XDECREF(__pyx_t_5);
10306 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10309 __Pyx_XDECREF(__pyx_v_idx);
10310 __Pyx_RefNannyFinishContext();
10323 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
10324 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10325 PyObject *__pyx_r = 0;
10326 __Pyx_RefNannyDeclarations
10327 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10328 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10331 __Pyx_RefNannyFinishContext();
10335 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10336 PyObject *__pyx_v_have_slices = NULL;
10337 PyObject *__pyx_v_indices = NULL;
10338 char *__pyx_v_itemp;
10339 PyObject *__pyx_r = NULL;
10340 __Pyx_RefNannyDeclarations
10343 PyObject *__pyx_t_3 = NULL;
10344 PyObject *__pyx_t_4 = NULL;
10345 PyObject *__pyx_t_5 = NULL;
10347 int __pyx_lineno = 0;
10348 const char *__pyx_filename = NULL;
10349 int __pyx_clineno = 0;
10350 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10359 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10360 __pyx_t_2 = (__pyx_t_1 != 0);
10370 __Pyx_XDECREF(__pyx_r);
10371 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10372 __pyx_r = ((PyObject *)__pyx_v_self);
10391 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
10392 __Pyx_GOTREF(__pyx_t_3);
10393 if (likely(__pyx_t_3 != Py_None)) {
10394 PyObject* sequence = __pyx_t_3;
10395 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10396 if (unlikely(size != 2)) {
10397 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10398 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10399 __PYX_ERR(1, 407, __pyx_L1_error)
10401 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10402 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10403 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10404 __Pyx_INCREF(__pyx_t_4);
10405 __Pyx_INCREF(__pyx_t_5);
10407 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
10408 __Pyx_GOTREF(__pyx_t_4);
10409 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
10410 __Pyx_GOTREF(__pyx_t_5);
10412 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10414 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
10416 __pyx_v_have_slices = __pyx_t_4;
10418 __pyx_v_indices = __pyx_t_5;
10428 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
10438 __Pyx_XDECREF(__pyx_r);
10439 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
10440 __Pyx_GOTREF(__pyx_t_3);
10441 __pyx_r = __pyx_t_3;
10462 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
10463 __pyx_v_itemp = __pyx_t_6;
10472 __Pyx_XDECREF(__pyx_r);
10473 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
10474 __Pyx_GOTREF(__pyx_t_3);
10475 __pyx_r = __pyx_t_3;
10490 __Pyx_XDECREF(__pyx_t_3);
10491 __Pyx_XDECREF(__pyx_t_4);
10492 __Pyx_XDECREF(__pyx_t_5);
10493 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10496 __Pyx_XDECREF(__pyx_v_have_slices);
10497 __Pyx_XDECREF(__pyx_v_indices);
10498 __Pyx_XGIVEREF(__pyx_r);
10499 __Pyx_RefNannyFinishContext();
10512 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
10513 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10515 __Pyx_RefNannyDeclarations
10516 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10517 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10520 __Pyx_RefNannyFinishContext();
10524 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10525 PyObject *__pyx_v_have_slices = NULL;
10526 PyObject *__pyx_v_obj = NULL;
10528 __Pyx_RefNannyDeclarations
10530 PyObject *__pyx_t_2 = NULL;
10531 PyObject *__pyx_t_3 = NULL;
10532 PyObject *__pyx_t_4 = NULL;
10533 int __pyx_lineno = 0;
10534 const char *__pyx_filename = NULL;
10535 int __pyx_clineno = 0;
10536 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10537 __Pyx_INCREF(__pyx_v_index);
10546 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10547 if (unlikely(__pyx_t_1)) {
10556 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
10557 __Pyx_GOTREF(__pyx_t_2);
10558 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10559 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10560 __PYX_ERR(1, 418, __pyx_L1_error)
10578 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10579 __Pyx_GOTREF(__pyx_t_2);
10580 if (likely(__pyx_t_2 != Py_None)) {
10581 PyObject* sequence = __pyx_t_2;
10582 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10583 if (unlikely(size != 2)) {
10584 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10585 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10586 __PYX_ERR(1, 420, __pyx_L1_error)
10588 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10589 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10590 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10591 __Pyx_INCREF(__pyx_t_3);
10592 __Pyx_INCREF(__pyx_t_4);
10594 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
10595 __Pyx_GOTREF(__pyx_t_3);
10596 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
10597 __Pyx_GOTREF(__pyx_t_4);
10599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10601 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
10603 __pyx_v_have_slices = __pyx_t_3;
10605 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10615 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
10625 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
10626 __Pyx_GOTREF(__pyx_t_2);
10627 __pyx_v_obj = __pyx_t_2;
10637 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10647 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10648 __Pyx_GOTREF(__pyx_t_2);
10649 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
10650 __Pyx_GOTREF(__pyx_t_4);
10651 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10652 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10672 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10673 __Pyx_GOTREF(__pyx_t_4);
10674 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
10675 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10676 __Pyx_GOTREF(__pyx_t_2);
10677 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10700 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10701 __Pyx_GOTREF(__pyx_t_2);
10702 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10718 __Pyx_XDECREF(__pyx_t_2);
10719 __Pyx_XDECREF(__pyx_t_3);
10720 __Pyx_XDECREF(__pyx_t_4);
10721 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10724 __Pyx_XDECREF(__pyx_v_have_slices);
10725 __Pyx_XDECREF(__pyx_v_obj);
10726 __Pyx_XDECREF(__pyx_v_index);
10727 __Pyx_RefNannyFinishContext();
10739 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10740 PyObject *__pyx_r = NULL;
10741 __Pyx_RefNannyDeclarations
10744 PyObject *__pyx_t_3 = NULL;
10745 PyObject *__pyx_t_4 = NULL;
10746 PyObject *__pyx_t_5 = NULL;
10747 PyObject *__pyx_t_6 = NULL;
10748 PyObject *__pyx_t_7 = NULL;
10749 PyObject *__pyx_t_8 = NULL;
10751 int __pyx_lineno = 0;
10752 const char *__pyx_filename = NULL;
10753 int __pyx_clineno = 0;
10754 __Pyx_RefNannySetupContext(
"is_slice", 0);
10755 __Pyx_INCREF(__pyx_v_obj);
10764 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10765 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10776 __Pyx_PyThreadState_declare
10777 __Pyx_PyThreadState_assign
10778 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10779 __Pyx_XGOTREF(__pyx_t_3);
10780 __Pyx_XGOTREF(__pyx_t_4);
10781 __Pyx_XGOTREF(__pyx_t_5);
10791 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
10792 __Pyx_GOTREF(__pyx_t_6);
10801 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
10802 __Pyx_GOTREF(__pyx_t_7);
10811 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
10812 __Pyx_GOTREF(__pyx_t_8);
10813 __Pyx_INCREF(__pyx_v_obj);
10814 __Pyx_GIVEREF(__pyx_v_obj);
10815 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10816 __Pyx_GIVEREF(__pyx_t_6);
10817 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10818 __Pyx_GIVEREF(__pyx_t_7);
10819 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10822 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
10823 __Pyx_GOTREF(__pyx_t_7);
10824 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10825 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10836 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10837 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10838 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10839 goto __pyx_L9_try_end;
10841 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10842 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10843 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10852 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10854 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10855 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
10856 __Pyx_GOTREF(__pyx_t_7);
10857 __Pyx_GOTREF(__pyx_t_8);
10858 __Pyx_GOTREF(__pyx_t_6);
10867 __Pyx_XDECREF(__pyx_r);
10868 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10869 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10870 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10871 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10872 goto __pyx_L7_except_return;
10874 goto __pyx_L6_except_error;
10875 __pyx_L6_except_error:;
10884 __Pyx_XGIVEREF(__pyx_t_3);
10885 __Pyx_XGIVEREF(__pyx_t_4);
10886 __Pyx_XGIVEREF(__pyx_t_5);
10887 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10888 goto __pyx_L1_error;
10889 __pyx_L7_except_return:;
10890 __Pyx_XGIVEREF(__pyx_t_3);
10891 __Pyx_XGIVEREF(__pyx_t_4);
10892 __Pyx_XGIVEREF(__pyx_t_5);
10893 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10914 __Pyx_XDECREF(__pyx_r);
10915 __Pyx_INCREF(__pyx_v_obj);
10916 __pyx_r = __pyx_v_obj;
10929 __Pyx_XDECREF(__pyx_t_6);
10930 __Pyx_XDECREF(__pyx_t_7);
10931 __Pyx_XDECREF(__pyx_t_8);
10932 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10935 __Pyx_XDECREF(__pyx_v_obj);
10936 __Pyx_XGIVEREF(__pyx_r);
10937 __Pyx_RefNannyFinishContext();
10949 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10950 __Pyx_memviewslice __pyx_v_dst_slice;
10951 __Pyx_memviewslice __pyx_v_src_slice;
10952 PyObject *__pyx_r = NULL;
10953 __Pyx_RefNannyDeclarations
10954 __Pyx_memviewslice *__pyx_t_1;
10955 __Pyx_memviewslice *__pyx_t_2;
10956 PyObject *__pyx_t_3 = NULL;
10960 int __pyx_lineno = 0;
10961 const char *__pyx_filename = NULL;
10962 int __pyx_clineno = 0;
10963 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
10972 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
10973 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
10982 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
10983 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
10992 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10993 __Pyx_GOTREF(__pyx_t_3);
10994 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10996 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10997 __Pyx_GOTREF(__pyx_t_3);
10998 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10999 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11008 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
11019 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11022 __Pyx_XDECREF(__pyx_t_3);
11023 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11026 __Pyx_XGIVEREF(__pyx_r);
11027 __Pyx_RefNannyFinishContext();
11039 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11040 int __pyx_v_array[0x80];
11042 void *__pyx_v_item;
11043 __Pyx_memviewslice *__pyx_v_dst_slice;
11044 __Pyx_memviewslice __pyx_v_tmp_slice;
11045 PyObject *__pyx_r = NULL;
11046 __Pyx_RefNannyDeclarations
11047 __Pyx_memviewslice *__pyx_t_1;
11049 PyObject *__pyx_t_3 = NULL;
11052 char const *__pyx_t_6;
11053 PyObject *__pyx_t_7 = NULL;
11054 PyObject *__pyx_t_8 = NULL;
11055 PyObject *__pyx_t_9 = NULL;
11056 PyObject *__pyx_t_10 = NULL;
11057 PyObject *__pyx_t_11 = NULL;
11058 PyObject *__pyx_t_12 = NULL;
11059 int __pyx_lineno = 0;
11060 const char *__pyx_filename = NULL;
11061 int __pyx_clineno = 0;
11062 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
11071 __pyx_v_tmp = NULL;
11080 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
11081 __pyx_v_dst_slice = __pyx_t_1;
11090 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
11100 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11109 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11110 if (unlikely(__pyx_t_2)) {
11119 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11137 __pyx_v_item = __pyx_v_tmp;
11157 __pyx_v_item = ((
void *)__pyx_v_array);
11177 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11187 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11207 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11208 __Pyx_GOTREF(__pyx_t_3);
11209 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11220 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11230 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11231 __Pyx_GOTREF(__pyx_t_3);
11232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11250 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11262 PyMem_Free(__pyx_v_tmp);
11267 __Pyx_PyThreadState_declare
11268 __Pyx_PyThreadState_assign
11269 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11270 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11271 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11272 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11273 __Pyx_XGOTREF(__pyx_t_7);
11274 __Pyx_XGOTREF(__pyx_t_8);
11275 __Pyx_XGOTREF(__pyx_t_9);
11276 __Pyx_XGOTREF(__pyx_t_10);
11277 __Pyx_XGOTREF(__pyx_t_11);
11278 __Pyx_XGOTREF(__pyx_t_12);
11279 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11281 PyMem_Free(__pyx_v_tmp);
11283 if (PY_MAJOR_VERSION >= 3) {
11284 __Pyx_XGIVEREF(__pyx_t_10);
11285 __Pyx_XGIVEREF(__pyx_t_11);
11286 __Pyx_XGIVEREF(__pyx_t_12);
11287 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11289 __Pyx_XGIVEREF(__pyx_t_7);
11290 __Pyx_XGIVEREF(__pyx_t_8);
11291 __Pyx_XGIVEREF(__pyx_t_9);
11292 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11293 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11294 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11295 goto __pyx_L1_error;
11309 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11312 __Pyx_XDECREF(__pyx_t_3);
11313 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11316 __Pyx_XGIVEREF(__pyx_r);
11317 __Pyx_RefNannyFinishContext();
11329 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11330 char *__pyx_v_itemp;
11331 PyObject *__pyx_r = NULL;
11332 __Pyx_RefNannyDeclarations
11334 PyObject *__pyx_t_2 = NULL;
11335 int __pyx_lineno = 0;
11336 const char *__pyx_filename = NULL;
11337 int __pyx_clineno = 0;
11338 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
11347 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
11348 __pyx_v_itemp = __pyx_t_1;
11357 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
11358 __Pyx_GOTREF(__pyx_t_2);
11359 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11370 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11373 __Pyx_XDECREF(__pyx_t_2);
11374 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11377 __Pyx_XGIVEREF(__pyx_r);
11378 __Pyx_RefNannyFinishContext();
11390 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
11391 PyObject *__pyx_v_struct = NULL;
11392 PyObject *__pyx_v_bytesitem = 0;
11393 PyObject *__pyx_v_result = NULL;
11394 PyObject *__pyx_r = NULL;
11395 __Pyx_RefNannyDeclarations
11396 PyObject *__pyx_t_1 = NULL;
11397 PyObject *__pyx_t_2 = NULL;
11398 PyObject *__pyx_t_3 = NULL;
11399 PyObject *__pyx_t_4 = NULL;
11400 PyObject *__pyx_t_5 = NULL;
11401 PyObject *__pyx_t_6 = NULL;
11402 PyObject *__pyx_t_7 = NULL;
11404 PyObject *__pyx_t_9 = NULL;
11407 int __pyx_lineno = 0;
11408 const char *__pyx_filename = NULL;
11409 int __pyx_clineno = 0;
11410 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
11419 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
11420 __Pyx_GOTREF(__pyx_t_1);
11421 __pyx_v_struct = __pyx_t_1;
11431 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
11432 __Pyx_GOTREF(__pyx_t_1);
11433 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11444 __Pyx_PyThreadState_declare
11445 __Pyx_PyThreadState_assign
11446 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11447 __Pyx_XGOTREF(__pyx_t_2);
11448 __Pyx_XGOTREF(__pyx_t_3);
11449 __Pyx_XGOTREF(__pyx_t_4);
11459 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
11460 __Pyx_GOTREF(__pyx_t_5);
11461 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
11462 __Pyx_GOTREF(__pyx_t_6);
11465 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11466 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11467 if (likely(__pyx_t_7)) {
11468 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11469 __Pyx_INCREF(__pyx_t_7);
11470 __Pyx_INCREF(
function);
11471 __Pyx_DECREF_SET(__pyx_t_5,
function);
11475 #if CYTHON_FAST_PYCALL
11476 if (PyFunction_Check(__pyx_t_5)) {
11477 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11478 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11479 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11480 __Pyx_GOTREF(__pyx_t_1);
11481 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11484 #if CYTHON_FAST_PYCCALL
11485 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11486 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11487 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11488 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11489 __Pyx_GOTREF(__pyx_t_1);
11490 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11494 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
11495 __Pyx_GOTREF(__pyx_t_9);
11497 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11499 __Pyx_GIVEREF(__pyx_t_6);
11500 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11501 __Pyx_INCREF(__pyx_v_bytesitem);
11502 __Pyx_GIVEREF(__pyx_v_bytesitem);
11503 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11505 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11506 __Pyx_GOTREF(__pyx_t_1);
11507 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11509 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11510 __pyx_v_result = __pyx_t_1;
11530 __pyx_t_10 = strlen(__pyx_v_self->view.format);
11531 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11541 __Pyx_XDECREF(__pyx_r);
11542 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
11543 __Pyx_GOTREF(__pyx_t_1);
11544 __pyx_r = __pyx_t_1;
11546 goto __pyx_L6_except_return;
11564 __Pyx_XDECREF(__pyx_r);
11565 __Pyx_INCREF(__pyx_v_result);
11566 __pyx_r = __pyx_v_result;
11567 goto __pyx_L6_except_return;
11570 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11571 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11572 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11573 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11574 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11583 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11584 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
11585 __Pyx_GOTREF(__pyx_t_6);
11586 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11587 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11588 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11589 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11591 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11592 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
11593 __Pyx_GOTREF(__pyx_t_9);
11594 __Pyx_GOTREF(__pyx_t_5);
11595 __Pyx_GOTREF(__pyx_t_1);
11604 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
11605 __Pyx_GOTREF(__pyx_t_6);
11606 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11607 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11608 __PYX_ERR(1, 495, __pyx_L5_except_error)
11610 goto __pyx_L5_except_error;
11611 __pyx_L5_except_error:;
11620 __Pyx_XGIVEREF(__pyx_t_2);
11621 __Pyx_XGIVEREF(__pyx_t_3);
11622 __Pyx_XGIVEREF(__pyx_t_4);
11623 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11624 goto __pyx_L1_error;
11625 __pyx_L6_except_return:;
11626 __Pyx_XGIVEREF(__pyx_t_2);
11627 __Pyx_XGIVEREF(__pyx_t_3);
11628 __Pyx_XGIVEREF(__pyx_t_4);
11629 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11643 __Pyx_XDECREF(__pyx_t_1);
11644 __Pyx_XDECREF(__pyx_t_5);
11645 __Pyx_XDECREF(__pyx_t_6);
11646 __Pyx_XDECREF(__pyx_t_7);
11647 __Pyx_XDECREF(__pyx_t_9);
11648 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11651 __Pyx_XDECREF(__pyx_v_struct);
11652 __Pyx_XDECREF(__pyx_v_bytesitem);
11653 __Pyx_XDECREF(__pyx_v_result);
11654 __Pyx_XGIVEREF(__pyx_r);
11655 __Pyx_RefNannyFinishContext();
11667 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11668 PyObject *__pyx_v_struct = NULL;
11670 PyObject *__pyx_v_bytesvalue = 0;
11671 Py_ssize_t __pyx_v_i;
11672 PyObject *__pyx_r = NULL;
11673 __Pyx_RefNannyDeclarations
11674 PyObject *__pyx_t_1 = NULL;
11677 PyObject *__pyx_t_4 = NULL;
11678 PyObject *__pyx_t_5 = NULL;
11679 PyObject *__pyx_t_6 = NULL;
11681 PyObject *__pyx_t_8 = NULL;
11682 Py_ssize_t __pyx_t_9;
11683 PyObject *__pyx_t_10 = NULL;
11688 int __pyx_lineno = 0;
11689 const char *__pyx_filename = NULL;
11690 int __pyx_clineno = 0;
11691 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
11700 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
11701 __Pyx_GOTREF(__pyx_t_1);
11702 __pyx_v_struct = __pyx_t_1;
11712 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11713 __pyx_t_3 = (__pyx_t_2 != 0);
11723 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
11724 __Pyx_GOTREF(__pyx_t_1);
11725 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11726 __Pyx_GOTREF(__pyx_t_4);
11727 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
11728 __Pyx_GOTREF(__pyx_t_5);
11729 __Pyx_GIVEREF(__pyx_t_4);
11730 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11732 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11733 __Pyx_GOTREF(__pyx_t_4);
11734 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
11735 __Pyx_GOTREF(__pyx_t_6);
11736 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11737 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11738 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11739 __Pyx_GOTREF(__pyx_t_4);
11740 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11741 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11742 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
11743 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11764 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11765 __Pyx_GOTREF(__pyx_t_6);
11766 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11767 __Pyx_GOTREF(__pyx_t_1);
11770 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11771 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11772 if (likely(__pyx_t_5)) {
11773 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
11774 __Pyx_INCREF(__pyx_t_5);
11775 __Pyx_INCREF(
function);
11776 __Pyx_DECREF_SET(__pyx_t_6,
function);
11780 #if CYTHON_FAST_PYCALL
11781 if (PyFunction_Check(__pyx_t_6)) {
11782 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11783 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11784 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11785 __Pyx_GOTREF(__pyx_t_4);
11786 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11789 #if CYTHON_FAST_PYCCALL
11790 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11791 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11792 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11793 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11794 __Pyx_GOTREF(__pyx_t_4);
11795 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11799 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
11800 __Pyx_GOTREF(__pyx_t_8);
11802 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11804 __Pyx_GIVEREF(__pyx_t_1);
11805 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11806 __Pyx_INCREF(__pyx_v_value);
11807 __Pyx_GIVEREF(__pyx_v_value);
11808 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11810 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11811 __Pyx_GOTREF(__pyx_t_4);
11812 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11814 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11815 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11816 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11829 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11830 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
11831 __PYX_ERR(1, 514, __pyx_L1_error)
11833 __Pyx_INCREF(__pyx_v_bytesvalue);
11834 __pyx_t_10 = __pyx_v_bytesvalue;
11835 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11836 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11837 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11838 __pyx_t_11 = __pyx_t_14;
11839 __pyx_v_c = (__pyx_t_11[0]);
11848 __pyx_v_i = __pyx_t_9;
11857 __pyx_t_9 = (__pyx_t_9 + 1);
11866 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11868 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11879 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11882 __Pyx_XDECREF(__pyx_t_1);
11883 __Pyx_XDECREF(__pyx_t_4);
11884 __Pyx_XDECREF(__pyx_t_5);
11885 __Pyx_XDECREF(__pyx_t_6);
11886 __Pyx_XDECREF(__pyx_t_8);
11887 __Pyx_XDECREF(__pyx_t_10);
11888 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11891 __Pyx_XDECREF(__pyx_v_struct);
11892 __Pyx_XDECREF(__pyx_v_bytesvalue);
11893 __Pyx_XGIVEREF(__pyx_r);
11894 __Pyx_RefNannyFinishContext();
11907 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
11908 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11910 __Pyx_RefNannyDeclarations
11911 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
11912 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
11915 __Pyx_RefNannyFinishContext();
11919 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11921 __Pyx_RefNannyDeclarations
11924 PyObject *__pyx_t_3 = NULL;
11925 Py_ssize_t *__pyx_t_4;
11929 Py_ssize_t __pyx_t_8;
11930 int __pyx_lineno = 0;
11931 const char *__pyx_filename = NULL;
11932 int __pyx_clineno = 0;
11933 if (__pyx_v_info == NULL) {
11934 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
11937 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
11938 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11939 __Pyx_GIVEREF(__pyx_v_info->obj);
11948 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11951 __pyx_t_1 = __pyx_t_2;
11952 goto __pyx_L4_bool_binop_done;
11954 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11955 __pyx_t_1 = __pyx_t_2;
11956 __pyx_L4_bool_binop_done:;
11957 if (unlikely(__pyx_t_1)) {
11966 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
11967 __Pyx_GOTREF(__pyx_t_3);
11968 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11969 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11970 __PYX_ERR(1, 520, __pyx_L1_error)
11988 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11998 __pyx_t_4 = __pyx_v_self->view.shape;
11999 __pyx_v_info->shape = __pyx_t_4;
12019 __pyx_v_info->shape = NULL;
12030 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12040 __pyx_t_4 = __pyx_v_self->view.strides;
12041 __pyx_v_info->strides = __pyx_t_4;
12061 __pyx_v_info->strides = NULL;
12072 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12082 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12083 __pyx_v_info->suboffsets = __pyx_t_4;
12103 __pyx_v_info->suboffsets = NULL;
12114 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12124 __pyx_t_5 = __pyx_v_self->view.format;
12125 __pyx_v_info->format = __pyx_t_5;
12145 __pyx_v_info->format = NULL;
12156 __pyx_t_6 = __pyx_v_self->view.buf;
12157 __pyx_v_info->buf = __pyx_t_6;
12166 __pyx_t_7 = __pyx_v_self->view.ndim;
12167 __pyx_v_info->ndim = __pyx_t_7;
12176 __pyx_t_8 = __pyx_v_self->view.itemsize;
12177 __pyx_v_info->itemsize = __pyx_t_8;
12186 __pyx_t_8 = __pyx_v_self->view.len;
12187 __pyx_v_info->len = __pyx_t_8;
12196 __pyx_t_1 = __pyx_v_self->view.readonly;
12197 __pyx_v_info->readonly = __pyx_t_1;
12206 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12207 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12208 __Pyx_GOTREF(__pyx_v_info->obj);
12209 __Pyx_DECREF(__pyx_v_info->obj);
12210 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12224 __Pyx_XDECREF(__pyx_t_3);
12225 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12227 if (__pyx_v_info->obj != NULL) {
12228 __Pyx_GOTREF(__pyx_v_info->obj);
12229 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12233 if (__pyx_v_info->obj == Py_None) {
12234 __Pyx_GOTREF(__pyx_v_info->obj);
12235 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12238 __Pyx_RefNannyFinishContext();
12251 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
12252 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12253 PyObject *__pyx_r = 0;
12254 __Pyx_RefNannyDeclarations
12255 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12256 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12259 __Pyx_RefNannyFinishContext();
12263 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12264 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12265 PyObject *__pyx_r = NULL;
12266 __Pyx_RefNannyDeclarations
12267 PyObject *__pyx_t_1 = NULL;
12269 int __pyx_lineno = 0;
12270 const char *__pyx_filename = NULL;
12271 int __pyx_clineno = 0;
12272 __Pyx_RefNannySetupContext(
"__get__", 0);
12281 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
12282 __Pyx_GOTREF(__pyx_t_1);
12283 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
12284 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12294 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
12303 __Pyx_XDECREF(__pyx_r);
12304 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12305 __pyx_r = ((PyObject *)__pyx_v_result);
12318 __Pyx_XDECREF(__pyx_t_1);
12319 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12322 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12323 __Pyx_XGIVEREF(__pyx_r);
12324 __Pyx_RefNannyFinishContext();
12337 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
12338 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12339 PyObject *__pyx_r = 0;
12340 __Pyx_RefNannyDeclarations
12341 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12342 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12345 __Pyx_RefNannyFinishContext();
12349 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12350 PyObject *__pyx_r = NULL;
12351 __Pyx_RefNannyDeclarations
12352 __Pyx_RefNannySetupContext(
"__get__", 0);
12361 __Pyx_XDECREF(__pyx_r);
12362 __Pyx_INCREF(__pyx_v_self->obj);
12363 __pyx_r = __pyx_v_self->obj;
12376 __Pyx_XGIVEREF(__pyx_r);
12377 __Pyx_RefNannyFinishContext();
12390 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
12391 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12392 PyObject *__pyx_r = 0;
12393 __Pyx_RefNannyDeclarations
12394 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12395 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12398 __Pyx_RefNannyFinishContext();
12402 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12403 Py_ssize_t __pyx_v_length;
12404 PyObject *__pyx_r = NULL;
12405 __Pyx_RefNannyDeclarations
12406 PyObject *__pyx_t_1 = NULL;
12407 Py_ssize_t *__pyx_t_2;
12408 Py_ssize_t *__pyx_t_3;
12409 Py_ssize_t *__pyx_t_4;
12410 PyObject *__pyx_t_5 = NULL;
12411 int __pyx_lineno = 0;
12412 const char *__pyx_filename = NULL;
12413 int __pyx_clineno = 0;
12414 __Pyx_RefNannySetupContext(
"__get__", 0);
12423 __Pyx_XDECREF(__pyx_r);
12424 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
12425 __Pyx_GOTREF(__pyx_t_1);
12426 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12427 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12428 __pyx_t_2 = __pyx_t_4;
12429 __pyx_v_length = (__pyx_t_2[0]);
12430 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12431 __Pyx_GOTREF(__pyx_t_5);
12432 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
12433 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12435 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12436 __Pyx_GOTREF(__pyx_t_5);
12437 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12438 __pyx_r = __pyx_t_5;
12452 __Pyx_XDECREF(__pyx_t_1);
12453 __Pyx_XDECREF(__pyx_t_5);
12454 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12457 __Pyx_XGIVEREF(__pyx_r);
12458 __Pyx_RefNannyFinishContext();
12471 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
12472 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12473 PyObject *__pyx_r = 0;
12474 __Pyx_RefNannyDeclarations
12475 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12476 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12479 __Pyx_RefNannyFinishContext();
12483 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12484 Py_ssize_t __pyx_v_stride;
12485 PyObject *__pyx_r = NULL;
12486 __Pyx_RefNannyDeclarations
12488 PyObject *__pyx_t_2 = NULL;
12489 Py_ssize_t *__pyx_t_3;
12490 Py_ssize_t *__pyx_t_4;
12491 Py_ssize_t *__pyx_t_5;
12492 PyObject *__pyx_t_6 = NULL;
12493 int __pyx_lineno = 0;
12494 const char *__pyx_filename = NULL;
12495 int __pyx_clineno = 0;
12496 __Pyx_RefNannySetupContext(
"__get__", 0);
12505 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12506 if (unlikely(__pyx_t_1)) {
12515 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
12516 __Pyx_GOTREF(__pyx_t_2);
12517 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12518 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12519 __PYX_ERR(1, 570, __pyx_L1_error)
12537 __Pyx_XDECREF(__pyx_r);
12538 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12539 __Pyx_GOTREF(__pyx_t_2);
12540 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12541 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12542 __pyx_t_3 = __pyx_t_5;
12543 __pyx_v_stride = (__pyx_t_3[0]);
12544 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12545 __Pyx_GOTREF(__pyx_t_6);
12546 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
12547 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12549 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12550 __Pyx_GOTREF(__pyx_t_6);
12551 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12552 __pyx_r = __pyx_t_6;
12566 __Pyx_XDECREF(__pyx_t_2);
12567 __Pyx_XDECREF(__pyx_t_6);
12568 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12571 __Pyx_XGIVEREF(__pyx_r);
12572 __Pyx_RefNannyFinishContext();
12585 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
12586 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12587 PyObject *__pyx_r = 0;
12588 __Pyx_RefNannyDeclarations
12589 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12590 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12593 __Pyx_RefNannyFinishContext();
12597 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12598 Py_ssize_t __pyx_v_suboffset;
12599 PyObject *__pyx_r = NULL;
12600 __Pyx_RefNannyDeclarations
12602 PyObject *__pyx_t_2 = NULL;
12603 PyObject *__pyx_t_3 = NULL;
12604 Py_ssize_t *__pyx_t_4;
12605 Py_ssize_t *__pyx_t_5;
12606 Py_ssize_t *__pyx_t_6;
12607 int __pyx_lineno = 0;
12608 const char *__pyx_filename = NULL;
12609 int __pyx_clineno = 0;
12610 __Pyx_RefNannySetupContext(
"__get__", 0);
12619 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12629 __Pyx_XDECREF(__pyx_r);
12630 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
12631 __Pyx_GOTREF(__pyx_t_2);
12632 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
12633 __Pyx_GOTREF(__pyx_t_3);
12634 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12635 __pyx_r = __pyx_t_3;
12655 __Pyx_XDECREF(__pyx_r);
12656 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12657 __Pyx_GOTREF(__pyx_t_3);
12658 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12659 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12660 __pyx_t_4 = __pyx_t_6;
12661 __pyx_v_suboffset = (__pyx_t_4[0]);
12662 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12663 __Pyx_GOTREF(__pyx_t_2);
12664 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
12665 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12667 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12668 __Pyx_GOTREF(__pyx_t_2);
12669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12670 __pyx_r = __pyx_t_2;
12684 __Pyx_XDECREF(__pyx_t_2);
12685 __Pyx_XDECREF(__pyx_t_3);
12686 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12689 __Pyx_XGIVEREF(__pyx_r);
12690 __Pyx_RefNannyFinishContext();
12703 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
12704 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12705 PyObject *__pyx_r = 0;
12706 __Pyx_RefNannyDeclarations
12707 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12708 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12711 __Pyx_RefNannyFinishContext();
12715 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12716 PyObject *__pyx_r = NULL;
12717 __Pyx_RefNannyDeclarations
12718 PyObject *__pyx_t_1 = NULL;
12719 int __pyx_lineno = 0;
12720 const char *__pyx_filename = NULL;
12721 int __pyx_clineno = 0;
12722 __Pyx_RefNannySetupContext(
"__get__", 0);
12731 __Pyx_XDECREF(__pyx_r);
12732 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
12733 __Pyx_GOTREF(__pyx_t_1);
12734 __pyx_r = __pyx_t_1;
12748 __Pyx_XDECREF(__pyx_t_1);
12749 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12752 __Pyx_XGIVEREF(__pyx_r);
12753 __Pyx_RefNannyFinishContext();
12766 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
12767 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12768 PyObject *__pyx_r = 0;
12769 __Pyx_RefNannyDeclarations
12770 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12771 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12774 __Pyx_RefNannyFinishContext();
12778 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12779 PyObject *__pyx_r = NULL;
12780 __Pyx_RefNannyDeclarations
12781 PyObject *__pyx_t_1 = NULL;
12782 int __pyx_lineno = 0;
12783 const char *__pyx_filename = NULL;
12784 int __pyx_clineno = 0;
12785 __Pyx_RefNannySetupContext(
"__get__", 0);
12794 __Pyx_XDECREF(__pyx_r);
12795 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
12796 __Pyx_GOTREF(__pyx_t_1);
12797 __pyx_r = __pyx_t_1;
12811 __Pyx_XDECREF(__pyx_t_1);
12812 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12815 __Pyx_XGIVEREF(__pyx_r);
12816 __Pyx_RefNannyFinishContext();
12829 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
12830 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12831 PyObject *__pyx_r = 0;
12832 __Pyx_RefNannyDeclarations
12833 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12834 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12837 __Pyx_RefNannyFinishContext();
12841 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12842 PyObject *__pyx_r = NULL;
12843 __Pyx_RefNannyDeclarations
12844 PyObject *__pyx_t_1 = NULL;
12845 PyObject *__pyx_t_2 = NULL;
12846 PyObject *__pyx_t_3 = NULL;
12847 int __pyx_lineno = 0;
12848 const char *__pyx_filename = NULL;
12849 int __pyx_clineno = 0;
12850 __Pyx_RefNannySetupContext(
"__get__", 0);
12859 __Pyx_XDECREF(__pyx_r);
12860 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
12861 __Pyx_GOTREF(__pyx_t_1);
12862 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
12863 __Pyx_GOTREF(__pyx_t_2);
12864 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
12865 __Pyx_GOTREF(__pyx_t_3);
12866 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12867 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12868 __pyx_r = __pyx_t_3;
12882 __Pyx_XDECREF(__pyx_t_1);
12883 __Pyx_XDECREF(__pyx_t_2);
12884 __Pyx_XDECREF(__pyx_t_3);
12885 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12888 __Pyx_XGIVEREF(__pyx_r);
12889 __Pyx_RefNannyFinishContext();
12902 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
12903 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12904 PyObject *__pyx_r = 0;
12905 __Pyx_RefNannyDeclarations
12906 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12907 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12910 __Pyx_RefNannyFinishContext();
12914 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12915 PyObject *__pyx_v_result = NULL;
12916 PyObject *__pyx_v_length = NULL;
12917 PyObject *__pyx_r = NULL;
12918 __Pyx_RefNannyDeclarations
12921 Py_ssize_t *__pyx_t_3;
12922 Py_ssize_t *__pyx_t_4;
12923 Py_ssize_t *__pyx_t_5;
12924 PyObject *__pyx_t_6 = NULL;
12925 int __pyx_lineno = 0;
12926 const char *__pyx_filename = NULL;
12927 int __pyx_clineno = 0;
12928 __Pyx_RefNannySetupContext(
"__get__", 0);
12937 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12938 __pyx_t_2 = (__pyx_t_1 != 0);
12948 __Pyx_INCREF(__pyx_int_1);
12949 __pyx_v_result = __pyx_int_1;
12958 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12959 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12960 __pyx_t_3 = __pyx_t_5;
12961 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
12962 __Pyx_GOTREF(__pyx_t_6);
12963 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12973 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
12974 __Pyx_GOTREF(__pyx_t_6);
12975 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12986 __Pyx_INCREF(__pyx_v_result);
12987 __Pyx_GIVEREF(__pyx_v_result);
12988 __Pyx_GOTREF(__pyx_v_self->_size);
12989 __Pyx_DECREF(__pyx_v_self->_size);
12990 __pyx_v_self->_size = __pyx_v_result;
13008 __Pyx_XDECREF(__pyx_r);
13009 __Pyx_INCREF(__pyx_v_self->_size);
13010 __pyx_r = __pyx_v_self->_size;
13023 __Pyx_XDECREF(__pyx_t_6);
13024 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13027 __Pyx_XDECREF(__pyx_v_result);
13028 __Pyx_XDECREF(__pyx_v_length);
13029 __Pyx_XGIVEREF(__pyx_r);
13030 __Pyx_RefNannyFinishContext();
13043 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13044 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13045 Py_ssize_t __pyx_r;
13046 __Pyx_RefNannyDeclarations
13047 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13048 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13051 __Pyx_RefNannyFinishContext();
13055 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13056 Py_ssize_t __pyx_r;
13057 __Pyx_RefNannyDeclarations
13059 __Pyx_RefNannySetupContext(
"__len__", 0);
13068 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13078 __pyx_r = (__pyx_v_self->view.shape[0]);
13110 __Pyx_RefNannyFinishContext();
13123 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13124 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13125 PyObject *__pyx_r = 0;
13126 __Pyx_RefNannyDeclarations
13127 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13128 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13131 __Pyx_RefNannyFinishContext();
13135 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13136 PyObject *__pyx_r = NULL;
13137 __Pyx_RefNannyDeclarations
13138 PyObject *__pyx_t_1 = NULL;
13139 PyObject *__pyx_t_2 = NULL;
13140 PyObject *__pyx_t_3 = NULL;
13141 int __pyx_lineno = 0;
13142 const char *__pyx_filename = NULL;
13143 int __pyx_clineno = 0;
13144 __Pyx_RefNannySetupContext(
"__repr__", 0);
13153 __Pyx_XDECREF(__pyx_r);
13154 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13155 __Pyx_GOTREF(__pyx_t_1);
13156 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13157 __Pyx_GOTREF(__pyx_t_2);
13158 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13159 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13160 __Pyx_GOTREF(__pyx_t_1);
13161 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13170 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13171 __Pyx_GOTREF(__pyx_t_2);
13180 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13181 __Pyx_GOTREF(__pyx_t_3);
13182 __Pyx_GIVEREF(__pyx_t_1);
13183 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13184 __Pyx_GIVEREF(__pyx_t_2);
13185 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13188 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13189 __Pyx_GOTREF(__pyx_t_2);
13190 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13191 __pyx_r = __pyx_t_2;
13205 __Pyx_XDECREF(__pyx_t_1);
13206 __Pyx_XDECREF(__pyx_t_2);
13207 __Pyx_XDECREF(__pyx_t_3);
13208 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13211 __Pyx_XGIVEREF(__pyx_r);
13212 __Pyx_RefNannyFinishContext();
13225 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
13226 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13227 PyObject *__pyx_r = 0;
13228 __Pyx_RefNannyDeclarations
13229 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
13230 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13233 __Pyx_RefNannyFinishContext();
13237 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13238 PyObject *__pyx_r = NULL;
13239 __Pyx_RefNannyDeclarations
13240 PyObject *__pyx_t_1 = NULL;
13241 PyObject *__pyx_t_2 = NULL;
13242 int __pyx_lineno = 0;
13243 const char *__pyx_filename = NULL;
13244 int __pyx_clineno = 0;
13245 __Pyx_RefNannySetupContext(
"__str__", 0);
13254 __Pyx_XDECREF(__pyx_r);
13255 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13256 __Pyx_GOTREF(__pyx_t_1);
13257 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13258 __Pyx_GOTREF(__pyx_t_2);
13259 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13260 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13261 __Pyx_GOTREF(__pyx_t_1);
13262 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13263 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13264 __Pyx_GOTREF(__pyx_t_2);
13265 __Pyx_GIVEREF(__pyx_t_1);
13266 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13268 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13269 __Pyx_GOTREF(__pyx_t_1);
13270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13271 __pyx_r = __pyx_t_1;
13285 __Pyx_XDECREF(__pyx_t_1);
13286 __Pyx_XDECREF(__pyx_t_2);
13287 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13290 __Pyx_XGIVEREF(__pyx_r);
13291 __Pyx_RefNannyFinishContext();
13304 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13305 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13306 PyObject *__pyx_r = 0;
13307 __Pyx_RefNannyDeclarations
13308 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
13309 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13312 __Pyx_RefNannyFinishContext();
13316 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13317 __Pyx_memviewslice *__pyx_v_mslice;
13318 __Pyx_memviewslice __pyx_v_tmp;
13319 PyObject *__pyx_r = NULL;
13320 __Pyx_RefNannyDeclarations
13321 __Pyx_memviewslice *__pyx_t_1;
13322 PyObject *__pyx_t_2 = NULL;
13323 int __pyx_lineno = 0;
13324 const char *__pyx_filename = NULL;
13325 int __pyx_clineno = 0;
13326 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
13335 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
13336 __pyx_v_mslice = __pyx_t_1;
13345 __Pyx_XDECREF(__pyx_r);
13346 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
13347 __Pyx_GOTREF(__pyx_t_2);
13348 __pyx_r = __pyx_t_2;
13362 __Pyx_XDECREF(__pyx_t_2);
13363 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13366 __Pyx_XGIVEREF(__pyx_r);
13367 __Pyx_RefNannyFinishContext();
13380 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13381 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13382 PyObject *__pyx_r = 0;
13383 __Pyx_RefNannyDeclarations
13384 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
13385 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13388 __Pyx_RefNannyFinishContext();
13392 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13393 __Pyx_memviewslice *__pyx_v_mslice;
13394 __Pyx_memviewslice __pyx_v_tmp;
13395 PyObject *__pyx_r = NULL;
13396 __Pyx_RefNannyDeclarations
13397 __Pyx_memviewslice *__pyx_t_1;
13398 PyObject *__pyx_t_2 = NULL;
13399 int __pyx_lineno = 0;
13400 const char *__pyx_filename = NULL;
13401 int __pyx_clineno = 0;
13402 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
13411 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
13412 __pyx_v_mslice = __pyx_t_1;
13421 __Pyx_XDECREF(__pyx_r);
13422 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
13423 __Pyx_GOTREF(__pyx_t_2);
13424 __pyx_r = __pyx_t_2;
13438 __Pyx_XDECREF(__pyx_t_2);
13439 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13442 __Pyx_XGIVEREF(__pyx_r);
13443 __Pyx_RefNannyFinishContext();
13456 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13457 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13458 PyObject *__pyx_r = 0;
13459 __Pyx_RefNannyDeclarations
13460 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
13461 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13464 __Pyx_RefNannyFinishContext();
13468 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
13469 __Pyx_memviewslice __pyx_v_mslice;
13471 PyObject *__pyx_r = NULL;
13472 __Pyx_RefNannyDeclarations
13473 __Pyx_memviewslice __pyx_t_1;
13474 PyObject *__pyx_t_2 = NULL;
13475 int __pyx_lineno = 0;
13476 const char *__pyx_filename = NULL;
13477 int __pyx_clineno = 0;
13478 __Pyx_RefNannySetupContext(
"copy", 0);
13487 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13496 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13505 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
13506 __pyx_v_mslice = __pyx_t_1;
13515 __Pyx_XDECREF(__pyx_r);
13516 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
13517 __Pyx_GOTREF(__pyx_t_2);
13518 __pyx_r = __pyx_t_2;
13532 __Pyx_XDECREF(__pyx_t_2);
13533 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13536 __Pyx_XGIVEREF(__pyx_r);
13537 __Pyx_RefNannyFinishContext();
13550 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13551 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13552 PyObject *__pyx_r = 0;
13553 __Pyx_RefNannyDeclarations
13554 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
13555 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13558 __Pyx_RefNannyFinishContext();
13562 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
13563 __Pyx_memviewslice __pyx_v_src;
13564 __Pyx_memviewslice __pyx_v_dst;
13566 PyObject *__pyx_r = NULL;
13567 __Pyx_RefNannyDeclarations
13568 __Pyx_memviewslice __pyx_t_1;
13569 PyObject *__pyx_t_2 = NULL;
13570 int __pyx_lineno = 0;
13571 const char *__pyx_filename = NULL;
13572 int __pyx_clineno = 0;
13573 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
13582 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13591 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13600 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
13601 __pyx_v_dst = __pyx_t_1;
13610 __Pyx_XDECREF(__pyx_r);
13611 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
13612 __Pyx_GOTREF(__pyx_t_2);
13613 __pyx_r = __pyx_t_2;
13627 __Pyx_XDECREF(__pyx_t_2);
13628 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13631 __Pyx_XGIVEREF(__pyx_r);
13632 __Pyx_RefNannyFinishContext();
13643 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13644 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13645 PyObject *__pyx_r = 0;
13646 __Pyx_RefNannyDeclarations
13647 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13648 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13651 __Pyx_RefNannyFinishContext();
13655 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
13656 PyObject *__pyx_r = NULL;
13657 __Pyx_RefNannyDeclarations
13658 PyObject *__pyx_t_1 = NULL;
13659 int __pyx_lineno = 0;
13660 const char *__pyx_filename = NULL;
13661 int __pyx_clineno = 0;
13662 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13670 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13671 __Pyx_GOTREF(__pyx_t_1);
13672 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13673 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13674 __PYX_ERR(1, 2, __pyx_L1_error)
13684 __Pyx_XDECREF(__pyx_t_1);
13685 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13687 __Pyx_XGIVEREF(__pyx_r);
13688 __Pyx_RefNannyFinishContext();
13700 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13701 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13702 PyObject *__pyx_r = 0;
13703 __Pyx_RefNannyDeclarations
13704 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13705 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13708 __Pyx_RefNannyFinishContext();
13712 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13713 PyObject *__pyx_r = NULL;
13714 __Pyx_RefNannyDeclarations
13715 PyObject *__pyx_t_1 = NULL;
13716 int __pyx_lineno = 0;
13717 const char *__pyx_filename = NULL;
13718 int __pyx_clineno = 0;
13719 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13726 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13727 __Pyx_GOTREF(__pyx_t_1);
13728 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13730 __PYX_ERR(1, 4, __pyx_L1_error)
13741 __Pyx_XDECREF(__pyx_t_1);
13742 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13744 __Pyx_XGIVEREF(__pyx_r);
13745 __Pyx_RefNannyFinishContext();
13757 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13758 struct __pyx_memoryview_obj *__pyx_v_result = 0;
13759 PyObject *__pyx_r = NULL;
13760 __Pyx_RefNannyDeclarations
13761 PyObject *__pyx_t_1 = NULL;
13762 PyObject *__pyx_t_2 = NULL;
13763 PyObject *__pyx_t_3 = NULL;
13764 int __pyx_lineno = 0;
13765 const char *__pyx_filename = NULL;
13766 int __pyx_clineno = 0;
13767 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
13776 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
13777 __Pyx_GOTREF(__pyx_t_1);
13778 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13779 __Pyx_GOTREF(__pyx_t_2);
13780 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
13781 __Pyx_GOTREF(__pyx_t_3);
13782 __Pyx_INCREF(__pyx_v_o);
13783 __Pyx_GIVEREF(__pyx_v_o);
13784 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13785 __Pyx_GIVEREF(__pyx_t_1);
13786 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13787 __Pyx_GIVEREF(__pyx_t_2);
13788 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13791 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13792 __Pyx_GOTREF(__pyx_t_2);
13793 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13794 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
13804 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13813 __Pyx_XDECREF(__pyx_r);
13814 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13815 __pyx_r = ((PyObject *)__pyx_v_result);
13828 __Pyx_XDECREF(__pyx_t_1);
13829 __Pyx_XDECREF(__pyx_t_2);
13830 __Pyx_XDECREF(__pyx_t_3);
13831 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13834 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13835 __Pyx_XGIVEREF(__pyx_r);
13836 __Pyx_RefNannyFinishContext();
13848 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13850 __Pyx_RefNannyDeclarations
13852 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
13861 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13862 __pyx_r = __pyx_t_1;
13875 __Pyx_RefNannyFinishContext();
13887 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
13888 PyObject *__pyx_v_tup = NULL;
13889 PyObject *__pyx_v_result = NULL;
13890 int __pyx_v_have_slices;
13891 int __pyx_v_seen_ellipsis;
13892 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13893 PyObject *__pyx_v_item = NULL;
13894 Py_ssize_t __pyx_v_nslices;
13895 PyObject *__pyx_r = NULL;
13896 __Pyx_RefNannyDeclarations
13899 PyObject *__pyx_t_3 = NULL;
13900 PyObject *__pyx_t_4 = NULL;
13901 Py_ssize_t __pyx_t_5;
13902 PyObject *(*__pyx_t_6)(PyObject *);
13903 PyObject *__pyx_t_7 = NULL;
13904 Py_ssize_t __pyx_t_8;
13907 PyObject *__pyx_t_11 = NULL;
13908 int __pyx_lineno = 0;
13909 const char *__pyx_filename = NULL;
13910 int __pyx_clineno = 0;
13911 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
13920 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13921 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13931 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
13932 __Pyx_GOTREF(__pyx_t_3);
13933 __Pyx_INCREF(__pyx_v_index);
13934 __Pyx_GIVEREF(__pyx_v_index);
13935 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13936 __pyx_v_tup = __pyx_t_3;
13957 __Pyx_INCREF(__pyx_v_index);
13958 __pyx_v_tup = __pyx_v_index;
13969 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
13970 __Pyx_GOTREF(__pyx_t_3);
13971 __pyx_v_result = ((PyObject*)__pyx_t_3);
13981 __pyx_v_have_slices = 0;
13990 __pyx_v_seen_ellipsis = 0;
13999 __Pyx_INCREF(__pyx_int_0);
14000 __pyx_t_3 = __pyx_int_0;
14001 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14002 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14005 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14006 __Pyx_GOTREF(__pyx_t_4);
14007 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14010 if (likely(!__pyx_t_6)) {
14011 if (likely(PyList_CheckExact(__pyx_t_4))) {
14012 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14013 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14014 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14016 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14017 __Pyx_GOTREF(__pyx_t_7);
14020 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14021 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14022 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14024 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14025 __Pyx_GOTREF(__pyx_t_7);
14029 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14030 if (unlikely(!__pyx_t_7)) {
14031 PyObject* exc_type = PyErr_Occurred();
14033 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14034 else __PYX_ERR(1, 679, __pyx_L1_error)
14038 __Pyx_GOTREF(__pyx_t_7);
14040 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14042 __Pyx_INCREF(__pyx_t_3);
14043 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14044 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14045 __Pyx_GOTREF(__pyx_t_7);
14046 __Pyx_DECREF(__pyx_t_3);
14047 __pyx_t_3 = __pyx_t_7;
14057 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14058 __pyx_t_1 = (__pyx_t_2 != 0);
14068 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14078 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14079 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14080 __Pyx_GOTREF(__pyx_t_7);
14081 { Py_ssize_t __pyx_temp;
14082 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14083 __Pyx_INCREF(__pyx_slice__22);
14084 __Pyx_GIVEREF(__pyx_slice__22);
14085 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22);
14088 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14089 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14098 __pyx_v_seen_ellipsis = 1;
14118 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14129 __pyx_v_have_slices = 1;
14149 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14150 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14153 __pyx_t_1 = __pyx_t_10;
14154 goto __pyx_L9_bool_binop_done;
14156 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14157 __pyx_t_1 = __pyx_t_10;
14158 __pyx_L9_bool_binop_done:;
14159 if (unlikely(__pyx_t_1)) {
14168 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14169 __Pyx_GOTREF(__pyx_t_7);
14170 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14171 __Pyx_GOTREF(__pyx_t_11);
14172 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14173 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14174 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14175 __PYX_ERR(1, 689, __pyx_L1_error)
14193 __pyx_t_10 = (__pyx_v_have_slices != 0);
14196 __pyx_t_1 = __pyx_t_10;
14197 goto __pyx_L11_bool_binop_done;
14199 __pyx_t_10 = PySlice_Check(__pyx_v_item);
14200 __pyx_t_2 = (__pyx_t_10 != 0);
14201 __pyx_t_1 = __pyx_t_2;
14202 __pyx_L11_bool_binop_done:;
14203 __pyx_v_have_slices = __pyx_t_1;
14212 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
14224 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14225 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14234 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14235 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14244 __pyx_t_1 = (__pyx_v_nslices != 0);
14254 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
14255 __Pyx_GOTREF(__pyx_t_3);
14256 { Py_ssize_t __pyx_temp;
14257 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14258 __Pyx_INCREF(__pyx_slice__22);
14259 __Pyx_GIVEREF(__pyx_slice__22);
14260 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22);
14263 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14264 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14282 __Pyx_XDECREF(__pyx_r);
14283 if (!__pyx_v_have_slices) {
14285 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14286 __Pyx_GOTREF(__pyx_t_4);
14287 __pyx_t_3 = __pyx_t_4;
14289 goto __pyx_L14_bool_binop_done;
14291 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14292 __Pyx_GOTREF(__pyx_t_4);
14293 __pyx_t_3 = __pyx_t_4;
14295 __pyx_L14_bool_binop_done:;
14296 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14297 __Pyx_GOTREF(__pyx_t_4);
14298 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
14299 __Pyx_GOTREF(__pyx_t_11);
14300 __Pyx_GIVEREF(__pyx_t_3);
14301 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14302 __Pyx_GIVEREF(__pyx_t_4);
14303 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14306 __pyx_r = ((PyObject*)__pyx_t_11);
14320 __Pyx_XDECREF(__pyx_t_3);
14321 __Pyx_XDECREF(__pyx_t_4);
14322 __Pyx_XDECREF(__pyx_t_7);
14323 __Pyx_XDECREF(__pyx_t_11);
14324 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14327 __Pyx_XDECREF(__pyx_v_tup);
14328 __Pyx_XDECREF(__pyx_v_result);
14329 __Pyx_XDECREF(__pyx_v_idx);
14330 __Pyx_XDECREF(__pyx_v_item);
14331 __Pyx_XGIVEREF(__pyx_r);
14332 __Pyx_RefNannyFinishContext();
14344 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
14345 Py_ssize_t __pyx_v_suboffset;
14346 PyObject *__pyx_r = NULL;
14347 __Pyx_RefNannyDeclarations
14348 Py_ssize_t *__pyx_t_1;
14349 Py_ssize_t *__pyx_t_2;
14350 Py_ssize_t *__pyx_t_3;
14352 PyObject *__pyx_t_5 = NULL;
14353 int __pyx_lineno = 0;
14354 const char *__pyx_filename = NULL;
14355 int __pyx_clineno = 0;
14356 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
14365 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14366 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14367 __pyx_t_1 = __pyx_t_3;
14368 __pyx_v_suboffset = (__pyx_t_1[0]);
14377 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14378 if (unlikely(__pyx_t_4)) {
14387 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
14388 __Pyx_GOTREF(__pyx_t_5);
14389 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14390 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14391 __PYX_ERR(1, 703, __pyx_L1_error)
14412 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14415 __Pyx_XDECREF(__pyx_t_5);
14416 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14419 __Pyx_XGIVEREF(__pyx_r);
14420 __Pyx_RefNannyFinishContext();
14432 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14433 int __pyx_v_new_ndim;
14434 int __pyx_v_suboffset_dim;
14436 __Pyx_memviewslice __pyx_v_src;
14437 __Pyx_memviewslice __pyx_v_dst;
14438 __Pyx_memviewslice *__pyx_v_p_src;
14439 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14440 __Pyx_memviewslice *__pyx_v_p_dst;
14441 int *__pyx_v_p_suboffset_dim;
14442 Py_ssize_t __pyx_v_start;
14443 Py_ssize_t __pyx_v_stop;
14444 Py_ssize_t __pyx_v_step;
14445 int __pyx_v_have_start;
14446 int __pyx_v_have_stop;
14447 int __pyx_v_have_step;
14448 PyObject *__pyx_v_index = NULL;
14449 struct __pyx_memoryview_obj *__pyx_r = NULL;
14450 __Pyx_RefNannyDeclarations
14453 PyObject *__pyx_t_3 = NULL;
14454 struct __pyx_memoryview_obj *__pyx_t_4;
14457 Py_ssize_t __pyx_t_7;
14458 PyObject *(*__pyx_t_8)(PyObject *);
14459 PyObject *__pyx_t_9 = NULL;
14460 Py_ssize_t __pyx_t_10;
14462 Py_ssize_t __pyx_t_12;
14463 int __pyx_lineno = 0;
14464 const char *__pyx_filename = NULL;
14465 int __pyx_clineno = 0;
14466 __Pyx_RefNannySetupContext(
"memview_slice", 0);
14475 __pyx_v_new_ndim = 0;
14476 __pyx_v_suboffset_dim = -1;
14485 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
14494 #ifndef CYTHON_WITHOUT_ASSERTIONS
14495 if (unlikely(!Py_OptimizeFlag)) {
14496 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14497 PyErr_SetNone(PyExc_AssertionError);
14498 __PYX_ERR(1, 722, __pyx_L1_error)
14510 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14511 __pyx_t_2 = (__pyx_t_1 != 0);
14521 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
14522 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14523 __Pyx_INCREF(__pyx_t_3);
14524 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14534 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14554 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14563 __pyx_v_p_src = (&__pyx_v_src);
14574 __pyx_t_4 = __pyx_v_p_src->memview;
14575 __pyx_v_dst.memview = __pyx_t_4;
14584 __pyx_t_5 = __pyx_v_p_src->data;
14585 __pyx_v_dst.data = __pyx_t_5;
14594 __pyx_v_p_dst = (&__pyx_v_dst);
14603 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14613 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14614 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14617 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
14618 __Pyx_GOTREF(__pyx_t_3);
14619 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
14622 if (likely(!__pyx_t_8)) {
14623 if (likely(PyList_CheckExact(__pyx_t_3))) {
14624 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
14625 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14626 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14628 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14629 __Pyx_GOTREF(__pyx_t_9);
14632 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
14633 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14634 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14636 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14637 __Pyx_GOTREF(__pyx_t_9);
14641 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14642 if (unlikely(!__pyx_t_9)) {
14643 PyObject* exc_type = PyErr_Occurred();
14645 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14646 else __PYX_ERR(1, 746, __pyx_L1_error)
14650 __Pyx_GOTREF(__pyx_t_9);
14652 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14654 __pyx_v_dim = __pyx_t_6;
14655 __pyx_t_6 = (__pyx_t_6 + 1);
14664 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14674 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
14683 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
14702 __pyx_t_2 = (__pyx_v_index == Py_None);
14703 __pyx_t_1 = (__pyx_t_2 != 0);
14713 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14722 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14731 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
14740 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14760 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
14761 __Pyx_GOTREF(__pyx_t_9);
14762 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
14764 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14766 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
14767 __pyx_t_10 = __pyx_t_12;
14768 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14769 goto __pyx_L7_bool_binop_done;
14772 __pyx_L7_bool_binop_done:;
14773 __pyx_v_start = __pyx_t_10;
14782 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
14783 __Pyx_GOTREF(__pyx_t_9);
14784 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
14786 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14788 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
14789 __pyx_t_10 = __pyx_t_12;
14790 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14791 goto __pyx_L9_bool_binop_done;
14794 __pyx_L9_bool_binop_done:;
14795 __pyx_v_stop = __pyx_t_10;
14804 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
14805 __Pyx_GOTREF(__pyx_t_9);
14806 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
14808 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14810 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
14811 __pyx_t_10 = __pyx_t_12;
14812 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14813 goto __pyx_L11_bool_binop_done;
14816 __pyx_L11_bool_binop_done:;
14817 __pyx_v_step = __pyx_t_10;
14826 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
14827 __Pyx_GOTREF(__pyx_t_9);
14828 __pyx_t_1 = (__pyx_t_9 != Py_None);
14829 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14830 __pyx_v_have_start = __pyx_t_1;
14839 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
14840 __Pyx_GOTREF(__pyx_t_9);
14841 __pyx_t_1 = (__pyx_t_9 != Py_None);
14842 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14843 __pyx_v_have_stop = __pyx_t_1;
14852 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
14853 __Pyx_GOTREF(__pyx_t_9);
14854 __pyx_t_1 = (__pyx_t_9 != Py_None);
14855 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14856 __pyx_v_have_step = __pyx_t_1;
14865 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
14874 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14886 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14895 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14896 __pyx_t_2 = (__pyx_t_1 != 0);
14906 __Pyx_XDECREF(((PyObject *)__pyx_r));
14915 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
14924 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
14933 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
14934 __Pyx_GOTREF(__pyx_t_3);
14935 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
14936 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14957 __Pyx_XDECREF(((PyObject *)__pyx_r));
14966 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
14967 __Pyx_GOTREF(__pyx_t_3);
14976 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
14977 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14992 __Pyx_XDECREF(__pyx_t_3);
14993 __Pyx_XDECREF(__pyx_t_9);
14994 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14997 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14998 __Pyx_XDECREF(__pyx_v_index);
14999 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15000 __Pyx_RefNannyFinishContext();
15012 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
15013 Py_ssize_t __pyx_v_new_shape;
15014 int __pyx_v_negative_step;
15019 int __pyx_lineno = 0;
15020 const char *__pyx_filename = NULL;
15021 int __pyx_clineno = 0;
15030 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15040 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15050 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15068 __pyx_t_1 = (0 <= __pyx_v_start);
15070 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15072 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15082 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15111 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15114 __pyx_t_2 = __pyx_t_1;
15115 goto __pyx_L6_bool_binop_done;
15117 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15118 __pyx_t_2 = __pyx_t_1;
15119 __pyx_L6_bool_binop_done:;
15120 __pyx_v_negative_step = __pyx_t_2;
15129 __pyx_t_1 = (__pyx_v_have_step != 0);
15132 __pyx_t_2 = __pyx_t_1;
15133 goto __pyx_L9_bool_binop_done;
15135 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15136 __pyx_t_2 = __pyx_t_1;
15137 __pyx_L9_bool_binop_done:;
15147 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15165 __pyx_t_2 = (__pyx_v_have_start != 0);
15175 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15185 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15194 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15232 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15242 __pyx_t_2 = (__pyx_v_negative_step != 0);
15252 __pyx_v_start = (__pyx_v_shape - 1);
15272 __pyx_v_start = __pyx_v_shape;
15304 __pyx_t_2 = (__pyx_v_negative_step != 0);
15314 __pyx_v_start = (__pyx_v_shape - 1);
15347 __pyx_t_2 = (__pyx_v_have_stop != 0);
15357 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15367 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15376 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15414 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15424 __pyx_v_stop = __pyx_v_shape;
15454 __pyx_t_2 = (__pyx_v_negative_step != 0);
15464 __pyx_v_stop = -1
L;
15484 __pyx_v_stop = __pyx_v_shape;
15497 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15525 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15534 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15544 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15562 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15572 __pyx_v_new_shape = 0;
15590 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15599 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15608 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15619 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15629 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15649 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15650 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15661 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15671 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15681 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15691 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15719 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
15741 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15776 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15778 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15780 __Pyx_PyGILState_Release(__pyx_gilstate_save);
15796 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
15797 Py_ssize_t __pyx_v_shape;
15798 Py_ssize_t __pyx_v_stride;
15799 Py_ssize_t __pyx_v_suboffset;
15800 Py_ssize_t __pyx_v_itemsize;
15801 char *__pyx_v_resultp;
15803 __Pyx_RefNannyDeclarations
15804 Py_ssize_t __pyx_t_1;
15806 PyObject *__pyx_t_3 = NULL;
15807 PyObject *__pyx_t_4 = NULL;
15808 int __pyx_lineno = 0;
15809 const char *__pyx_filename = NULL;
15810 int __pyx_clineno = 0;
15811 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
15820 __pyx_v_suboffset = -1
L;
15829 __pyx_t_1 = __pyx_v_view->itemsize;
15830 __pyx_v_itemsize = __pyx_t_1;
15839 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
15849 if (unlikely(__pyx_v_itemsize == 0)) {
15850 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
15851 __PYX_ERR(1, 917, __pyx_L1_error)
15853 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
15854 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
15855 __PYX_ERR(1, 917, __pyx_L1_error)
15857 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
15866 __pyx_v_stride = __pyx_v_itemsize;
15886 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15895 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15904 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
15914 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15934 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15944 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15953 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15954 if (unlikely(__pyx_t_2)) {
15963 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
15964 __Pyx_GOTREF(__pyx_t_3);
15965 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
15966 __Pyx_GOTREF(__pyx_t_4);
15967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15968 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
15969 __Pyx_GOTREF(__pyx_t_3);
15970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15971 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15972 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15973 __PYX_ERR(1, 928, __pyx_L1_error)
16000 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16001 if (unlikely(__pyx_t_2)) {
16010 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16011 __Pyx_GOTREF(__pyx_t_3);
16012 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16013 __Pyx_GOTREF(__pyx_t_4);
16014 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16015 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16016 __Pyx_GOTREF(__pyx_t_3);
16017 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16018 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16019 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16020 __PYX_ERR(1, 931, __pyx_L1_error)
16038 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16047 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16057 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16075 __pyx_r = __pyx_v_resultp;
16088 __Pyx_XDECREF(__pyx_t_3);
16089 __Pyx_XDECREF(__pyx_t_4);
16090 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16093 __Pyx_RefNannyFinishContext();
16105 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16107 Py_ssize_t *__pyx_v_shape;
16108 Py_ssize_t *__pyx_v_strides;
16113 Py_ssize_t *__pyx_t_2;
16116 Py_ssize_t __pyx_t_5;
16117 Py_ssize_t __pyx_t_6;
16121 int __pyx_lineno = 0;
16122 const char *__pyx_filename = NULL;
16123 int __pyx_clineno = 0;
16132 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16133 __pyx_v_ndim = __pyx_t_1;
16142 __pyx_t_2 = __pyx_v_memslice->shape;
16143 __pyx_v_shape = __pyx_t_2;
16152 __pyx_t_2 = __pyx_v_memslice->strides;
16153 __pyx_v_strides = __pyx_t_2;
16162 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16163 __pyx_t_4 = __pyx_t_3;
16164 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16165 __pyx_v_i = __pyx_t_1;
16174 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16183 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16184 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16185 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16186 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16195 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16196 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16197 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16198 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16207 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16210 __pyx_t_7 = __pyx_t_8;
16211 goto __pyx_L6_bool_binop_done;
16213 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16214 __pyx_t_7 = __pyx_t_8;
16215 __pyx_L6_bool_binop_done:;
16225 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
16259 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16261 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16263 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16280 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16281 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16282 __Pyx_RefNannyDeclarations
16283 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16284 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16287 __Pyx_RefNannyFinishContext();
16290 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16291 __Pyx_RefNannyDeclarations
16292 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
16301 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16312 __Pyx_RefNannyFinishContext();
16323 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16324 PyObject *__pyx_r = NULL;
16325 __Pyx_RefNannyDeclarations
16327 PyObject *__pyx_t_2 = NULL;
16328 int __pyx_lineno = 0;
16329 const char *__pyx_filename = NULL;
16330 int __pyx_clineno = 0;
16331 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16340 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16350 __Pyx_XDECREF(__pyx_r);
16351 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
16352 __Pyx_GOTREF(__pyx_t_2);
16353 __pyx_r = __pyx_t_2;
16374 __Pyx_XDECREF(__pyx_r);
16375 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16376 __Pyx_GOTREF(__pyx_t_2);
16377 __pyx_r = __pyx_t_2;
16392 __Pyx_XDECREF(__pyx_t_2);
16393 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16396 __Pyx_XGIVEREF(__pyx_r);
16397 __Pyx_RefNannyFinishContext();
16409 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16410 PyObject *__pyx_r = NULL;
16411 __Pyx_RefNannyDeclarations
16414 PyObject *__pyx_t_3 = NULL;
16415 int __pyx_lineno = 0;
16416 const char *__pyx_filename = NULL;
16417 int __pyx_clineno = 0;
16418 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16427 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16437 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
16457 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
16458 __Pyx_GOTREF(__pyx_t_3);
16459 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16472 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16475 __Pyx_XDECREF(__pyx_t_3);
16476 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16479 __Pyx_XGIVEREF(__pyx_r);
16480 __Pyx_RefNannyFinishContext();
16493 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
16494 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16495 PyObject *__pyx_r = 0;
16496 __Pyx_RefNannyDeclarations
16497 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16498 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16501 __Pyx_RefNannyFinishContext();
16505 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16506 PyObject *__pyx_r = NULL;
16507 __Pyx_RefNannyDeclarations
16508 __Pyx_RefNannySetupContext(
"__get__", 0);
16517 __Pyx_XDECREF(__pyx_r);
16518 __Pyx_INCREF(__pyx_v_self->from_object);
16519 __pyx_r = __pyx_v_self->from_object;
16532 __Pyx_XGIVEREF(__pyx_r);
16533 __Pyx_RefNannyFinishContext();
16544 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16545 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16546 PyObject *__pyx_r = 0;
16547 __Pyx_RefNannyDeclarations
16548 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
16549 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16552 __Pyx_RefNannyFinishContext();
16556 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16557 PyObject *__pyx_r = NULL;
16558 __Pyx_RefNannyDeclarations
16559 PyObject *__pyx_t_1 = NULL;
16560 int __pyx_lineno = 0;
16561 const char *__pyx_filename = NULL;
16562 int __pyx_clineno = 0;
16563 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
16571 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16572 __Pyx_GOTREF(__pyx_t_1);
16573 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16575 __PYX_ERR(1, 2, __pyx_L1_error)
16585 __Pyx_XDECREF(__pyx_t_1);
16586 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16588 __Pyx_XGIVEREF(__pyx_r);
16589 __Pyx_RefNannyFinishContext();
16601 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
16602 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16603 PyObject *__pyx_r = 0;
16604 __Pyx_RefNannyDeclarations
16605 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
16606 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16609 __Pyx_RefNannyFinishContext();
16613 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16614 PyObject *__pyx_r = NULL;
16615 __Pyx_RefNannyDeclarations
16616 PyObject *__pyx_t_1 = NULL;
16617 int __pyx_lineno = 0;
16618 const char *__pyx_filename = NULL;
16619 int __pyx_clineno = 0;
16620 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
16627 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16628 __Pyx_GOTREF(__pyx_t_1);
16629 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16630 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16631 __PYX_ERR(1, 4, __pyx_L1_error)
16642 __Pyx_XDECREF(__pyx_t_1);
16643 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16645 __Pyx_XGIVEREF(__pyx_r);
16646 __Pyx_RefNannyFinishContext();
16658 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
16659 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16660 Py_ssize_t __pyx_v_suboffset;
16661 PyObject *__pyx_v_length = NULL;
16662 PyObject *__pyx_r = NULL;
16663 __Pyx_RefNannyDeclarations
16665 PyObject *__pyx_t_2 = NULL;
16666 PyObject *__pyx_t_3 = NULL;
16667 __Pyx_TypeInfo *__pyx_t_4;
16668 Py_buffer __pyx_t_5;
16669 Py_ssize_t *__pyx_t_6;
16670 Py_ssize_t *__pyx_t_7;
16671 Py_ssize_t *__pyx_t_8;
16672 Py_ssize_t __pyx_t_9;
16673 int __pyx_lineno = 0;
16674 const char *__pyx_filename = NULL;
16675 int __pyx_clineno = 0;
16676 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
16685 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16695 __Pyx_XDECREF(__pyx_r);
16696 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16715 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
16716 __Pyx_GOTREF(__pyx_t_2);
16717 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
16718 __Pyx_GOTREF(__pyx_t_3);
16719 __Pyx_INCREF(Py_None);
16720 __Pyx_GIVEREF(Py_None);
16721 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
16722 __Pyx_INCREF(__pyx_int_0);
16723 __Pyx_GIVEREF(__pyx_int_0);
16724 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
16725 __Pyx_GIVEREF(__pyx_t_2);
16726 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16728 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
16729 __Pyx_GOTREF(__pyx_t_2);
16730 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16731 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16741 __pyx_v_result->from_slice = __pyx_v_memviewslice;
16750 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16759 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
16760 __Pyx_GOTREF(__pyx_t_2);
16761 __Pyx_GIVEREF(__pyx_t_2);
16762 __Pyx_GOTREF(__pyx_v_result->from_object);
16763 __Pyx_DECREF(__pyx_v_result->from_object);
16764 __pyx_v_result->from_object = __pyx_t_2;
16774 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16775 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16784 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16785 __pyx_v_result->__pyx_base.view = __pyx_t_5;
16794 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
16803 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16812 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16821 Py_INCREF(Py_None);
16830 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16840 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16860 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16871 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16880 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16889 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16898 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16899 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16900 __pyx_t_6 = __pyx_t_8;
16901 __pyx_v_suboffset = (__pyx_t_6[0]);
16910 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16920 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16929 goto __pyx_L6_break;
16949 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16950 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16959 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16960 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16961 __pyx_t_6 = __pyx_t_8;
16962 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
16963 __Pyx_GOTREF(__pyx_t_2);
16964 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16974 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
16975 __Pyx_GOTREF(__pyx_t_2);
16976 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
16977 __Pyx_GOTREF(__pyx_t_3);
16978 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16979 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
16980 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16981 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16991 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17000 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17009 __Pyx_XDECREF(__pyx_r);
17010 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17011 __pyx_r = ((PyObject *)__pyx_v_result);
17024 __Pyx_XDECREF(__pyx_t_2);
17025 __Pyx_XDECREF(__pyx_t_3);
17026 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17029 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17030 __Pyx_XDECREF(__pyx_v_length);
17031 __Pyx_XGIVEREF(__pyx_r);
17032 __Pyx_RefNannyFinishContext();
17044 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17045 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17046 __Pyx_memviewslice *__pyx_r;
17047 __Pyx_RefNannyDeclarations
17050 PyObject *__pyx_t_3 = NULL;
17051 int __pyx_lineno = 0;
17052 const char *__pyx_filename = NULL;
17053 int __pyx_clineno = 0;
17054 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17063 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17064 __pyx_t_2 = (__pyx_t_1 != 0);
17074 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17075 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17076 __Pyx_INCREF(__pyx_t_3);
17077 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17087 __pyx_r = (&__pyx_v_obj->from_slice);
17107 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17116 __pyx_r = __pyx_v_mslice;
17130 __Pyx_XDECREF(__pyx_t_3);
17131 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17134 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17135 __Pyx_RefNannyFinishContext();
17147 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17149 Py_ssize_t *__pyx_v_shape;
17150 Py_ssize_t *__pyx_v_strides;
17151 Py_ssize_t *__pyx_v_suboffsets;
17152 __Pyx_RefNannyDeclarations
17153 Py_ssize_t *__pyx_t_1;
17157 Py_ssize_t __pyx_t_5;
17158 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17167 __pyx_t_1 = __pyx_v_memview->view.shape;
17168 __pyx_v_shape = __pyx_t_1;
17177 __pyx_t_1 = __pyx_v_memview->view.strides;
17178 __pyx_v_strides = __pyx_t_1;
17187 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17188 __pyx_v_suboffsets = __pyx_t_1;
17197 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17206 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17215 __pyx_t_2 = __pyx_v_memview->view.ndim;
17216 __pyx_t_3 = __pyx_t_2;
17217 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17218 __pyx_v_dim = __pyx_t_4;
17227 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17236 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17245 if ((__pyx_v_suboffsets != 0)) {
17246 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17250 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17262 __Pyx_RefNannyFinishContext();
17273 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
17274 __Pyx_memviewslice __pyx_v_memviewslice;
17275 PyObject *__pyx_r = NULL;
17276 __Pyx_RefNannyDeclarations
17277 PyObject *__pyx_t_1 = NULL;
17278 int __pyx_lineno = 0;
17279 const char *__pyx_filename = NULL;
17280 int __pyx_clineno = 0;
17281 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
17290 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17299 __Pyx_XDECREF(__pyx_r);
17300 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
17301 __Pyx_GOTREF(__pyx_t_1);
17302 __pyx_r = __pyx_t_1;
17316 __Pyx_XDECREF(__pyx_t_1);
17317 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17320 __Pyx_XGIVEREF(__pyx_r);
17321 __Pyx_RefNannyFinishContext();
17333 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17334 PyObject *(*__pyx_v_to_object_func)(
char *);
17335 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
17336 PyObject *__pyx_r = NULL;
17337 __Pyx_RefNannyDeclarations
17340 PyObject *(*__pyx_t_3)(
char *);
17341 int (*__pyx_t_4)(
char *, PyObject *);
17342 PyObject *__pyx_t_5 = NULL;
17343 int __pyx_lineno = 0;
17344 const char *__pyx_filename = NULL;
17345 int __pyx_clineno = 0;
17346 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
17355 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17356 __pyx_t_2 = (__pyx_t_1 != 0);
17366 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17367 __pyx_v_to_object_func = __pyx_t_3;
17376 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17377 __pyx_v_to_dtype_func = __pyx_t_4;
17397 __pyx_v_to_object_func = NULL;
17406 __pyx_v_to_dtype_func = NULL;
17417 __Pyx_XDECREF(__pyx_r);
17426 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
17427 __Pyx_GOTREF(__pyx_t_5);
17428 __pyx_r = __pyx_t_5;
17442 __Pyx_XDECREF(__pyx_t_5);
17443 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17446 __Pyx_XGIVEREF(__pyx_r);
17447 __Pyx_RefNannyFinishContext();
17459 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17460 Py_ssize_t __pyx_r;
17470 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17480 __pyx_r = (-__pyx_v_arg);
17500 __pyx_r = __pyx_v_arg;
17525 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
17527 Py_ssize_t __pyx_v_c_stride;
17528 Py_ssize_t __pyx_v_f_stride;
17542 __pyx_v_c_stride = 0;
17551 __pyx_v_f_stride = 0;
17560 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17561 __pyx_v_i = __pyx_t_1;
17570 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17580 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17589 goto __pyx_L4_break;
17609 __pyx_t_1 = __pyx_v_ndim;
17610 __pyx_t_3 = __pyx_t_1;
17611 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17612 __pyx_v_i = __pyx_t_4;
17621 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17631 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17640 goto __pyx_L7_break;
17660 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17715 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
17716 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17717 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
17718 Py_ssize_t __pyx_v_dst_extent;
17719 Py_ssize_t __pyx_v_src_stride;
17720 Py_ssize_t __pyx_v_dst_stride;
17724 Py_ssize_t __pyx_t_4;
17725 Py_ssize_t __pyx_t_5;
17726 Py_ssize_t __pyx_t_6;
17735 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17744 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17753 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17762 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17771 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17781 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
17784 __pyx_t_1 = __pyx_t_2;
17785 goto __pyx_L5_bool_binop_done;
17787 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
17790 __pyx_t_1 = __pyx_t_2;
17791 goto __pyx_L5_bool_binop_done;
17801 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17803 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17805 __pyx_t_3 = (__pyx_t_2 != 0);
17806 __pyx_t_1 = __pyx_t_3;
17807 __pyx_L5_bool_binop_done:;
17825 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17845 __pyx_t_4 = __pyx_v_dst_extent;
17846 __pyx_t_5 = __pyx_t_4;
17847 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17848 __pyx_v_i = __pyx_t_6;
17857 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17866 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17875 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17898 __pyx_t_4 = __pyx_v_dst_extent;
17899 __pyx_t_5 = __pyx_t_4;
17900 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17901 __pyx_v_i = __pyx_t_6;
17910 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17919 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17928 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17952 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
17961 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17982 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
17983 Py_ssize_t __pyx_v_shape;
17984 Py_ssize_t __pyx_v_size;
17985 Py_ssize_t __pyx_r;
17986 Py_ssize_t __pyx_t_1;
17987 Py_ssize_t *__pyx_t_2;
17988 Py_ssize_t *__pyx_t_3;
17989 Py_ssize_t *__pyx_t_4;
17998 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17999 __pyx_v_size = __pyx_t_1;
18008 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18009 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18010 __pyx_t_2 = __pyx_t_4;
18011 __pyx_v_shape = (__pyx_t_2[0]);
18020 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18030 __pyx_r = __pyx_v_size;
18054 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18056 Py_ssize_t __pyx_r;
18069 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18079 __pyx_t_2 = __pyx_v_ndim;
18080 __pyx_t_3 = __pyx_t_2;
18081 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18082 __pyx_v_idx = __pyx_t_4;
18091 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18100 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18121 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18122 __pyx_v_idx = __pyx_t_2;
18131 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18140 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18152 __pyx_r = __pyx_v_stride;
18176 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18178 void *__pyx_v_result;
18179 size_t __pyx_v_itemsize;
18180 size_t __pyx_v_size;
18182 Py_ssize_t __pyx_t_1;
18185 struct __pyx_memoryview_obj *__pyx_t_4;
18188 int __pyx_lineno = 0;
18189 const char *__pyx_filename = NULL;
18190 int __pyx_clineno = 0;
18199 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18200 __pyx_v_itemsize = __pyx_t_1;
18209 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18218 __pyx_v_result = malloc(__pyx_v_size);
18227 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18237 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
18255 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
18264 __pyx_t_4 = __pyx_v_src->memview;
18265 __pyx_v_tmpslice->memview = __pyx_t_4;
18274 __pyx_t_3 = __pyx_v_ndim;
18275 __pyx_t_5 = __pyx_t_3;
18276 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18277 __pyx_v_i = __pyx_t_6;
18286 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18295 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
18305 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18314 __pyx_t_3 = __pyx_v_ndim;
18315 __pyx_t_5 = __pyx_t_3;
18316 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18317 __pyx_v_i = __pyx_t_6;
18326 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18336 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18355 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18365 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18385 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18396 __pyx_r = __pyx_v_result;
18411 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18413 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18415 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18431 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18433 __Pyx_RefNannyDeclarations
18434 PyObject *__pyx_t_1 = NULL;
18435 PyObject *__pyx_t_2 = NULL;
18436 PyObject *__pyx_t_3 = NULL;
18437 PyObject *__pyx_t_4 = NULL;
18438 int __pyx_lineno = 0;
18439 const char *__pyx_filename = NULL;
18440 int __pyx_clineno = 0;
18442 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18444 __Pyx_RefNannySetupContext(
"_err_extents", 0);
18453 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
18454 __Pyx_GOTREF(__pyx_t_1);
18455 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
18456 __Pyx_GOTREF(__pyx_t_2);
18457 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
18458 __Pyx_GOTREF(__pyx_t_3);
18459 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
18460 __Pyx_GOTREF(__pyx_t_4);
18461 __Pyx_GIVEREF(__pyx_t_1);
18462 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18463 __Pyx_GIVEREF(__pyx_t_2);
18464 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18465 __Pyx_GIVEREF(__pyx_t_3);
18466 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18478 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
18479 __Pyx_GOTREF(__pyx_t_3);
18480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18481 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
18482 __Pyx_GOTREF(__pyx_t_4);
18483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18484 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18485 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18486 __PYX_ERR(1, 1253, __pyx_L1_error)
18498 __Pyx_XDECREF(__pyx_t_1);
18499 __Pyx_XDECREF(__pyx_t_2);
18500 __Pyx_XDECREF(__pyx_t_3);
18501 __Pyx_XDECREF(__pyx_t_4);
18502 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18504 __Pyx_RefNannyFinishContext();
18506 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18519 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
18521 __Pyx_RefNannyDeclarations
18522 PyObject *__pyx_t_1 = NULL;
18523 PyObject *__pyx_t_2 = NULL;
18524 PyObject *__pyx_t_3 = NULL;
18525 PyObject *__pyx_t_4 = NULL;
18526 int __pyx_lineno = 0;
18527 const char *__pyx_filename = NULL;
18528 int __pyx_clineno = 0;
18530 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18532 __Pyx_RefNannySetupContext(
"_err_dim", 0);
18533 __Pyx_INCREF(__pyx_v_error);
18542 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
18543 __Pyx_GOTREF(__pyx_t_2);
18544 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
18545 __Pyx_GOTREF(__pyx_t_3);
18546 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
18547 __Pyx_GOTREF(__pyx_t_4);
18548 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18549 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18550 __Pyx_INCREF(__pyx_v_error);
18551 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18552 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18553 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18554 if (likely(__pyx_t_2)) {
18555 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
18556 __Pyx_INCREF(__pyx_t_2);
18557 __Pyx_INCREF(
function);
18558 __Pyx_DECREF_SET(__pyx_t_3,
function);
18561 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
18562 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18563 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18564 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
18565 __Pyx_GOTREF(__pyx_t_1);
18566 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18567 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18568 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18569 __PYX_ERR(1, 1258, __pyx_L1_error)
18581 __Pyx_XDECREF(__pyx_t_1);
18582 __Pyx_XDECREF(__pyx_t_2);
18583 __Pyx_XDECREF(__pyx_t_3);
18584 __Pyx_XDECREF(__pyx_t_4);
18585 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18587 __Pyx_XDECREF(__pyx_v_error);
18588 __Pyx_RefNannyFinishContext();
18590 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18603 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
18605 __Pyx_RefNannyDeclarations
18607 PyObject *__pyx_t_2 = NULL;
18608 PyObject *__pyx_t_3 = NULL;
18609 PyObject *__pyx_t_4 = NULL;
18610 PyObject *__pyx_t_5 = NULL;
18611 int __pyx_lineno = 0;
18612 const char *__pyx_filename = NULL;
18613 int __pyx_clineno = 0;
18615 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18617 __Pyx_RefNannySetupContext(
"_err", 0);
18618 __Pyx_INCREF(__pyx_v_error);
18627 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18628 if (unlikely(__pyx_t_1)) {
18637 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
18638 __Pyx_GOTREF(__pyx_t_3);
18639 __Pyx_INCREF(__pyx_v_error);
18640 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
18641 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18642 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18643 if (likely(__pyx_t_5)) {
18644 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
18645 __Pyx_INCREF(__pyx_t_5);
18646 __Pyx_INCREF(
function);
18647 __Pyx_DECREF_SET(__pyx_t_4,
function);
18650 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
18651 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18652 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18653 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
18654 __Pyx_GOTREF(__pyx_t_2);
18655 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18656 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18657 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18658 __PYX_ERR(1, 1263, __pyx_L1_error)
18677 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18678 __PYX_ERR(1, 1265, __pyx_L1_error)
18691 __Pyx_XDECREF(__pyx_t_2);
18692 __Pyx_XDECREF(__pyx_t_3);
18693 __Pyx_XDECREF(__pyx_t_4);
18694 __Pyx_XDECREF(__pyx_t_5);
18695 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
18697 __Pyx_XDECREF(__pyx_v_error);
18698 __Pyx_RefNannyFinishContext();
18700 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18713 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
18714 void *__pyx_v_tmpdata;
18715 size_t __pyx_v_itemsize;
18717 char __pyx_v_order;
18718 int __pyx_v_broadcasting;
18719 int __pyx_v_direct_copy;
18720 __Pyx_memviewslice __pyx_v_tmp;
18723 Py_ssize_t __pyx_t_1;
18731 int __pyx_lineno = 0;
18732 const char *__pyx_filename = NULL;
18733 int __pyx_clineno = 0;
18742 __pyx_v_tmpdata = NULL;
18751 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18752 __pyx_v_itemsize = __pyx_t_1;
18761 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18770 __pyx_v_broadcasting = 0;
18779 __pyx_v_direct_copy = 0;
18788 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
18798 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18817 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
18827 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18846 __pyx_t_3 = __pyx_v_dst_ndim;
18847 __pyx_t_4 = __pyx_v_src_ndim;
18848 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
18849 __pyx_t_5 = __pyx_t_3;
18851 __pyx_t_5 = __pyx_t_4;
18853 __pyx_v_ndim = __pyx_t_5;
18862 __pyx_t_5 = __pyx_v_ndim;
18863 __pyx_t_3 = __pyx_t_5;
18864 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18865 __pyx_v_i = __pyx_t_4;
18874 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
18884 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
18894 __pyx_v_broadcasting = 1;
18903 (__pyx_v_src.strides[__pyx_v_i]) = 0;
18923 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
18943 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18953 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
18972 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
18982 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
18992 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19010 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19011 __pyx_v_tmpdata = __pyx_t_7;
19020 __pyx_v_src = __pyx_v_tmp;
19038 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19048 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19058 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19077 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19087 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19106 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19116 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19125 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19134 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19143 free(__pyx_v_tmpdata);
19180 __pyx_t_2 = (__pyx_v_order ==
'F');
19182 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19184 __pyx_t_8 = (__pyx_t_2 != 0);
19194 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
19203 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
19221 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19230 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19239 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19248 free(__pyx_v_tmpdata);
19272 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19274 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19276 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19292 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
19294 int __pyx_v_offset;
19306 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19315 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19316 __pyx_v_i = __pyx_t_1;
19325 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19334 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19343 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19353 __pyx_t_1 = __pyx_v_offset;
19354 __pyx_t_2 = __pyx_t_1;
19355 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19356 __pyx_v_i = __pyx_t_3;
19365 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19374 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19383 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
19405 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
19415 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19425 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19455 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19456 __Pyx_RefNannyDeclarations
19458 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19460 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
19469 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19480 __Pyx_RefNannyFinishContext();
19482 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19494 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19495 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19496 __Pyx_RefNannyDeclarations
19497 Py_ssize_t __pyx_t_1;
19498 Py_ssize_t __pyx_t_2;
19499 Py_ssize_t __pyx_t_3;
19501 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
19510 __pyx_t_1 = (__pyx_v_shape[0]);
19511 __pyx_t_2 = __pyx_t_1;
19512 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19513 __pyx_v_i = __pyx_t_3;
19522 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19532 __pyx_t_4 = (__pyx_v_inc != 0);
19542 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19562 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19592 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19603 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19615 __Pyx_RefNannyFinishContext();
19626 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
19635 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19644 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
19653 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19674 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
19675 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19676 Py_ssize_t __pyx_v_stride;
19677 Py_ssize_t __pyx_v_extent;
19679 Py_ssize_t __pyx_t_2;
19680 Py_ssize_t __pyx_t_3;
19681 Py_ssize_t __pyx_t_4;
19690 __pyx_v_stride = (__pyx_v_strides[0]);
19699 __pyx_v_extent = (__pyx_v_shape[0]);
19708 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19718 __pyx_t_2 = __pyx_v_extent;
19719 __pyx_t_3 = __pyx_t_2;
19720 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19721 __pyx_v_i = __pyx_t_4;
19730 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19739 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19760 __pyx_t_2 = __pyx_v_extent;
19761 __pyx_t_3 = __pyx_t_2;
19762 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19763 __pyx_v_i = __pyx_t_4;
19772 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
19781 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19804 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19805 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
19806 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19807 PyObject *__pyx_v___pyx_type = 0;
19808 long __pyx_v___pyx_checksum;
19809 PyObject *__pyx_v___pyx_state = 0;
19810 int __pyx_lineno = 0;
19811 const char *__pyx_filename = NULL;
19812 int __pyx_clineno = 0;
19813 PyObject *__pyx_r = 0;
19814 __Pyx_RefNannyDeclarations
19815 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
19817 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
19818 PyObject* values[3] = {0,0,0};
19819 if (unlikely(__pyx_kwds)) {
19820 Py_ssize_t kw_args;
19821 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19822 switch (pos_args) {
19823 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19824 CYTHON_FALLTHROUGH;
19825 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19826 CYTHON_FALLTHROUGH;
19827 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19828 CYTHON_FALLTHROUGH;
19830 default:
goto __pyx_L5_argtuple_error;
19832 kw_args = PyDict_Size(__pyx_kwds);
19833 switch (pos_args) {
19835 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
19836 else goto __pyx_L5_argtuple_error;
19837 CYTHON_FALLTHROUGH;
19839 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
19841 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
19843 CYTHON_FALLTHROUGH;
19845 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
19847 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
19850 if (unlikely(kw_args > 0)) {
19851 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
19853 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19854 goto __pyx_L5_argtuple_error;
19856 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19857 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19858 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19860 __pyx_v___pyx_type = values[0];
19861 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
19862 __pyx_v___pyx_state = values[2];
19864 goto __pyx_L4_argument_unpacking_done;
19865 __pyx_L5_argtuple_error:;
19866 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
19868 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19869 __Pyx_RefNannyFinishContext();
19871 __pyx_L4_argument_unpacking_done:;
19872 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
19875 __Pyx_RefNannyFinishContext();
19879 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
19880 PyObject *__pyx_v___pyx_PickleError = 0;
19881 PyObject *__pyx_v___pyx_result = 0;
19882 PyObject *__pyx_r = NULL;
19883 __Pyx_RefNannyDeclarations
19884 PyObject *__pyx_t_1 = NULL;
19887 PyObject *__pyx_t_4 = NULL;
19888 PyObject *__pyx_t_5 = NULL;
19889 PyObject *__pyx_t_6 = NULL;
19890 int __pyx_lineno = 0;
19891 const char *__pyx_filename = NULL;
19892 int __pyx_clineno = 0;
19893 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
19902 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
19903 __Pyx_GOTREF(__pyx_t_1);
19904 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__26, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
19905 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19906 __pyx_t_3 = (__pyx_t_2 != 0);
19916 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
19917 __Pyx_GOTREF(__pyx_t_1);
19918 __Pyx_INCREF(__pyx_n_s_PickleError);
19919 __Pyx_GIVEREF(__pyx_n_s_PickleError);
19920 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
19921 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
19922 __Pyx_GOTREF(__pyx_t_4);
19923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19924 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
19925 __Pyx_GOTREF(__pyx_t_1);
19926 __Pyx_INCREF(__pyx_t_1);
19927 __pyx_v___pyx_PickleError = __pyx_t_1;
19928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19929 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19938 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
19939 __Pyx_GOTREF(__pyx_t_1);
19940 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
19941 __Pyx_GOTREF(__pyx_t_5);
19942 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19943 __Pyx_INCREF(__pyx_v___pyx_PickleError);
19944 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
19945 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
19946 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
19947 if (likely(__pyx_t_6)) {
19948 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
19949 __Pyx_INCREF(__pyx_t_6);
19950 __Pyx_INCREF(
function);
19951 __Pyx_DECREF_SET(__pyx_t_1,
function);
19954 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
19955 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19956 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19957 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
19958 __Pyx_GOTREF(__pyx_t_4);
19959 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19960 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19961 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19962 __PYX_ERR(1, 6, __pyx_L1_error)
19980 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
19981 __Pyx_GOTREF(__pyx_t_1);
19983 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
19984 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
19985 if (likely(__pyx_t_5)) {
19986 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
19987 __Pyx_INCREF(__pyx_t_5);
19988 __Pyx_INCREF(
function);
19989 __Pyx_DECREF_SET(__pyx_t_1,
function);
19992 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
19993 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19994 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
19995 __Pyx_GOTREF(__pyx_t_4);
19996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19997 __pyx_v___pyx_result = __pyx_t_4;
20007 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20008 __pyx_t_2 = (__pyx_t_3 != 0);
20018 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20019 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20020 __Pyx_GOTREF(__pyx_t_4);
20021 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20039 __Pyx_XDECREF(__pyx_r);
20040 __Pyx_INCREF(__pyx_v___pyx_result);
20041 __pyx_r = __pyx_v___pyx_result;
20052 __Pyx_XDECREF(__pyx_t_1);
20053 __Pyx_XDECREF(__pyx_t_4);
20054 __Pyx_XDECREF(__pyx_t_5);
20055 __Pyx_XDECREF(__pyx_t_6);
20056 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20059 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20060 __Pyx_XDECREF(__pyx_v___pyx_result);
20061 __Pyx_XGIVEREF(__pyx_r);
20062 __Pyx_RefNannyFinishContext();
20074 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20075 PyObject *__pyx_r = NULL;
20076 __Pyx_RefNannyDeclarations
20077 PyObject *__pyx_t_1 = NULL;
20079 Py_ssize_t __pyx_t_3;
20082 PyObject *__pyx_t_6 = NULL;
20083 PyObject *__pyx_t_7 = NULL;
20084 PyObject *__pyx_t_8 = NULL;
20085 int __pyx_lineno = 0;
20086 const char *__pyx_filename = NULL;
20087 int __pyx_clineno = 0;
20088 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20097 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20098 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20099 __PYX_ERR(1, 12, __pyx_L1_error)
20101 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20102 __Pyx_GOTREF(__pyx_t_1);
20103 __Pyx_GIVEREF(__pyx_t_1);
20104 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20105 __Pyx_DECREF(__pyx_v___pyx_result->name);
20106 __pyx_v___pyx_result->name = __pyx_t_1;
20115 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20116 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20117 __PYX_ERR(1, 13, __pyx_L1_error)
20119 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20120 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20123 __pyx_t_2 = __pyx_t_4;
20124 goto __pyx_L4_bool_binop_done;
20126 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20127 __pyx_t_5 = (__pyx_t_4 != 0);
20128 __pyx_t_2 = __pyx_t_5;
20129 __pyx_L4_bool_binop_done:;
20137 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20138 __Pyx_GOTREF(__pyx_t_6);
20139 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20140 __Pyx_GOTREF(__pyx_t_7);
20141 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20142 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20143 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20144 __PYX_ERR(1, 14, __pyx_L1_error)
20146 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20147 __Pyx_GOTREF(__pyx_t_6);
20149 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20150 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20151 if (likely(__pyx_t_8)) {
20152 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
20153 __Pyx_INCREF(__pyx_t_8);
20154 __Pyx_INCREF(
function);
20155 __Pyx_DECREF_SET(__pyx_t_7,
function);
20158 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20159 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20160 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20161 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20162 __Pyx_GOTREF(__pyx_t_1);
20163 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20164 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20183 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20186 __Pyx_XDECREF(__pyx_t_1);
20187 __Pyx_XDECREF(__pyx_t_6);
20188 __Pyx_XDECREF(__pyx_t_7);
20189 __Pyx_XDECREF(__pyx_t_8);
20190 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20193 __Pyx_XGIVEREF(__pyx_r);
20194 __Pyx_RefNannyFinishContext();
20198 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
20200 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20201 o = (*t->tp_alloc)(t, 0);
20203 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20205 if (unlikely(!o))
return 0;
20206 if (unlikely(__pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o, a, k) < 0))
goto bad;
20209 Py_DECREF(o); o = 0;
20213 static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
20214 #if CYTHON_USE_TP_FINALIZE
20215 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20216 if (PyObject_CallFinalizerFromDealloc(o))
return;
20219 (*Py_TYPE(o)->tp_free)(o);
20222 static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
20223 {
"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, METH_NOARGS, 0},
20224 {
"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, METH_O, 0},
20228 static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
20229 PyVarObject_HEAD_INIT(0, 0)
20230 "superluWrappers.cSparseMatrix",
20231 sizeof(
struct __pyx_obj_15superluWrappers_cSparseMatrix),
20233 __pyx_tp_dealloc_15superluWrappers_cSparseMatrix,
20234 #
if PY_VERSION_HEX < 0x030800b4
20237 #
if PY_VERSION_HEX >= 0x030800b4
20242 #
if PY_MAJOR_VERSION < 3
20245 #
if PY_MAJOR_VERSION >= 3
20258 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
20266 __pyx_methods_15superluWrappers_cSparseMatrix,
20276 __pyx_tp_new_15superluWrappers_cSparseMatrix,
20286 #
if PY_VERSION_HEX >= 0x030400a1
20289 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20292 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20295 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20299 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
20301 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20302 struct __pyx_obj_15superluWrappers_SparseFactor *p;
20304 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20305 o = (*t->tp_alloc)(t, 0);
20307 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20309 if (unlikely(!o))
return 0;
20310 p = ((
struct __pyx_obj_15superluWrappers_SparseFactor *)o);
20311 p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
20315 static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
20316 #if CYTHON_USE_TP_FINALIZE
20317 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20318 if (PyObject_CallFinalizerFromDealloc(o))
return;
20321 (*Py_TYPE(o)->tp_free)(o);
20324 static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED
void *x) {
20325 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
20328 static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
20330 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o,
v);
20333 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
20338 static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
20339 {
"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, METH_NOARGS, 0},
20340 {
"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, METH_O, 0},
20344 static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
20345 {(
char *)
"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, (
char *)0, 0},
20349 static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
20350 PyVarObject_HEAD_INIT(0, 0)
20351 "superluWrappers.SparseFactor",
20352 sizeof(
struct __pyx_obj_15superluWrappers_SparseFactor),
20354 __pyx_tp_dealloc_15superluWrappers_SparseFactor,
20355 #
if PY_VERSION_HEX < 0x030800b4
20358 #
if PY_VERSION_HEX >= 0x030800b4
20363 #
if PY_MAJOR_VERSION < 3
20366 #
if PY_MAJOR_VERSION >= 3
20379 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
20387 __pyx_methods_15superluWrappers_SparseFactor,
20389 __pyx_getsets_15superluWrappers_SparseFactor,
20395 __pyx_pw_15superluWrappers_12SparseFactor_1__init__,
20397 __pyx_tp_new_15superluWrappers_SparseFactor,
20407 #
if PY_VERSION_HEX >= 0x030400a1
20410 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20413 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20416 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20420 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20422 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20423 struct __pyx_array_obj *p;
20425 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20426 o = (*t->tp_alloc)(t, 0);
20428 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20430 if (unlikely(!o))
return 0;
20431 p = ((
struct __pyx_array_obj *)o);
20432 p->__pyx_vtab = __pyx_vtabptr_array;
20433 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20434 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20435 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
20438 Py_DECREF(o); o = 0;
20442 static void __pyx_tp_dealloc_array(PyObject *o) {
20443 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
20444 #if CYTHON_USE_TP_FINALIZE
20445 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20446 if (PyObject_CallFinalizerFromDealloc(o))
return;
20450 PyObject *etype, *eval, *etb;
20451 PyErr_Fetch(&etype, &eval, &etb);
20452 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20453 __pyx_array___dealloc__(o);
20454 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20455 PyErr_Restore(etype, eval, etb);
20458 Py_CLEAR(p->_format);
20459 (*Py_TYPE(o)->tp_free)(o);
20461 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20463 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
20464 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20469 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
20471 return __pyx_array___setitem__(o, i,
v);
20474 PyErr_Format(PyExc_NotImplementedError,
20475 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20480 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
20481 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
20482 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20484 v = __pyx_array___getattr__(o,
n);
20489 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
20490 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20493 static PyMethodDef __pyx_methods_array[] = {
20494 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20495 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20496 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20500 static struct PyGetSetDef __pyx_getsets_array[] = {
20501 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
20505 static PySequenceMethods __pyx_tp_as_sequence_array = {
20506 __pyx_array___len__,
20509 __pyx_sq_item_array,
20518 static PyMappingMethods __pyx_tp_as_mapping_array = {
20519 __pyx_array___len__,
20520 __pyx_array___getitem__,
20521 __pyx_mp_ass_subscript_array,
20524 static PyBufferProcs __pyx_tp_as_buffer_array = {
20525 #if PY_MAJOR_VERSION < 3
20528 #if PY_MAJOR_VERSION < 3
20531 #if PY_MAJOR_VERSION < 3
20534 #if PY_MAJOR_VERSION < 3
20537 __pyx_array_getbuffer,
20541 static PyTypeObject __pyx_type___pyx_array = {
20542 PyVarObject_HEAD_INIT(0, 0)
20543 "superluWrappers.array",
20544 sizeof(
struct __pyx_array_obj),
20546 __pyx_tp_dealloc_array,
20547 #
if PY_VERSION_HEX < 0x030800b4
20550 #
if PY_VERSION_HEX >= 0x030800b4
20555 #
if PY_MAJOR_VERSION < 3
20558 #
if PY_MAJOR_VERSION >= 3
20563 &__pyx_tp_as_sequence_array,
20564 &__pyx_tp_as_mapping_array,
20568 __pyx_tp_getattro_array,
20570 &__pyx_tp_as_buffer_array,
20571 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
20579 __pyx_methods_array,
20581 __pyx_getsets_array,
20589 __pyx_tp_new_array,
20599 #
if PY_VERSION_HEX >= 0x030400a1
20602 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20605 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20608 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20613 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20614 struct __pyx_MemviewEnum_obj *p;
20616 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20617 o = (*t->tp_alloc)(t, 0);
20619 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20621 if (unlikely(!o))
return 0;
20622 p = ((
struct __pyx_MemviewEnum_obj *)o);
20623 p->name = Py_None; Py_INCREF(Py_None);
20627 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20628 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20629 #if CYTHON_USE_TP_FINALIZE
20630 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20631 if (PyObject_CallFinalizerFromDealloc(o))
return;
20634 PyObject_GC_UnTrack(o);
20636 (*Py_TYPE(o)->tp_free)(o);
20639 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
20641 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20643 e = (*v)(p->name, a);
if (e)
return e;
20648 static int __pyx_tp_clear_Enum(PyObject *o) {
20650 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20651 tmp = ((PyObject*)p->name);
20652 p->name = Py_None; Py_INCREF(Py_None);
20657 static PyMethodDef __pyx_methods_Enum[] = {
20658 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20659 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20663 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20664 PyVarObject_HEAD_INIT(0, 0)
20665 "superluWrappers.Enum",
20666 sizeof(
struct __pyx_MemviewEnum_obj),
20668 __pyx_tp_dealloc_Enum,
20669 #
if PY_VERSION_HEX < 0x030800b4
20672 #
if PY_VERSION_HEX >= 0x030800b4
20677 #
if PY_MAJOR_VERSION < 3
20680 #
if PY_MAJOR_VERSION >= 3
20683 __pyx_MemviewEnum___repr__,
20693 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20695 __pyx_tp_traverse_Enum,
20696 __pyx_tp_clear_Enum,
20701 __pyx_methods_Enum,
20709 __pyx_MemviewEnum___init__,
20721 #
if PY_VERSION_HEX >= 0x030400a1
20724 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20727 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20730 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20734 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20736 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20737 struct __pyx_memoryview_obj *p;
20739 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20740 o = (*t->tp_alloc)(t, 0);
20742 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20744 if (unlikely(!o))
return 0;
20745 p = ((
struct __pyx_memoryview_obj *)o);
20746 p->__pyx_vtab = __pyx_vtabptr_memoryview;
20747 p->obj = Py_None; Py_INCREF(Py_None);
20748 p->_size = Py_None; Py_INCREF(Py_None);
20749 p->_array_interface = Py_None; Py_INCREF(Py_None);
20750 p->view.obj = NULL;
20751 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
20754 Py_DECREF(o); o = 0;
20758 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20759 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20760 #if CYTHON_USE_TP_FINALIZE
20761 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20762 if (PyObject_CallFinalizerFromDealloc(o))
return;
20765 PyObject_GC_UnTrack(o);
20767 PyObject *etype, *eval, *etb;
20768 PyErr_Fetch(&etype, &eval, &etb);
20769 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20770 __pyx_memoryview___dealloc__(o);
20771 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20772 PyErr_Restore(etype, eval, etb);
20775 Py_CLEAR(p->_size);
20776 Py_CLEAR(p->_array_interface);
20777 (*Py_TYPE(o)->tp_free)(o);
20780 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
20782 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20784 e = (*v)(p->obj, a);
if (e)
return e;
20787 e = (*v)(p->_size, a);
if (e)
return e;
20789 if (p->_array_interface) {
20790 e = (*v)(p->_array_interface, a);
if (e)
return e;
20793 e = (*v)(p->view.obj, a);
if (e)
return e;
20798 static int __pyx_tp_clear_memoryview(PyObject *o) {
20800 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20801 tmp = ((PyObject*)p->obj);
20802 p->obj = Py_None; Py_INCREF(Py_None);
20804 tmp = ((PyObject*)p->_size);
20805 p->_size = Py_None; Py_INCREF(Py_None);
20807 tmp = ((PyObject*)p->_array_interface);
20808 p->_array_interface = Py_None; Py_INCREF(Py_None);
20810 Py_CLEAR(p->view.obj);
20813 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20815 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
20816 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20821 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
20823 return __pyx_memoryview___setitem__(o, i,
v);
20826 PyErr_Format(PyExc_NotImplementedError,
20827 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20832 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
20833 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20836 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
20837 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20840 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
20841 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20844 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
20845 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20848 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
20849 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20852 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
20853 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20856 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
20857 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20860 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
20861 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20864 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
20865 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20868 static PyMethodDef __pyx_methods_memoryview[] = {
20869 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20870 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20871 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20872 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20873 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20874 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20878 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20879 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
20880 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
20881 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
20882 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
20883 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
20884 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
20885 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
20886 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
20887 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
20891 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20892 __pyx_memoryview___len__,
20895 __pyx_sq_item_memoryview,
20904 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20905 __pyx_memoryview___len__,
20906 __pyx_memoryview___getitem__,
20907 __pyx_mp_ass_subscript_memoryview,
20910 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20911 #if PY_MAJOR_VERSION < 3
20914 #if PY_MAJOR_VERSION < 3
20917 #if PY_MAJOR_VERSION < 3
20920 #if PY_MAJOR_VERSION < 3
20923 __pyx_memoryview_getbuffer,
20927 static PyTypeObject __pyx_type___pyx_memoryview = {
20928 PyVarObject_HEAD_INIT(0, 0)
20929 "superluWrappers.memoryview",
20930 sizeof(
struct __pyx_memoryview_obj),
20932 __pyx_tp_dealloc_memoryview,
20933 #
if PY_VERSION_HEX < 0x030800b4
20936 #
if PY_VERSION_HEX >= 0x030800b4
20941 #
if PY_MAJOR_VERSION < 3
20944 #
if PY_MAJOR_VERSION >= 3
20947 __pyx_memoryview___repr__,
20949 &__pyx_tp_as_sequence_memoryview,
20950 &__pyx_tp_as_mapping_memoryview,
20953 __pyx_memoryview___str__,
20956 &__pyx_tp_as_buffer_memoryview,
20957 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20959 __pyx_tp_traverse_memoryview,
20960 __pyx_tp_clear_memoryview,
20965 __pyx_methods_memoryview,
20967 __pyx_getsets_memoryview,
20975 __pyx_tp_new_memoryview,
20985 #
if PY_VERSION_HEX >= 0x030400a1
20988 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20991 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20994 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20998 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21000 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21001 struct __pyx_memoryviewslice_obj *p;
21002 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21003 if (unlikely(!o))
return 0;
21004 p = ((
struct __pyx_memoryviewslice_obj *)o);
21005 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21006 p->from_object = Py_None; Py_INCREF(Py_None);
21007 p->from_slice.memview = NULL;
21011 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21012 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21013 #if CYTHON_USE_TP_FINALIZE
21014 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21015 if (PyObject_CallFinalizerFromDealloc(o))
return;
21018 PyObject_GC_UnTrack(o);
21020 PyObject *etype, *eval, *etb;
21021 PyErr_Fetch(&etype, &eval, &etb);
21022 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21023 __pyx_memoryviewslice___dealloc__(o);
21024 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21025 PyErr_Restore(etype, eval, etb);
21027 Py_CLEAR(p->from_object);
21028 PyObject_GC_Track(o);
21029 __pyx_tp_dealloc_memoryview(o);
21032 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
21034 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21035 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
21036 if (p->from_object) {
21037 e = (*v)(p->from_object, a);
if (e)
return e;
21042 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21044 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21045 __pyx_tp_clear_memoryview(o);
21046 tmp = ((PyObject*)p->from_object);
21047 p->from_object = Py_None; Py_INCREF(Py_None);
21049 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21053 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21054 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21057 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21058 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21059 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21063 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21064 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
21068 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21069 PyVarObject_HEAD_INIT(0, 0)
21070 "superluWrappers._memoryviewslice",
21071 sizeof(
struct __pyx_memoryviewslice_obj),
21073 __pyx_tp_dealloc__memoryviewslice,
21074 #
if PY_VERSION_HEX < 0x030800b4
21077 #
if PY_VERSION_HEX >= 0x030800b4
21082 #
if PY_MAJOR_VERSION < 3
21085 #
if PY_MAJOR_VERSION >= 3
21088 #
if CYTHON_COMPILING_IN_PYPY
21089 __pyx_memoryview___repr__,
21098 #
if CYTHON_COMPILING_IN_PYPY
21099 __pyx_memoryview___str__,
21106 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21107 "Internal class for passing memoryview slices to Python",
21108 __pyx_tp_traverse__memoryviewslice,
21109 __pyx_tp_clear__memoryviewslice,
21114 __pyx_methods__memoryviewslice,
21116 __pyx_getsets__memoryviewslice,
21124 __pyx_tp_new__memoryviewslice,
21134 #
if PY_VERSION_HEX >= 0x030400a1
21137 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21140 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21143 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21148 static PyMethodDef __pyx_methods[] = {
21152 #if PY_MAJOR_VERSION >= 3
21153 #if CYTHON_PEP489_MULTI_PHASE_INIT
21154 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
21155 static int __pyx_pymod_exec_superluWrappers(PyObject* module);
21156 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21157 {Py_mod_create, (
void*)__pyx_pymod_create},
21158 {Py_mod_exec, (
void*)__pyx_pymod_exec_superluWrappers},
21163 static struct PyModuleDef __pyx_moduledef = {
21164 PyModuleDef_HEAD_INIT,
21167 #if CYTHON_PEP489_MULTI_PHASE_INIT
21173 #if CYTHON_PEP489_MULTI_PHASE_INIT
21174 __pyx_moduledef_slots,
21183 #ifndef CYTHON_SMALL_CODE
21184 #if defined(__clang__)
21185 #define CYTHON_SMALL_CODE
21186 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21187 #define CYTHON_SMALL_CODE __attribute__((cold))
21189 #define CYTHON_SMALL_CODE
21193 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21194 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21195 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
21196 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
21197 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
21198 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
21199 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
21200 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21201 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
21202 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
21203 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
21204 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21205 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21206 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
21207 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
21208 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21209 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
21210 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21211 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
21212 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
21213 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21214 {&__pyx_n_s_SparseFactor, __pyx_k_SparseFactor,
sizeof(__pyx_k_SparseFactor), 0, 0, 1, 1},
21215 {&__pyx_n_s_SparseMatrix, __pyx_k_SparseMatrix,
sizeof(__pyx_k_SparseMatrix), 0, 0, 1, 1},
21216 {&__pyx_n_s_SparseMatrix___init, __pyx_k_SparseMatrix___init,
sizeof(__pyx_k_SparseMatrix___init), 0, 0, 1, 1},
21217 {&__pyx_n_s_SparseMatrix_fwrite, __pyx_k_SparseMatrix_fwrite,
sizeof(__pyx_k_SparseMatrix_fwrite), 0, 0, 1, 1},
21218 {&__pyx_n_s_SparseMatrix_getCSRrepresentatio, __pyx_k_SparseMatrix_getCSRrepresentatio,
sizeof(__pyx_k_SparseMatrix_getCSRrepresentatio), 0, 0, 1, 1},
21219 {&__pyx_n_s_SparseMatrix_getSubMatCSRreprese, __pyx_k_SparseMatrix_getSubMatCSRreprese,
sizeof(__pyx_k_SparseMatrix_getSubMatCSRreprese), 0, 0, 1, 1},
21220 {&__pyx_n_s_SparseMatrix_matvec, __pyx_k_SparseMatrix_matvec,
sizeof(__pyx_k_SparseMatrix_matvec), 0, 0, 1, 1},
21221 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21222 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
21223 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21224 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21225 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21226 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
21227 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
21228 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
21229 {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix,
sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
21230 {&__pyx_n_s_cSparseMatrix_2, __pyx_k_cSparseMatrix_2,
sizeof(__pyx_k_cSparseMatrix_2), 0, 0, 1, 1},
21231 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
21232 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21233 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
21234 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21235 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21236 {&__pyx_kp_s_d_d_13_8e, __pyx_k_d_d_13_8e,
sizeof(__pyx_k_d_d_13_8e), 0, 0, 1, 0},
21237 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
21238 {&__pyx_n_s_dim, __pyx_k_dim,
sizeof(__pyx_k_dim), 0, 0, 1, 1},
21239 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
21240 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21241 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
21242 {&__pyx_n_s_enter, __pyx_k_enter,
sizeof(__pyx_k_enter), 0, 0, 1, 1},
21243 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21244 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
21245 {&__pyx_n_s_exit, __pyx_k_exit,
sizeof(__pyx_k_exit), 0, 0, 1, 1},
21246 {&__pyx_n_s_filename, __pyx_k_filename,
sizeof(__pyx_k_filename), 0, 0, 1, 1},
21247 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
21248 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
21249 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21250 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21251 {&__pyx_n_s_fwrite, __pyx_k_fwrite,
sizeof(__pyx_k_fwrite), 0, 0, 1, 1},
21252 {&__pyx_n_s_getCSRrepresentation, __pyx_k_getCSRrepresentation,
sizeof(__pyx_k_getCSRrepresentation), 0, 0, 1, 1},
21253 {&__pyx_n_s_getSubMatCSRrepresentation, __pyx_k_getSubMatCSRrepresentation,
sizeof(__pyx_k_getSubMatCSRrepresentation), 0, 0, 1, 1},
21254 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21255 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
21256 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
21257 {&__pyx_kp_s_i_i_i, __pyx_k_i_i_i,
sizeof(__pyx_k_i_i_i), 0, 0, 1, 0},
21258 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
21259 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
21260 {&__pyx_n_s_init, __pyx_k_init,
sizeof(__pyx_k_init), 0, 0, 1, 1},
21261 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21262 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
21263 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
21264 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
21265 {&__pyx_n_s_matvec, __pyx_k_matvec,
sizeof(__pyx_k_matvec), 0, 0, 1, 1},
21266 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
21267 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
21268 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
21269 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
21270 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
21271 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21272 {&__pyx_n_s_nc, __pyx_k_nc,
sizeof(__pyx_k_nc), 0, 0, 1, 1},
21273 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21274 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
21275 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
21276 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
21277 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
21278 {&__pyx_n_s_nr, __pyx_k_nr,
sizeof(__pyx_k_nr), 0, 0, 1, 1},
21279 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21280 {&__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},
21281 {&__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},
21282 {&__pyx_n_s_nzval, __pyx_k_nzval,
sizeof(__pyx_k_nzval), 0, 0, 1, 1},
21283 {&__pyx_n_s_nzvals, __pyx_k_nzvals,
sizeof(__pyx_k_nzvals), 0, 0, 1, 1},
21284 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
21285 {&__pyx_n_s_object, __pyx_k_object,
sizeof(__pyx_k_object), 0, 0, 1, 1},
21286 {&__pyx_n_s_open, __pyx_k_open,
sizeof(__pyx_k_open), 0, 0, 1, 1},
21287 {&__pyx_n_s_output_file, __pyx_k_output_file,
sizeof(__pyx_k_output_file), 0, 0, 1, 1},
21288 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
21289 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21290 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
21291 {&__pyx_kp_s_proteus_superluWrappers_pyx, __pyx_k_proteus_superluWrappers_pyx,
sizeof(__pyx_k_proteus_superluWrappers_pyx), 0, 0, 1, 0},
21292 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21293 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21294 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21295 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21296 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21297 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21298 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21299 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21300 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
21301 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
21302 {&__pyx_n_s_range_end, __pyx_k_range_end,
sizeof(__pyx_k_range_end), 0, 0, 1, 1},
21303 {&__pyx_n_s_range_start, __pyx_k_range_start,
sizeof(__pyx_k_range_start), 0, 0, 1, 1},
21304 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21305 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21306 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21307 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
21308 {&__pyx_n_s_rows, __pyx_k_rows,
sizeof(__pyx_k_rows), 0, 0, 1, 1},
21309 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
21310 {&__pyx_kp_s_self_A_self_AC_self_L_self_U_sel, __pyx_k_self_A_self_AC_self_L_self_U_sel,
sizeof(__pyx_k_self_A_self_AC_self_L_self_U_sel), 0, 0, 1, 0},
21311 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21312 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21313 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
21314 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
21315 {&__pyx_n_s_sparseFactor, __pyx_k_sparseFactor,
sizeof(__pyx_k_sparseFactor), 0, 0, 1, 1},
21316 {&__pyx_n_s_sparseFactorPrepare, __pyx_k_sparseFactorPrepare,
sizeof(__pyx_k_sparseFactorPrepare), 0, 0, 1, 1},
21317 {&__pyx_n_s_sparseFactorSolve, __pyx_k_sparseFactorSolve,
sizeof(__pyx_k_sparseFactorSolve), 0, 0, 1, 1},
21318 {&__pyx_n_s_sparse_matrix, __pyx_k_sparse_matrix,
sizeof(__pyx_k_sparse_matrix), 0, 0, 1, 1},
21319 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
21320 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
21321 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
21322 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21323 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21324 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21325 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21326 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
21327 {&__pyx_n_s_superluWrappers, __pyx_k_superluWrappers,
sizeof(__pyx_k_superluWrappers), 0, 0, 1, 1},
21328 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
21329 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21330 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21331 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21332 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
21333 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
21334 {&__pyx_n_s_write, __pyx_k_write,
sizeof(__pyx_k_write), 0, 0, 1, 1},
21335 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
21336 {&__pyx_n_s_y, __pyx_k_y,
sizeof(__pyx_k_y), 0, 0, 1, 1},
21337 {0, 0, 0, 0, 0, 0, 0}
21339 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
21340 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
21341 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open);
if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
21342 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error)
21343 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
21344 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
21345 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
21346 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
21347 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
21348 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
21349 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
21350 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
21356 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
21357 __Pyx_RefNannyDeclarations
21358 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
21367 __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 56, __pyx_L1_error)
21368 __Pyx_GOTREF(__pyx_tuple_);
21369 __Pyx_GIVEREF(__pyx_tuple_);
21377 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
21378 __Pyx_GOTREF(__pyx_tuple__2);
21379 __Pyx_GIVEREF(__pyx_tuple__2);
21386 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
21387 __Pyx_GOTREF(__pyx_tuple__3);
21388 __Pyx_GIVEREF(__pyx_tuple__3);
21396 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
21397 __Pyx_GOTREF(__pyx_tuple__4);
21398 __Pyx_GIVEREF(__pyx_tuple__4);
21405 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
21406 __Pyx_GOTREF(__pyx_tuple__5);
21407 __Pyx_GIVEREF(__pyx_tuple__5);
21416 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 945, __pyx_L1_error)
21417 __Pyx_GOTREF(__pyx_tuple__6);
21418 __Pyx_GIVEREF(__pyx_tuple__6);
21427 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 951, __pyx_L1_error)
21428 __Pyx_GOTREF(__pyx_tuple__7);
21429 __Pyx_GIVEREF(__pyx_tuple__7);
21438 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 133, __pyx_L1_error)
21439 __Pyx_GOTREF(__pyx_tuple__8);
21440 __Pyx_GIVEREF(__pyx_tuple__8);
21449 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 136, __pyx_L1_error)
21450 __Pyx_GOTREF(__pyx_tuple__9);
21451 __Pyx_GIVEREF(__pyx_tuple__9);
21460 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 148, __pyx_L1_error)
21461 __Pyx_GOTREF(__pyx_tuple__10);
21462 __Pyx_GIVEREF(__pyx_tuple__10);
21471 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 176, __pyx_L1_error)
21472 __Pyx_GOTREF(__pyx_tuple__11);
21473 __Pyx_GIVEREF(__pyx_tuple__11);
21482 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 192, __pyx_L1_error)
21483 __Pyx_GOTREF(__pyx_tuple__12);
21484 __Pyx_GIVEREF(__pyx_tuple__12);
21492 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error)
21493 __Pyx_GOTREF(__pyx_tuple__13);
21494 __Pyx_GIVEREF(__pyx_tuple__13);
21501 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
21502 __Pyx_GOTREF(__pyx_tuple__14);
21503 __Pyx_GIVEREF(__pyx_tuple__14);
21512 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 418, __pyx_L1_error)
21513 __Pyx_GOTREF(__pyx_tuple__15);
21514 __Pyx_GIVEREF(__pyx_tuple__15);
21523 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 495, __pyx_L1_error)
21524 __Pyx_GOTREF(__pyx_tuple__16);
21525 __Pyx_GIVEREF(__pyx_tuple__16);
21534 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 520, __pyx_L1_error)
21535 __Pyx_GOTREF(__pyx_tuple__17);
21536 __Pyx_GIVEREF(__pyx_tuple__17);
21545 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 570, __pyx_L1_error)
21546 __Pyx_GOTREF(__pyx_tuple__18);
21547 __Pyx_GIVEREF(__pyx_tuple__18);
21556 __pyx_tuple__19 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 577, __pyx_L1_error)
21557 __Pyx_GOTREF(__pyx_tuple__19);
21558 __Pyx_INCREF(__pyx_int_neg_1);
21559 __Pyx_GIVEREF(__pyx_int_neg_1);
21560 PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
21561 __Pyx_GIVEREF(__pyx_tuple__19);
21569 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
21570 __Pyx_GOTREF(__pyx_tuple__20);
21571 __Pyx_GIVEREF(__pyx_tuple__20);
21578 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
21579 __Pyx_GOTREF(__pyx_tuple__21);
21580 __Pyx_GIVEREF(__pyx_tuple__21);
21589 __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__22)) __PYX_ERR(1, 682, __pyx_L1_error)
21590 __Pyx_GOTREF(__pyx_slice__22);
21591 __Pyx_GIVEREF(__pyx_slice__22);
21600 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 703, __pyx_L1_error)
21601 __Pyx_GOTREF(__pyx_tuple__23);
21602 __Pyx_GIVEREF(__pyx_tuple__23);
21610 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
21611 __Pyx_GOTREF(__pyx_tuple__24);
21612 __Pyx_GIVEREF(__pyx_tuple__24);
21619 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
21620 __Pyx_GOTREF(__pyx_tuple__25);
21621 __Pyx_GIVEREF(__pyx_tuple__25);
21622 __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
21623 __Pyx_GOTREF(__pyx_tuple__26);
21624 __Pyx_GIVEREF(__pyx_tuple__26);
21633 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 13, __pyx_L1_error)
21634 __Pyx_GOTREF(__pyx_tuple__27);
21635 __Pyx_GIVEREF(__pyx_tuple__27);
21644 __pyx_tuple__28 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_nnz, __pyx_n_s_nzvals, __pyx_n_s_colind, __pyx_n_s_rowptr);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 15, __pyx_L1_error)
21645 __Pyx_GOTREF(__pyx_tuple__28);
21646 __Pyx_GIVEREF(__pyx_tuple__28);
21647 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_init, 15, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 15, __pyx_L1_error)
21656 __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 35, __pyx_L1_error)
21657 __Pyx_GOTREF(__pyx_tuple__30);
21658 __Pyx_GIVEREF(__pyx_tuple__30);
21659 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_matvec, 35, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 35, __pyx_L1_error)
21668 __pyx_tuple__32 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_base, __pyx_n_s_output_file, __pyx_n_s_i, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 46, __pyx_L1_error)
21669 __Pyx_GOTREF(__pyx_tuple__32);
21670 __Pyx_GIVEREF(__pyx_tuple__32);
21671 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_fwrite, 46, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 46, __pyx_L1_error)
21680 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 62, __pyx_L1_error)
21681 __Pyx_GOTREF(__pyx_tuple__34);
21682 __Pyx_GIVEREF(__pyx_tuple__34);
21683 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getCSRrepresentation, 62, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 62, __pyx_L1_error)
21692 __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_range_start, __pyx_n_s_range_end, __pyx_n_s_rows, __pyx_n_s_nnz, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nzvals);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 72, __pyx_L1_error)
21693 __Pyx_GOTREF(__pyx_tuple__36);
21694 __Pyx_GIVEREF(__pyx_tuple__36);
21695 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getSubMatCSRrepresentation, 72, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 72, __pyx_L1_error)
21704 __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_sparse_matrix, __pyx_n_s_sparseFactor);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 219, __pyx_L1_error)
21705 __Pyx_GOTREF(__pyx_tuple__38);
21706 __Pyx_GIVEREF(__pyx_tuple__38);
21707 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorPrepare, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 219, __pyx_L1_error)
21716 __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_sparseFactor, __pyx_n_s_x);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 286, __pyx_L1_error)
21717 __Pyx_GOTREF(__pyx_tuple__40);
21718 __Pyx_GIVEREF(__pyx_tuple__40);
21719 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorSolve, 286, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 286, __pyx_L1_error)
21728 __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 286, __pyx_L1_error)
21729 __Pyx_GOTREF(__pyx_tuple__42);
21730 __Pyx_GIVEREF(__pyx_tuple__42);
21739 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 287, __pyx_L1_error)
21740 __Pyx_GOTREF(__pyx_tuple__43);
21741 __Pyx_GIVEREF(__pyx_tuple__43);
21750 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 288, __pyx_L1_error)
21751 __Pyx_GOTREF(__pyx_tuple__44);
21752 __Pyx_GIVEREF(__pyx_tuple__44);
21761 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 291, __pyx_L1_error)
21762 __Pyx_GOTREF(__pyx_tuple__45);
21763 __Pyx_GIVEREF(__pyx_tuple__45);
21772 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 292, __pyx_L1_error)
21773 __Pyx_GOTREF(__pyx_tuple__46);
21774 __Pyx_GIVEREF(__pyx_tuple__46);
21781 __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 1, __pyx_L1_error)
21782 __Pyx_GOTREF(__pyx_tuple__47);
21783 __Pyx_GIVEREF(__pyx_tuple__47);
21784 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(1, 1, __pyx_L1_error)
21785 __Pyx_RefNannyFinishContext();
21788 __Pyx_RefNannyFinishContext();
21792 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
21793 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
21794 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
21795 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21796 __pyx_int_112105877 = PyInt_FromLong(112105877
L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
21797 __pyx_int_136983863 = PyInt_FromLong(136983863
L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
21798 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
21799 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21805 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
21806 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
21807 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
21808 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
21809 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
21810 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
21811 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
21813 static int __Pyx_modinit_global_init_code(
void) {
21814 __Pyx_RefNannyDeclarations
21815 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
21817 generic = Py_None; Py_INCREF(Py_None);
21818 strided = Py_None; Py_INCREF(Py_None);
21819 indirect = Py_None; Py_INCREF(Py_None);
21820 contiguous = Py_None; Py_INCREF(Py_None);
21821 indirect_contiguous = Py_None; Py_INCREF(Py_None);
21822 __Pyx_RefNannyFinishContext();
21826 static int __Pyx_modinit_variable_export_code(
void) {
21827 __Pyx_RefNannyDeclarations
21828 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
21830 __Pyx_RefNannyFinishContext();
21834 static int __Pyx_modinit_function_export_code(
void) {
21835 __Pyx_RefNannyDeclarations
21836 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
21838 __Pyx_RefNannyFinishContext();
21842 static int __Pyx_modinit_type_init_code(
void) {
21843 __Pyx_RefNannyDeclarations
21844 int __pyx_lineno = 0;
21845 const char *__pyx_filename = NULL;
21846 int __pyx_clineno = 0;
21847 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
21849 if (PyType_Ready(&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
21850 #if PY_VERSION_HEX < 0x030800B1
21851 __pyx_type_15superluWrappers_cSparseMatrix.tp_print = 0;
21853 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_cSparseMatrix.tp_dictoffset && __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro == PyObject_GenericGetAttr)) {
21854 __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21856 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cSparseMatrix_2, (PyObject *)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
21857 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
21858 __pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
21859 __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
21860 __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(
struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
21861 if (PyType_Ready(&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21862 #if PY_VERSION_HEX < 0x030800B1
21863 __pyx_type_15superluWrappers_SparseFactor.tp_print = 0;
21865 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_SparseFactor.tp_dictoffset && __pyx_type_15superluWrappers_SparseFactor.tp_getattro == PyObject_GenericGetAttr)) {
21866 __pyx_type_15superluWrappers_SparseFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21868 #if CYTHON_UPDATE_DESCRIPTOR_DOC
21870 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_15superluWrappers_SparseFactor,
"__init__");
if (unlikely(!wrapper)) __PYX_ERR(0, 145, __pyx_L1_error)
21871 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21872 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21873 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
21874 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
21878 if (__Pyx_SetVtable(__pyx_type_15superluWrappers_SparseFactor.tp_dict, __pyx_vtabptr_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21879 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseFactor, (PyObject *)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21880 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
21881 __pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
21882 __pyx_vtabptr_array = &__pyx_vtable_array;
21883 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
21884 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
21885 #if PY_VERSION_HEX < 0x030800B1
21886 __pyx_type___pyx_array.tp_print = 0;
21888 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
21889 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
21890 __pyx_array_type = &__pyx_type___pyx_array;
21891 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
21892 #if PY_VERSION_HEX < 0x030800B1
21893 __pyx_type___pyx_MemviewEnum.tp_print = 0;
21895 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21896 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21898 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
21899 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21900 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21901 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21902 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21903 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21904 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21905 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21906 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
21907 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21908 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
21909 #if PY_VERSION_HEX < 0x030800B1
21910 __pyx_type___pyx_memoryview.tp_print = 0;
21912 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21913 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21915 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
21916 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
21917 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
21918 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
21919 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
21920 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
21921 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
21922 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
21923 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
21924 #if PY_VERSION_HEX < 0x030800B1
21925 __pyx_type___pyx_memoryviewslice.tp_print = 0;
21927 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
21928 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21930 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
21931 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
21932 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
21933 __Pyx_RefNannyFinishContext();
21936 __Pyx_RefNannyFinishContext();
21940 static int __Pyx_modinit_type_import_code(
void) {
21941 __Pyx_RefNannyDeclarations
21942 PyObject *__pyx_t_1 = NULL;
21943 int __pyx_lineno = 0;
21944 const char *__pyx_filename = NULL;
21945 int __pyx_clineno = 0;
21946 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
21948 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
21949 __Pyx_GOTREF(__pyx_t_1);
21950 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
21951 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
21952 sizeof(PyTypeObject),
21954 sizeof(PyHeapTypeObject),
21956 __Pyx_ImportType_CheckSize_Warn);
21957 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
21958 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21959 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
21960 __Pyx_GOTREF(__pyx_t_1);
21961 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
21962 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
21963 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
21964 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
21965 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
21966 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
21967 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
21968 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
21969 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21970 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
21971 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21972 if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
21973 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21974 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
21975 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21976 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
21977 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21978 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
21979 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21980 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
21981 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21982 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
21983 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21984 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
21985 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21986 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
21987 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21988 if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
21989 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
21990 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
21991 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21992 __Pyx_RefNannyFinishContext();
21995 __Pyx_XDECREF(__pyx_t_1);
21996 __Pyx_RefNannyFinishContext();
22000 static int __Pyx_modinit_variable_import_code(
void) {
22001 __Pyx_RefNannyDeclarations
22002 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22004 __Pyx_RefNannyFinishContext();
22008 static int __Pyx_modinit_function_import_code(
void) {
22009 __Pyx_RefNannyDeclarations
22010 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22012 __Pyx_RefNannyFinishContext();
22017 #ifndef CYTHON_NO_PYINIT_EXPORT
22018 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22019 #elif PY_MAJOR_VERSION < 3
22021 #define __Pyx_PyMODINIT_FUNC extern "C" void
22023 #define __Pyx_PyMODINIT_FUNC void
22027 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22029 #define __Pyx_PyMODINIT_FUNC PyObject *
22034 #if PY_MAJOR_VERSION < 3
22035 __Pyx_PyMODINIT_FUNC initsuperluWrappers(
void) CYTHON_SMALL_CODE;
22036 __Pyx_PyMODINIT_FUNC initsuperluWrappers(
void)
22038 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(
void) CYTHON_SMALL_CODE;
22039 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(
void)
22040 #if CYTHON_PEP489_MULTI_PHASE_INIT
22042 return PyModuleDef_Init(&__pyx_moduledef);
22044 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22045 #if PY_VERSION_HEX >= 0x030700A1
22046 static PY_INT64_T main_interpreter_id = -1;
22047 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22048 if (main_interpreter_id == -1) {
22049 main_interpreter_id = current_id;
22050 return (unlikely(current_id == -1)) ? -1 : 0;
22051 }
else if (unlikely(main_interpreter_id != current_id))
22053 static PyInterpreterState *main_interpreter = NULL;
22054 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22055 if (!main_interpreter) {
22056 main_interpreter = current_interpreter;
22057 }
else if (unlikely(main_interpreter != current_interpreter))
22062 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22067 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) {
22068 PyObject *value = PyObject_GetAttrString(spec, from_name);
22070 if (likely(value)) {
22071 if (allow_none || value != Py_None) {
22072 result = PyDict_SetItemString(moddict, to_name, value);
22075 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22082 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22083 PyObject *module = NULL, *moddict, *modname;
22084 if (__Pyx_check_single_interpreter())
22087 return __Pyx_NewRef(__pyx_m);
22088 modname = PyObject_GetAttrString(spec,
"name");
22089 if (unlikely(!modname))
goto bad;
22090 module = PyModule_NewObject(modname);
22091 Py_DECREF(modname);
22092 if (unlikely(!module))
goto bad;
22093 moddict = PyModule_GetDict(module);
22094 if (unlikely(!moddict))
goto bad;
22095 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
22096 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
22097 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
22098 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
22101 Py_XDECREF(module);
22106 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
22110 PyObject *__pyx_t_1 = NULL;
22111 PyObject *__pyx_t_2 = NULL;
22112 PyObject *__pyx_t_3 = NULL;
22113 static PyThread_type_lock __pyx_t_4[8];
22114 int __pyx_lineno = 0;
22115 const char *__pyx_filename = NULL;
22116 int __pyx_clineno = 0;
22117 __Pyx_RefNannyDeclarations
22118 #if CYTHON_PEP489_MULTI_PHASE_INIT
22120 if (__pyx_m == __pyx_pyinit_module)
return 0;
22121 PyErr_SetString(PyExc_RuntimeError,
"Module 'superluWrappers' has already been imported. Re-initialisation is not supported.");
22124 #elif PY_MAJOR_VERSION >= 3
22125 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22127 #if CYTHON_REFNANNY
22128 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22129 if (!__Pyx_RefNanny) {
22131 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22132 if (!__Pyx_RefNanny)
22133 Py_FatalError(
"failed to import 'refnanny' module");
22136 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)", 0);
22137 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22138 #ifdef __Pxy_PyFrame_Initialize_Offsets
22139 __Pxy_PyFrame_Initialize_Offsets();
22141 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22142 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22143 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22144 #ifdef __Pyx_CyFunction_USED
22145 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22147 #ifdef __Pyx_FusedFunction_USED
22148 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22150 #ifdef __Pyx_Coroutine_USED
22151 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22153 #ifdef __Pyx_Generator_USED
22154 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22156 #ifdef __Pyx_AsyncGen_USED
22157 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22159 #ifdef __Pyx_StopAsyncIteration_USED
22160 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22164 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22165 PyEval_InitThreads();
22168 #if CYTHON_PEP489_MULTI_PHASE_INIT
22169 __pyx_m = __pyx_pyinit_module;
22170 Py_INCREF(__pyx_m);
22172 #if PY_MAJOR_VERSION < 3
22173 __pyx_m = Py_InitModule4(
"superluWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22175 __pyx_m = PyModule_Create(&__pyx_moduledef);
22177 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22179 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22180 Py_INCREF(__pyx_d);
22181 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22182 Py_INCREF(__pyx_b);
22183 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22184 Py_INCREF(__pyx_cython_runtime);
22185 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22187 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22188 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22189 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22191 if (__pyx_module_is_main_superluWrappers) {
22192 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22194 #if PY_MAJOR_VERSION >= 3
22196 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22197 if (!PyDict_GetItemString(modules,
"superluWrappers")) {
22198 if (unlikely(PyDict_SetItemString(modules,
"superluWrappers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22203 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22205 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22207 (void)__Pyx_modinit_global_init_code();
22208 (void)__Pyx_modinit_variable_export_code();
22209 (void)__Pyx_modinit_function_export_code();
22210 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22211 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22212 (void)__Pyx_modinit_variable_import_code();
22213 (void)__Pyx_modinit_function_import_code();
22215 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22216 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22226 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
22227 __Pyx_GOTREF(__pyx_t_1);
22228 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
22229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22238 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__27);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
22239 __Pyx_GOTREF(__pyx_t_1);
22240 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__27, __pyx_n_s_SparseMatrix, __pyx_n_s_SparseMatrix, (PyObject *) NULL, __pyx_n_s_superluWrappers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
22241 __Pyx_GOTREF(__pyx_t_2);
22250 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_n_s_SparseMatrix___init, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__29));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
22251 __Pyx_GOTREF(__pyx_t_3);
22252 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
22253 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22262 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_n_s_SparseMatrix_matvec, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__31));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
22263 __Pyx_GOTREF(__pyx_t_3);
22264 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matvec, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
22265 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22274 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_n_s_SparseMatrix_fwrite, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__33));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
22275 __Pyx_GOTREF(__pyx_t_3);
22276 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_fwrite, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
22277 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22286 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getCSRrepresentatio, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__35));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
22287 __Pyx_GOTREF(__pyx_t_3);
22288 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
22289 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22298 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__37));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
22299 __Pyx_GOTREF(__pyx_t_3);
22300 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSubMatCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
22301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22310 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SparseMatrix, __pyx_tuple__27, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
22311 __Pyx_GOTREF(__pyx_t_3);
22312 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SparseMatrix, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
22313 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22314 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22315 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22324 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, NULL, __pyx_n_s_superluWrappers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
22325 __Pyx_GOTREF(__pyx_t_1);
22326 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorPrepare, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
22327 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22336 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, NULL, __pyx_n_s_superluWrappers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
22337 __Pyx_GOTREF(__pyx_t_1);
22338 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorSolve, __pyx_t_1) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
22339 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22346 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22347 __Pyx_GOTREF(__pyx_t_1);
22348 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22358 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
22359 __Pyx_GOTREF(__pyx_t_1);
22360 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
22361 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22362 PyType_Modified(__pyx_array_type);
22371 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
22372 __Pyx_GOTREF(__pyx_t_1);
22373 __Pyx_XGOTREF(
generic);
22374 __Pyx_DECREF_SET(
generic, __pyx_t_1);
22375 __Pyx_GIVEREF(__pyx_t_1);
22385 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
22386 __Pyx_GOTREF(__pyx_t_1);
22387 __Pyx_XGOTREF(strided);
22388 __Pyx_DECREF_SET(strided, __pyx_t_1);
22389 __Pyx_GIVEREF(__pyx_t_1);
22399 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
22400 __Pyx_GOTREF(__pyx_t_1);
22401 __Pyx_XGOTREF(indirect);
22402 __Pyx_DECREF_SET(indirect, __pyx_t_1);
22403 __Pyx_GIVEREF(__pyx_t_1);
22413 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
22414 __Pyx_GOTREF(__pyx_t_1);
22415 __Pyx_XGOTREF(contiguous);
22416 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
22417 __Pyx_GIVEREF(__pyx_t_1);
22427 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
22428 __Pyx_GOTREF(__pyx_t_1);
22429 __Pyx_XGOTREF(indirect_contiguous);
22430 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
22431 __Pyx_GIVEREF(__pyx_t_1);
22441 __pyx_memoryview_thread_locks_used = 0;
22450 __pyx_t_4[0] = PyThread_allocate_lock();
22451 __pyx_t_4[1] = PyThread_allocate_lock();
22452 __pyx_t_4[2] = PyThread_allocate_lock();
22453 __pyx_t_4[3] = PyThread_allocate_lock();
22454 __pyx_t_4[4] = PyThread_allocate_lock();
22455 __pyx_t_4[5] = PyThread_allocate_lock();
22456 __pyx_t_4[6] = PyThread_allocate_lock();
22457 __pyx_t_4[7] = PyThread_allocate_lock();
22458 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
22467 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
22468 __Pyx_GOTREF(__pyx_t_1);
22469 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
22470 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22471 PyType_Modified(__pyx_memoryview_type);
22480 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
22481 __Pyx_GOTREF(__pyx_t_1);
22482 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
22483 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22484 PyType_Modified(__pyx_memoryviewslice_type);
22491 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22492 __Pyx_GOTREF(__pyx_t_1);
22493 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22494 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22508 __Pyx_XDECREF(__pyx_t_1);
22509 __Pyx_XDECREF(__pyx_t_2);
22510 __Pyx_XDECREF(__pyx_t_3);
22513 __Pyx_AddTraceback(
"init superluWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
22516 }
else if (!PyErr_Occurred()) {
22517 PyErr_SetString(PyExc_ImportError,
"init superluWrappers");
22520 __Pyx_RefNannyFinishContext();
22521 #if CYTHON_PEP489_MULTI_PHASE_INIT
22522 return (__pyx_m != NULL) ? 0 : -1;
22523 #elif PY_MAJOR_VERSION >= 3
22532 #if CYTHON_REFNANNY
22533 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
22534 PyObject *m = NULL, *p = NULL;
22536 m = PyImport_ImportModule(modname);
22538 p = PyObject_GetAttrString(m,
"RefNannyAPI");
22540 r = PyLong_AsVoidPtr(p);
22544 return (__Pyx_RefNannyAPIStruct *)
r;
22549 #if CYTHON_USE_TYPE_SLOTS
22550 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
22551 PyTypeObject* tp = Py_TYPE(obj);
22552 if (likely(tp->tp_getattro))
22553 return tp->tp_getattro(obj, attr_name);
22554 #if PY_MAJOR_VERSION < 3
22555 if (likely(tp->tp_getattr))
22556 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
22558 return PyObject_GetAttr(obj, attr_name);
22563 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
22564 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
22565 if (unlikely(!result)) {
22566 PyErr_Format(PyExc_NameError,
22567 #
if PY_MAJOR_VERSION >= 3
22568 "name '%U' is not defined", name);
22570 "name '%.200s' is not defined", PyString_AS_STRING(name));
22577 static void __Pyx_RaiseArgtupleInvalid(
22578 const char* func_name,
22580 Py_ssize_t num_min,
22581 Py_ssize_t num_max,
22582 Py_ssize_t num_found)
22584 Py_ssize_t num_expected;
22585 const char *more_or_less;
22586 if (num_found < num_min) {
22587 num_expected = num_min;
22588 more_or_less =
"at least";
22590 num_expected = num_max;
22591 more_or_less =
"at most";
22594 more_or_less =
"exactly";
22596 PyErr_Format(PyExc_TypeError,
22597 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
22598 func_name, more_or_less, num_expected,
22599 (num_expected == 1) ?
"" :
"s", num_found);
22603 static void __Pyx_RaiseDoubleKeywordsError(
22604 const char* func_name,
22607 PyErr_Format(PyExc_TypeError,
22608 #
if PY_MAJOR_VERSION >= 3
22609 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
22611 "%s() got multiple values for keyword argument '%s'", func_name,
22612 PyString_AsString(kw_name));
22617 static int __Pyx_ParseOptionalKeywords(
22619 PyObject **argnames[],
22621 PyObject *values[],
22622 Py_ssize_t num_pos_args,
22623 const char* function_name)
22625 PyObject *key = 0, *value = 0;
22626 Py_ssize_t
pos = 0;
22628 PyObject*** first_kw_arg = argnames + num_pos_args;
22629 while (PyDict_Next(kwds, &
pos, &key, &value)) {
22630 name = first_kw_arg;
22631 while (*name && (**name != key)) name++;
22633 values[name-argnames] = value;
22636 name = first_kw_arg;
22637 #if PY_MAJOR_VERSION < 3
22638 if (likely(PyString_Check(key))) {
22640 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
22641 && _PyString_Eq(**name, key)) {
22642 values[name-argnames] = value;
22647 if (*name)
continue;
22649 PyObject*** argname = argnames;
22650 while (argname != first_kw_arg) {
22651 if ((**argname == key) || (
22652 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
22653 && _PyString_Eq(**argname, key))) {
22654 goto arg_passed_twice;
22661 if (likely(PyUnicode_Check(key))) {
22663 int cmp = (**name == key) ? 0 :
22664 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22665 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22667 PyUnicode_Compare(**name, key);
22668 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
22670 values[name-argnames] = value;
22675 if (*name)
continue;
22677 PyObject*** argname = argnames;
22678 while (argname != first_kw_arg) {
22679 int cmp = (**argname == key) ? 0 :
22680 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22681 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22683 PyUnicode_Compare(**argname, key);
22684 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
22685 if (cmp == 0)
goto arg_passed_twice;
22690 goto invalid_keyword_type;
22692 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
22694 goto invalid_keyword;
22699 __Pyx_RaiseDoubleKeywordsError(function_name, key);
22701 invalid_keyword_type:
22702 PyErr_Format(PyExc_TypeError,
22703 "%.200s() keywords must be strings", function_name);
22706 PyErr_Format(PyExc_TypeError,
22707 #
if PY_MAJOR_VERSION < 3
22708 "%.200s() got an unexpected keyword argument '%.200s'",
22709 function_name, PyString_AsString(key));
22711 "%s() got an unexpected keyword argument '%U'",
22712 function_name, key);
22719 #if CYTHON_USE_TYPE_SLOTS
22720 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
22721 PyTypeObject* tp = Py_TYPE(obj);
22722 if (likely(tp->tp_setattro))
22723 return tp->tp_setattro(obj, attr_name, value);
22724 #if PY_MAJOR_VERSION < 3
22725 if (likely(tp->tp_setattr))
22726 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
22728 return PyObject_SetAttr(obj, attr_name, value);
22733 #if CYTHON_COMPILING_IN_CPYTHON
22734 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22736 ternaryfunc call = Py_TYPE(func)->tp_call;
22737 if (unlikely(!call))
22738 return PyObject_Call(func, arg, kw);
22739 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
22741 result = (*call)(func, arg, kw);
22742 Py_LeaveRecursiveCall();
22743 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22746 "NULL result without error in PyObject_Call");
22753 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
22754 if (unlikely(!type)) {
22755 PyErr_SetString(PyExc_SystemError,
"Missing type object");
22758 if (likely(__Pyx_TypeCheck(obj, type)))
22760 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
22761 Py_TYPE(obj)->tp_name, type->tp_name);
22767 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
22769 __Pyx_memviewslice *memviewslice,
22770 int memview_is_new_reference)
22772 __Pyx_RefNannyDeclarations
22774 Py_buffer *buf = &memview->view;
22775 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
22776 if (unlikely(memviewslice->memview || memviewslice->data)) {
22777 PyErr_SetString(PyExc_ValueError,
22778 "memviewslice is already initialized!");
22781 if (buf->strides) {
22782 for (i = 0; i < ndim; i++) {
22783 memviewslice->strides[i] = buf->strides[i];
22786 Py_ssize_t stride = buf->itemsize;
22787 for (i = ndim - 1; i >= 0; i--) {
22788 memviewslice->strides[i] = stride;
22789 stride *= buf->shape[i];
22792 for (i = 0; i < ndim; i++) {
22793 memviewslice->shape[i] = buf->shape[i];
22794 if (buf->suboffsets) {
22795 memviewslice->suboffsets[i] = buf->suboffsets[i];
22797 memviewslice->suboffsets[i] = -1;
22800 memviewslice->memview = memview;
22801 memviewslice->data = (
char *)buf->buf;
22802 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
22803 Py_INCREF(memview);
22808 memviewslice->memview = 0;
22809 memviewslice->data = 0;
22812 __Pyx_RefNannyFinishContext();
22815 #ifndef Py_NO_RETURN
22816 #define Py_NO_RETURN
22818 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
22821 #ifdef HAVE_STDARG_PROTOTYPES
22822 va_start(vargs, fmt);
22826 vsnprintf(msg, 200, fmt, vargs);
22828 Py_FatalError(msg);
22830 static CYTHON_INLINE
int
22831 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22832 PyThread_type_lock lock)
22835 PyThread_acquire_lock(lock, 1);
22836 result = (*acquisition_count)++;
22837 PyThread_release_lock(lock);
22840 static CYTHON_INLINE
int
22841 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22842 PyThread_type_lock lock)
22845 PyThread_acquire_lock(lock, 1);
22846 result = (*acquisition_count)--;
22847 PyThread_release_lock(lock);
22850 static CYTHON_INLINE
void
22851 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
22854 struct __pyx_memoryview_obj *memview = memslice->memview;
22855 if (unlikely(!memview || (PyObject *) memview == Py_None))
22857 if (unlikely(__pyx_get_slice_count(memview) < 0))
22858 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
22859 __pyx_get_slice_count(memview), lineno);
22860 first_time = __pyx_add_acquisition_count(memview) == 0;
22861 if (unlikely(first_time)) {
22863 Py_INCREF((PyObject *) memview);
22865 PyGILState_STATE _gilstate = PyGILState_Ensure();
22866 Py_INCREF((PyObject *) memview);
22867 PyGILState_Release(_gilstate);
22871 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
22872 int have_gil,
int lineno) {
22874 struct __pyx_memoryview_obj *memview = memslice->memview;
22875 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
22876 memslice->memview = NULL;
22879 if (unlikely(__pyx_get_slice_count(memview) <= 0))
22880 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
22881 __pyx_get_slice_count(memview), lineno);
22882 last_time = __pyx_sub_acquisition_count(memview) == 1;
22883 memslice->data = NULL;
22884 if (unlikely(last_time)) {
22886 Py_CLEAR(memslice->memview);
22888 PyGILState_STATE _gilstate = PyGILState_Ensure();
22889 Py_CLEAR(memslice->memview);
22890 PyGILState_Release(_gilstate);
22893 memslice->memview = NULL;
22898 #if CYTHON_FAST_PYCALL
22899 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22900 PyObject *globals) {
22902 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22903 PyObject **fastlocals;
22906 assert(globals != NULL);
22911 assert(tstate != NULL);
22912 f = PyFrame_New(tstate, co, globals, NULL);
22916 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
22917 for (i = 0; i < na; i++) {
22919 fastlocals[i] = *args++;
22921 result = PyEval_EvalFrameEx(
f,0);
22922 ++tstate->recursion_depth;
22924 --tstate->recursion_depth;
22927 #if 1 || PY_VERSION_HEX < 0x030600B1
22928 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
22929 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
22930 PyObject *globals = PyFunction_GET_GLOBALS(func);
22931 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
22933 #if PY_MAJOR_VERSION >= 3
22936 PyObject *kwtuple, **k;
22941 assert(kwargs == NULL || PyDict_Check(kwargs));
22942 nk = kwargs ? PyDict_Size(kwargs) : 0;
22943 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
22947 #
if PY_MAJOR_VERSION >= 3
22948 co->co_kwonlyargcount == 0 &&
22950 likely(kwargs == NULL || nk == 0) &&
22951 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
22952 if (argdefs == NULL && co->co_argcount == nargs) {
22953 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
22956 else if (nargs == 0 && argdefs != NULL
22957 && co->co_argcount == Py_SIZE(argdefs)) {
22960 args = &PyTuple_GET_ITEM(argdefs, 0);
22961 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22965 if (kwargs != NULL) {
22967 kwtuple = PyTuple_New(2 * nk);
22968 if (kwtuple == NULL) {
22972 k = &PyTuple_GET_ITEM(kwtuple, 0);
22974 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
22985 closure = PyFunction_GET_CLOSURE(func);
22986 #if PY_MAJOR_VERSION >= 3
22987 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22989 if (argdefs != NULL) {
22990 d = &PyTuple_GET_ITEM(argdefs, 0);
22991 nd = Py_SIZE(argdefs);
22997 #if PY_MAJOR_VERSION >= 3
22998 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23001 d, (
int)nd, kwdefs, closure);
23003 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23006 d, (
int)nd, closure);
23008 Py_XDECREF(kwtuple);
23010 Py_LeaveRecursiveCall();
23017 #if CYTHON_COMPILING_IN_CPYTHON
23018 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23019 PyObject *
self, *result;
23021 cfunc = PyCFunction_GET_FUNCTION(func);
23022 self = PyCFunction_GET_SELF(func);
23023 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23025 result = cfunc(
self, arg);
23026 Py_LeaveRecursiveCall();
23027 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23030 "NULL result without error in PyObject_Call");
23037 #if CYTHON_COMPILING_IN_CPYTHON
23038 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
23039 #if CYTHON_FAST_PYCALL
23040 if (PyFunction_Check(func)) {
23041 return __Pyx_PyFunction_FastCall(func, NULL, 0);
23044 #ifdef __Pyx_CyFunction_USED
23045 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
23047 if (likely(PyCFunction_Check(func)))
23050 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
23051 return __Pyx_PyObject_CallMethO(func, NULL);
23054 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
23059 #if CYTHON_FAST_PYCCALL
23060 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23061 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23062 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23063 PyObject *
self = PyCFunction_GET_SELF(func);
23064 int flags = PyCFunction_GET_FLAGS(func);
23065 assert(PyCFunction_Check(func));
23066 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23067 assert(nargs >= 0);
23068 assert(nargs == 0 || args != NULL);
23072 assert(!PyErr_Occurred());
23073 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23074 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
23076 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
23082 #if CYTHON_COMPILING_IN_CPYTHON
23083 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23085 PyObject *args = PyTuple_New(1);
23086 if (unlikely(!args))
return NULL;
23088 PyTuple_SET_ITEM(args, 0, arg);
23089 result = __Pyx_PyObject_Call(func, args, NULL);
23093 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23094 #if CYTHON_FAST_PYCALL
23095 if (PyFunction_Check(func)) {
23096 return __Pyx_PyFunction_FastCall(func, &arg, 1);
23099 if (likely(PyCFunction_Check(func))) {
23100 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23101 return __Pyx_PyObject_CallMethO(func, arg);
23102 #if CYTHON_FAST_PYCCALL
23103 }
else if (__Pyx_PyFastCFunction_Check(func)) {
23104 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23108 return __Pyx__PyObject_CallOneArg(func, arg);
23111 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23113 PyObject *args = PyTuple_Pack(1, arg);
23114 if (unlikely(!args))
return NULL;
23115 result = __Pyx_PyObject_Call(func, args, NULL);
23122 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23124 if (!j)
return NULL;
23125 r = PyObject_GetItem(o, j);
23129 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23130 CYTHON_NCP_UNUSED
int wraparound,
23131 CYTHON_NCP_UNUSED
int boundscheck) {
23132 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23133 Py_ssize_t wrapped_i = i;
23134 if (wraparound & unlikely(i < 0)) {
23135 wrapped_i += PyList_GET_SIZE(o);
23137 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
23138 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
23142 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23144 return PySequence_GetItem(o, i);
23147 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23148 CYTHON_NCP_UNUSED
int wraparound,
23149 CYTHON_NCP_UNUSED
int boundscheck) {
23150 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23151 Py_ssize_t wrapped_i = i;
23152 if (wraparound & unlikely(i < 0)) {
23153 wrapped_i += PyTuple_GET_SIZE(o);
23155 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
23156 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
23160 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23162 return PySequence_GetItem(o, i);
23165 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
23166 CYTHON_NCP_UNUSED
int wraparound,
23167 CYTHON_NCP_UNUSED
int boundscheck) {
23168 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23169 if (is_list || PyList_CheckExact(o)) {
23170 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23171 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
23172 PyObject *
r = PyList_GET_ITEM(o,
n);
23177 else if (PyTuple_CheckExact(o)) {
23178 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23179 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
23180 PyObject *
r = PyTuple_GET_ITEM(o,
n);
23185 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23186 if (likely(m && m->sq_item)) {
23187 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23188 Py_ssize_t l = m->sq_length(o);
23189 if (likely(l >= 0)) {
23192 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23197 return m->sq_item(o, i);
23201 if (is_list || PySequence_Check(o)) {
23202 return PySequence_GetItem(o, i);
23205 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23209 #if CYTHON_USE_TYPE_SLOTS
23210 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23212 Py_ssize_t key_value;
23213 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23214 if (unlikely(!(m && m->sq_item))) {
23215 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23218 key_value = __Pyx_PyIndex_AsSsize_t(index);
23219 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23220 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23222 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23224 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23228 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23229 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23230 if (likely(m && m->mp_subscript)) {
23231 return m->mp_subscript(obj, key);
23233 return __Pyx_PyObject_GetIndex(obj, key);
23238 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
23239 PyObject *args, *result = NULL;
23240 #if CYTHON_FAST_PYCALL
23241 if (PyFunction_Check(
function)) {
23242 PyObject *args[2] = {arg1, arg2};
23243 return __Pyx_PyFunction_FastCall(
function, args, 2);
23246 #if CYTHON_FAST_PYCCALL
23247 if (__Pyx_PyFastCFunction_Check(
function)) {
23248 PyObject *args[2] = {arg1, arg2};
23249 return __Pyx_PyCFunction_FastCall(
function, args, 2);
23252 args = PyTuple_New(2);
23253 if (unlikely(!args))
goto done;
23255 PyTuple_SET_ITEM(args, 0, arg1);
23257 PyTuple_SET_ITEM(args, 1, arg2);
23258 Py_INCREF(
function);
23259 result = __Pyx_PyObject_Call(
function, args, NULL);
23261 Py_DECREF(
function);
23267 #if !CYTHON_COMPILING_IN_PYPY
23268 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
23270 (void)zerodivision_check;
23271 #if PY_MAJOR_VERSION < 3
23272 if (likely(PyInt_CheckExact(op1))) {
23273 const long b = intval;
23275 long a = PyInt_AS_LONG(op1);
23276 x = (long)((
unsigned long)a + b);
23277 if (likely((x^a) >= 0 || (x^b) >= 0))
23278 return PyInt_FromLong(x);
23279 return PyLong_Type.tp_as_number->nb_add(op1, op2);
23282 #if CYTHON_USE_PYLONG_INTERNALS
23283 if (likely(PyLong_CheckExact(op1))) {
23284 const long b = intval;
23286 #ifdef HAVE_LONG_LONG
23287 const PY_LONG_LONG llb = intval;
23288 PY_LONG_LONG lla, llx;
23290 const digit* digits = ((PyLongObject*)op1)->ob_digit;
23291 const Py_ssize_t size = Py_SIZE(op1);
23292 if (likely(__Pyx_sst_abs(size) <= 1)) {
23293 a = likely(size) ? digits[0] : 0;
23294 if (size == -1) a = -a;
23298 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23299 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23301 #ifdef HAVE_LONG_LONG
23302 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23303 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23307 CYTHON_FALLTHROUGH;
23309 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23310 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23312 #ifdef HAVE_LONG_LONG
23313 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23314 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23318 CYTHON_FALLTHROUGH;
23320 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23321 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23323 #ifdef HAVE_LONG_LONG
23324 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23325 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23329 CYTHON_FALLTHROUGH;
23331 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23332 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23334 #ifdef HAVE_LONG_LONG
23335 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23336 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23340 CYTHON_FALLTHROUGH;
23342 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23343 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23345 #ifdef HAVE_LONG_LONG
23346 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23347 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23351 CYTHON_FALLTHROUGH;
23353 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23354 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23356 #ifdef HAVE_LONG_LONG
23357 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23358 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23362 CYTHON_FALLTHROUGH;
23363 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
23367 return PyLong_FromLong(x);
23368 #ifdef HAVE_LONG_LONG
23371 return PyLong_FromLongLong(llx);
23377 if (PyFloat_CheckExact(op1)) {
23378 const long b = intval;
23379 double a = PyFloat_AS_DOUBLE(op1);
23381 PyFPE_START_PROTECT(
"add",
return NULL)
23382 result = ((double)a) + (double)b;
23383 PyFPE_END_PROTECT(result)
23384 return PyFloat_FromDouble(result);
23386 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23391 #if CYTHON_USE_EXC_INFO_STACK
23392 static _PyErr_StackItem *
23393 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
23395 _PyErr_StackItem *exc_info = tstate->exc_info;
23396 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
23397 exc_info->previous_item != NULL)
23399 exc_info = exc_info->previous_item;
23406 #if CYTHON_FAST_THREAD_STATE
23407 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23408 #if CYTHON_USE_EXC_INFO_STACK
23409 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
23410 *type = exc_info->exc_type;
23411 *value = exc_info->exc_value;
23412 *tb = exc_info->exc_traceback;
23414 *type = tstate->exc_type;
23415 *value = tstate->exc_value;
23416 *tb = tstate->exc_traceback;
23419 Py_XINCREF(*value);
23422 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23423 PyObject *tmp_type, *tmp_value, *tmp_tb;
23424 #if CYTHON_USE_EXC_INFO_STACK
23425 _PyErr_StackItem *exc_info = tstate->exc_info;
23426 tmp_type = exc_info->exc_type;
23427 tmp_value = exc_info->exc_value;
23428 tmp_tb = exc_info->exc_traceback;
23429 exc_info->exc_type = type;
23430 exc_info->exc_value = value;
23431 exc_info->exc_traceback = tb;
23433 tmp_type = tstate->exc_type;
23434 tmp_value = tstate->exc_value;
23435 tmp_tb = tstate->exc_traceback;
23436 tstate->exc_type = type;
23437 tstate->exc_value = value;
23438 tstate->exc_traceback = tb;
23440 Py_XDECREF(tmp_type);
23441 Py_XDECREF(tmp_value);
23442 Py_XDECREF(tmp_tb);
23447 #if CYTHON_FAST_THREAD_STATE
23448 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
23450 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
23453 PyObject *local_type, *local_value, *local_tb;
23454 #if CYTHON_FAST_THREAD_STATE
23455 PyObject *tmp_type, *tmp_value, *tmp_tb;
23456 local_type = tstate->curexc_type;
23457 local_value = tstate->curexc_value;
23458 local_tb = tstate->curexc_traceback;
23459 tstate->curexc_type = 0;
23460 tstate->curexc_value = 0;
23461 tstate->curexc_traceback = 0;
23463 PyErr_Fetch(&local_type, &local_value, &local_tb);
23465 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
23466 #if CYTHON_FAST_THREAD_STATE
23467 if (unlikely(tstate->curexc_type))
23469 if (unlikely(PyErr_Occurred()))
23472 #if PY_MAJOR_VERSION >= 3
23474 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
23478 Py_XINCREF(local_tb);
23479 Py_XINCREF(local_type);
23480 Py_XINCREF(local_value);
23481 *type = local_type;
23482 *value = local_value;
23484 #if CYTHON_FAST_THREAD_STATE
23485 #if CYTHON_USE_EXC_INFO_STACK
23487 _PyErr_StackItem *exc_info = tstate->exc_info;
23488 tmp_type = exc_info->exc_type;
23489 tmp_value = exc_info->exc_value;
23490 tmp_tb = exc_info->exc_traceback;
23491 exc_info->exc_type = local_type;
23492 exc_info->exc_value = local_value;
23493 exc_info->exc_traceback = local_tb;
23496 tmp_type = tstate->exc_type;
23497 tmp_value = tstate->exc_value;
23498 tmp_tb = tstate->exc_traceback;
23499 tstate->exc_type = local_type;
23500 tstate->exc_value = local_value;
23501 tstate->exc_traceback = local_tb;
23503 Py_XDECREF(tmp_type);
23504 Py_XDECREF(tmp_value);
23505 Py_XDECREF(tmp_tb);
23507 PyErr_SetExcInfo(local_type, local_value, local_tb);
23514 Py_XDECREF(local_type);
23515 Py_XDECREF(local_value);
23516 Py_XDECREF(local_tb);
23521 #if CYTHON_FAST_THREAD_STATE
23522 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23523 PyObject *tmp_type, *tmp_value, *tmp_tb;
23524 tmp_type = tstate->curexc_type;
23525 tmp_value = tstate->curexc_value;
23526 tmp_tb = tstate->curexc_traceback;
23527 tstate->curexc_type = type;
23528 tstate->curexc_value = value;
23529 tstate->curexc_traceback = tb;
23530 Py_XDECREF(tmp_type);
23531 Py_XDECREF(tmp_value);
23532 Py_XDECREF(tmp_tb);
23534 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23535 *type = tstate->curexc_type;
23536 *value = tstate->curexc_value;
23537 *tb = tstate->curexc_traceback;
23538 tstate->curexc_type = 0;
23539 tstate->curexc_value = 0;
23540 tstate->curexc_traceback = 0;
23545 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
23546 Py_ssize_t cstart, Py_ssize_t cstop,
23547 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
23548 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
23549 #if CYTHON_USE_TYPE_SLOTS
23550 PyMappingMethods* mp;
23551 #if PY_MAJOR_VERSION < 3
23552 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
23553 if (likely(ms && ms->sq_slice)) {
23555 if (_py_start && (*_py_start != Py_None)) {
23556 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
23557 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
23562 if (_py_stop && (*_py_stop != Py_None)) {
23563 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
23564 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
23566 cstop = PY_SSIZE_T_MAX;
23568 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
23569 Py_ssize_t l = ms->sq_length(obj);
23570 if (likely(l >= 0)) {
23573 if (cstop < 0) cstop = 0;
23577 if (cstart < 0) cstart = 0;
23580 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23585 return ms->sq_slice(obj, cstart, cstop);
23588 mp = Py_TYPE(obj)->tp_as_mapping;
23589 if (likely(mp && mp->mp_subscript))
23593 PyObject *py_slice, *py_start, *py_stop;
23595 py_slice = *_py_slice;
23597 PyObject* owned_start = NULL;
23598 PyObject* owned_stop = NULL;
23600 py_start = *_py_start;
23603 owned_start = py_start = PyInt_FromSsize_t(cstart);
23604 if (unlikely(!py_start))
goto bad;
23606 py_start = Py_None;
23609 py_stop = *_py_stop;
23612 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
23613 if (unlikely(!py_stop)) {
23614 Py_XDECREF(owned_start);
23620 py_slice = PySlice_New(py_start, py_stop, Py_None);
23621 Py_XDECREF(owned_start);
23622 Py_XDECREF(owned_stop);
23623 if (unlikely(!py_slice))
goto bad;
23625 #if CYTHON_USE_TYPE_SLOTS
23626 result = mp->mp_subscript(obj, py_slice);
23628 result = PyObject_GetItem(obj, py_slice);
23631 Py_DECREF(py_slice);
23635 PyErr_Format(PyExc_TypeError,
23636 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
23642 #if PY_MAJOR_VERSION < 3
23643 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
23644 CYTHON_UNUSED PyObject *cause) {
23645 __Pyx_PyThreadState_declare
23647 if (!value || value == Py_None)
23651 if (!tb || tb == Py_None)
23655 if (!PyTraceBack_Check(tb)) {
23656 PyErr_SetString(PyExc_TypeError,
23657 "raise: arg 3 must be a traceback or None");
23661 if (PyType_Check(type)) {
23662 #if CYTHON_COMPILING_IN_PYPY
23664 Py_INCREF(Py_None);
23668 PyErr_NormalizeException(&type, &value, &tb);
23671 PyErr_SetString(PyExc_TypeError,
23672 "instance exception may not have a separate value");
23676 type = (PyObject*) Py_TYPE(type);
23678 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23679 PyErr_SetString(PyExc_TypeError,
23680 "raise: exception class must be a subclass of BaseException");
23684 __Pyx_PyThreadState_assign
23685 __Pyx_ErrRestore(type, value, tb);
23694 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23695 PyObject* owned_instance = NULL;
23696 if (tb == Py_None) {
23698 }
else if (tb && !PyTraceBack_Check(tb)) {
23699 PyErr_SetString(PyExc_TypeError,
23700 "raise: arg 3 must be a traceback or None");
23703 if (value == Py_None)
23705 if (PyExceptionInstance_Check(type)) {
23707 PyErr_SetString(PyExc_TypeError,
23708 "instance exception may not have a separate value");
23712 type = (PyObject*) Py_TYPE(value);
23713 }
else if (PyExceptionClass_Check(type)) {
23714 PyObject *instance_class = NULL;
23715 if (value && PyExceptionInstance_Check(value)) {
23716 instance_class = (PyObject*) Py_TYPE(value);
23717 if (instance_class != type) {
23718 int is_subclass = PyObject_IsSubclass(instance_class, type);
23719 if (!is_subclass) {
23720 instance_class = NULL;
23721 }
else if (unlikely(is_subclass == -1)) {
23724 type = instance_class;
23728 if (!instance_class) {
23731 args = PyTuple_New(0);
23732 else if (PyTuple_Check(value)) {
23736 args = PyTuple_Pack(1, value);
23739 owned_instance = PyObject_Call(type, args, NULL);
23741 if (!owned_instance)
23743 value = owned_instance;
23744 if (!PyExceptionInstance_Check(value)) {
23745 PyErr_Format(PyExc_TypeError,
23746 "calling %R should have returned an instance of "
23747 "BaseException, not %R",
23748 type, Py_TYPE(value));
23753 PyErr_SetString(PyExc_TypeError,
23754 "raise: exception class must be a subclass of BaseException");
23758 PyObject *fixed_cause;
23759 if (cause == Py_None) {
23760 fixed_cause = NULL;
23761 }
else if (PyExceptionClass_Check(cause)) {
23762 fixed_cause = PyObject_CallObject(cause, NULL);
23763 if (fixed_cause == NULL)
23765 }
else if (PyExceptionInstance_Check(cause)) {
23766 fixed_cause = cause;
23767 Py_INCREF(fixed_cause);
23769 PyErr_SetString(PyExc_TypeError,
23770 "exception causes must derive from "
23774 PyException_SetCause(value, fixed_cause);
23776 PyErr_SetObject(type, value);
23778 #if CYTHON_COMPILING_IN_PYPY
23779 PyObject *tmp_type, *tmp_value, *tmp_tb;
23780 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
23782 PyErr_Restore(tmp_type, tmp_value, tb);
23783 Py_XDECREF(tmp_tb);
23785 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23786 PyObject* tmp_tb = tstate->curexc_traceback;
23787 if (tb != tmp_tb) {
23789 tstate->curexc_traceback = tb;
23790 Py_XDECREF(tmp_tb);
23795 Py_XDECREF(owned_instance);
23801 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
23802 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
23803 int full_traceback, CYTHON_UNUSED
int nogil) {
23804 PyObject *old_exc, *old_val, *old_tb;
23806 __Pyx_PyThreadState_declare
23808 PyGILState_STATE state;
23810 state = PyGILState_Ensure();
23812 else state = (PyGILState_STATE)-1;
23815 __Pyx_PyThreadState_assign
23816 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
23817 if (full_traceback) {
23818 Py_XINCREF(old_exc);
23819 Py_XINCREF(old_val);
23820 Py_XINCREF(old_tb);
23821 __Pyx_ErrRestore(old_exc, old_val, old_tb);
23824 #if PY_MAJOR_VERSION < 3
23825 ctx = PyString_FromString(name);
23827 ctx = PyUnicode_FromString(name);
23829 __Pyx_ErrRestore(old_exc, old_val, old_tb);
23831 PyErr_WriteUnraisable(Py_None);
23833 PyErr_WriteUnraisable(ctx);
23838 PyGILState_Release(state);
23843 #if CYTHON_FAST_THREAD_STATE
23844 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23846 n = PyTuple_GET_SIZE(tuple);
23847 #if PY_MAJOR_VERSION >= 3
23848 for (i=0; i<
n; i++) {
23849 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
23852 for (i=0; i<
n; i++) {
23853 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
23857 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
23858 PyObject *exc_type = tstate->curexc_type;
23859 if (exc_type == err)
return 1;
23860 if (unlikely(!exc_type))
return 0;
23861 if (unlikely(PyTuple_Check(err)))
23862 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
23863 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
23868 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
23870 if (unlikely(!type)) {
23871 PyErr_SetString(PyExc_SystemError,
"Missing type object");
23875 #if PY_MAJOR_VERSION == 2
23876 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
23880 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
23882 PyErr_Format(PyExc_TypeError,
23883 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23884 name, type->tp_name, Py_TYPE(obj)->tp_name);
23889 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
23890 #if CYTHON_COMPILING_IN_PYPY
23891 return PyObject_RichCompareBool(s1, s2, equals);
23894 return (equals == Py_EQ);
23895 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
23896 const char *ps1, *ps2;
23897 Py_ssize_t length = PyBytes_GET_SIZE(s1);
23898 if (length != PyBytes_GET_SIZE(s2))
23899 return (equals == Py_NE);
23900 ps1 = PyBytes_AS_STRING(s1);
23901 ps2 = PyBytes_AS_STRING(s2);
23902 if (ps1[0] != ps2[0]) {
23903 return (equals == Py_NE);
23904 }
else if (length == 1) {
23905 return (equals == Py_EQ);
23908 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
23909 Py_hash_t hash1, hash2;
23910 hash1 = ((PyBytesObject*)s1)->ob_shash;
23911 hash2 = ((PyBytesObject*)s2)->ob_shash;
23912 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23913 return (equals == Py_NE);
23916 result = memcmp(ps1, ps2, (
size_t)length);
23917 return (equals == Py_EQ) ? (result == 0) : (result != 0);
23919 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
23920 return (equals == Py_NE);
23921 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
23922 return (equals == Py_NE);
23925 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23928 result = __Pyx_PyObject_IsTrue(py_result);
23929 Py_DECREF(py_result);
23936 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
23937 #if CYTHON_COMPILING_IN_PYPY
23938 return PyObject_RichCompareBool(s1, s2, equals);
23940 #if PY_MAJOR_VERSION < 3
23941 PyObject* owned_ref = NULL;
23943 int s1_is_unicode, s2_is_unicode;
23947 s1_is_unicode = PyUnicode_CheckExact(s1);
23948 s2_is_unicode = PyUnicode_CheckExact(s2);
23949 #if PY_MAJOR_VERSION < 3
23950 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23951 owned_ref = PyUnicode_FromObject(s2);
23952 if (unlikely(!owned_ref))
23956 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23957 owned_ref = PyUnicode_FromObject(s1);
23958 if (unlikely(!owned_ref))
23962 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23963 return __Pyx_PyBytes_Equals(s1, s2, equals);
23966 if (s1_is_unicode & s2_is_unicode) {
23969 void *data1, *data2;
23970 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23972 length = __Pyx_PyUnicode_GET_LENGTH(s1);
23973 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23976 #if CYTHON_USE_UNICODE_INTERNALS
23978 Py_hash_t hash1, hash2;
23979 #if CYTHON_PEP393_ENABLED
23980 hash1 = ((PyASCIIObject*)s1)->hash;
23981 hash2 = ((PyASCIIObject*)s2)->hash;
23983 hash1 = ((PyUnicodeObject*)s1)->hash;
23984 hash2 = ((PyUnicodeObject*)s2)->hash;
23986 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23991 kind = __Pyx_PyUnicode_KIND(s1);
23992 if (kind != __Pyx_PyUnicode_KIND(s2)) {
23995 data1 = __Pyx_PyUnicode_DATA(s1);
23996 data2 = __Pyx_PyUnicode_DATA(s2);
23997 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23999 }
else if (length == 1) {
24002 int result = memcmp(data1, data2, (
size_t)(length * kind));
24003 #if PY_MAJOR_VERSION < 3
24004 Py_XDECREF(owned_ref);
24006 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24008 }
else if ((s1 == Py_None) & s2_is_unicode) {
24010 }
else if ((s2 == Py_None) & s1_is_unicode) {
24014 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24015 #if PY_MAJOR_VERSION < 3
24016 Py_XDECREF(owned_ref);
24020 result = __Pyx_PyObject_IsTrue(py_result);
24021 Py_DECREF(py_result);
24025 #if PY_MAJOR_VERSION < 3
24026 Py_XDECREF(owned_ref);
24028 return (equals == Py_EQ);
24030 #if PY_MAJOR_VERSION < 3
24031 Py_XDECREF(owned_ref);
24033 return (equals == Py_NE);
24038 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24039 Py_ssize_t
q = a / b;
24040 Py_ssize_t
r = a -
q*b;
24041 q -= ((
r != 0) & ((
r ^ b) < 0));
24046 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
24047 #if CYTHON_USE_TYPE_SLOTS
24048 #if PY_MAJOR_VERSION >= 3
24049 if (likely(PyUnicode_Check(
n)))
24051 if (likely(PyString_Check(
n)))
24053 return __Pyx_PyObject_GetAttrStr(o,
n);
24055 return PyObject_GetAttr(o,
n);
24059 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24060 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24061 const char* encoding,
const char* errors,
24062 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
24064 if (unlikely((start < 0) | (stop < 0))) {
24065 size_t slen = strlen(cstring);
24066 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
24067 PyErr_SetString(PyExc_OverflowError,
24068 "c-string too long to convert to Python");
24071 length = (Py_ssize_t) slen;
24080 if (unlikely(stop <= start))
24081 return __Pyx_NewRef(__pyx_empty_unicode);
24082 length = stop - start;
24085 return decode_func(cstring, length, errors);
24087 return PyUnicode_Decode(cstring, length, encoding, errors);
24092 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24093 __Pyx_PyThreadState_declare
24094 __Pyx_PyThreadState_assign
24095 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24097 __Pyx_PyErr_Clear();
24101 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
24102 PyObject *
r = __Pyx_GetAttr(o,
n);
24103 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
24107 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24108 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24109 PyObject *dict = Py_TYPE(obj)->tp_dict;
24110 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24112 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24113 PyObject **dictptr = NULL;
24114 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24116 #if CYTHON_COMPILING_IN_CPYTHON
24117 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24119 dictptr = _PyObject_GetDictPtr(obj);
24122 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24124 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24125 PyObject *dict = Py_TYPE(obj)->tp_dict;
24126 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24128 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24133 #if CYTHON_USE_DICT_VERSIONS
24134 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24136 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24140 #if !CYTHON_AVOID_BORROWED_REFS
24141 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24142 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24143 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24144 if (likely(result)) {
24145 return __Pyx_NewRef(result);
24146 }
else if (unlikely(PyErr_Occurred())) {
24150 result = PyDict_GetItem(__pyx_d, name);
24151 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24152 if (likely(result)) {
24153 return __Pyx_NewRef(result);
24157 result = PyObject_GetItem(__pyx_d, name);
24158 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24159 if (likely(result)) {
24160 return __Pyx_NewRef(result);
24164 return __Pyx_GetBuiltinName(name);
24168 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24169 PyErr_Format(PyExc_ValueError,
24170 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24174 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24175 PyErr_Format(PyExc_ValueError,
24176 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24177 index, (index == 1) ?
"" :
"s");
24181 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
24182 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
24186 #if CYTHON_FAST_THREAD_STATE
24187 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24188 PyObject *tmp_type, *tmp_value, *tmp_tb;
24189 #if CYTHON_USE_EXC_INFO_STACK
24190 _PyErr_StackItem *exc_info = tstate->exc_info;
24191 tmp_type = exc_info->exc_type;
24192 tmp_value = exc_info->exc_value;
24193 tmp_tb = exc_info->exc_traceback;
24194 exc_info->exc_type = *type;
24195 exc_info->exc_value = *value;
24196 exc_info->exc_traceback = *tb;
24198 tmp_type = tstate->exc_type;
24199 tmp_value = tstate->exc_value;
24200 tmp_tb = tstate->exc_traceback;
24201 tstate->exc_type = *type;
24202 tstate->exc_value = *value;
24203 tstate->exc_traceback = *tb;
24206 *value = tmp_value;
24210 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
24211 PyObject *tmp_type, *tmp_value, *tmp_tb;
24212 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
24213 PyErr_SetExcInfo(*type, *value, *tb);
24215 *value = tmp_value;
24221 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
24222 PyObject *empty_list = 0;
24223 PyObject *module = 0;
24224 PyObject *global_dict = 0;
24225 PyObject *empty_dict = 0;
24227 #if PY_MAJOR_VERSION < 3
24228 PyObject *py_import;
24229 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24236 empty_list = PyList_New(0);
24241 global_dict = PyModule_GetDict(__pyx_m);
24244 empty_dict = PyDict_New();
24248 #if PY_MAJOR_VERSION >= 3
24250 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
24251 module = PyImport_ImportModuleLevelObject(
24252 name, global_dict, empty_dict, list, 1);
24254 if (!PyErr_ExceptionMatches(PyExc_ImportError))
24263 #if PY_MAJOR_VERSION < 3
24264 PyObject *py_level = PyInt_FromLong(level);
24267 module = PyObject_CallFunctionObjArgs(py_import,
24268 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24269 Py_DECREF(py_level);
24271 module = PyImport_ImportModuleLevelObject(
24272 name, global_dict, empty_dict, list, level);
24277 #if PY_MAJOR_VERSION < 3
24278 Py_XDECREF(py_import);
24280 Py_XDECREF(empty_list);
24281 Py_XDECREF(empty_dict);
24286 #if CYTHON_COMPILING_IN_CPYTHON
24287 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24293 return b == &PyBaseObject_Type;
24295 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24297 if (a == b)
return 1;
24301 n = PyTuple_GET_SIZE(mro);
24302 for (i = 0; i <
n; i++) {
24303 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24308 return __Pyx_InBases(a, b);
24310 #if PY_MAJOR_VERSION == 2
24311 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24312 PyObject *exception, *value, *tb;
24314 __Pyx_PyThreadState_declare
24315 __Pyx_PyThreadState_assign
24316 __Pyx_ErrFetch(&exception, &value, &tb);
24317 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24318 if (unlikely(res == -1)) {
24319 PyErr_WriteUnraisable(err);
24323 res = PyObject_IsSubclass(err, exc_type2);
24324 if (unlikely(res == -1)) {
24325 PyErr_WriteUnraisable(err);
24329 __Pyx_ErrRestore(exception, value, tb);
24333 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24334 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24336 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24341 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24343 assert(PyExceptionClass_Check(exc_type));
24344 n = PyTuple_GET_SIZE(tuple);
24345 #if PY_MAJOR_VERSION >= 3
24346 for (i=0; i<
n; i++) {
24347 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24350 for (i=0; i<
n; i++) {
24351 PyObject *t = PyTuple_GET_ITEM(tuple, i);
24352 #if PY_MAJOR_VERSION < 3
24353 if (likely(exc_type == t))
return 1;
24355 if (likely(PyExceptionClass_Check(t))) {
24356 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
24362 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24363 if (likely(err == exc_type))
return 1;
24364 if (likely(PyExceptionClass_Check(err))) {
24365 if (likely(PyExceptionClass_Check(exc_type))) {
24366 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24367 }
else if (likely(PyTuple_Check(exc_type))) {
24368 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24372 return PyErr_GivenExceptionMatches(err, exc_type);
24374 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24375 assert(PyExceptionClass_Check(exc_type1));
24376 assert(PyExceptionClass_Check(exc_type2));
24377 if (likely(err == exc_type1 || err == exc_type2))
return 1;
24378 if (likely(PyExceptionClass_Check(err))) {
24379 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24381 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24386 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
24387 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
24391 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
24394 q -= ((
r != 0) & ((
r ^ b) < 0));
24399 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24400 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24401 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24402 PyErr_Format(PyExc_ImportError,
24403 #
if PY_MAJOR_VERSION < 3
24404 "cannot import name %.230s", PyString_AS_STRING(name));
24406 "cannot import name %S", name);
24413 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
24415 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
24416 PyErr_SetString(PyExc_TypeError,
24417 "hasattr(): attribute name must be string");
24420 r = __Pyx_GetAttr(o,
n);
24421 if (unlikely(!
r)) {
24431 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24432 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
24433 PyErr_Format(PyExc_AttributeError,
24434 #
if PY_MAJOR_VERSION >= 3
24435 "'%.50s' object has no attribute '%U'",
24436 tp->tp_name, attr_name);
24438 "'%.50s' object has no attribute '%.400s'",
24439 tp->tp_name, PyString_AS_STRING(attr_name));
24443 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
24445 PyTypeObject *tp = Py_TYPE(obj);
24446 if (unlikely(!PyString_Check(attr_name))) {
24447 return PyObject_GenericGetAttr(obj, attr_name);
24449 assert(!tp->tp_dictoffset);
24450 descr = _PyType_Lookup(tp, attr_name);
24451 if (unlikely(!descr)) {
24452 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
24455 #if PY_MAJOR_VERSION < 3
24456 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
24459 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
24461 PyObject *res =
f(descr, obj, (PyObject *)tp);
24471 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24472 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
24473 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
24474 return PyObject_GenericGetAttr(obj, attr_name);
24476 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
24481 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
24482 __Pyx_PyThreadState_declare
24483 __Pyx_PyThreadState_assign
24484 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24485 __Pyx_PyErr_Clear();
24487 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
24489 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
24490 PyTypeObject* tp = Py_TYPE(obj);
24491 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
24492 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
24495 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
24496 if (unlikely(!result)) {
24497 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
24503 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
24505 PyObject *name_attr;
24506 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
24507 if (likely(name_attr)) {
24508 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
24512 if (unlikely(ret < 0)) {
24516 Py_XDECREF(name_attr);
24519 static int __Pyx_setup_reduce(PyObject* type_obj) {
24521 PyObject *object_reduce = NULL;
24522 PyObject *object_getstate = NULL;
24523 PyObject *object_reduce_ex = NULL;
24524 PyObject *reduce = NULL;
24525 PyObject *reduce_ex = NULL;
24526 PyObject *reduce_cython = NULL;
24527 PyObject *setstate = NULL;
24528 PyObject *setstate_cython = NULL;
24529 PyObject *getstate = NULL;
24530 #if CYTHON_USE_PYTYPE_LOOKUP
24531 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
24533 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
24534 if (!getstate && PyErr_Occurred()) {
24539 #if CYTHON_USE_PYTYPE_LOOKUP
24540 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
24542 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
24543 if (!object_getstate && PyErr_Occurred()) {
24547 if (object_getstate != getstate) {
24551 #if CYTHON_USE_PYTYPE_LOOKUP
24552 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
24554 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
24556 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
24557 if (reduce_ex == object_reduce_ex) {
24558 #if CYTHON_USE_PYTYPE_LOOKUP
24559 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
24561 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
24563 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
24564 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
24565 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
24566 if (likely(reduce_cython)) {
24567 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
24568 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
24569 }
else if (reduce == object_reduce || PyErr_Occurred()) {
24572 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
24573 if (!setstate) PyErr_Clear();
24574 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
24575 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
24576 if (likely(setstate_cython)) {
24577 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
24578 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
24579 }
else if (!setstate || PyErr_Occurred()) {
24583 PyType_Modified((PyTypeObject*)type_obj);
24588 if (!PyErr_Occurred())
24589 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
24592 #if !CYTHON_USE_PYTYPE_LOOKUP
24593 Py_XDECREF(object_reduce);
24594 Py_XDECREF(object_reduce_ex);
24595 Py_XDECREF(object_getstate);
24596 Py_XDECREF(getstate);
24598 Py_XDECREF(reduce);
24599 Py_XDECREF(reduce_ex);
24600 Py_XDECREF(reduce_cython);
24601 Py_XDECREF(setstate);
24602 Py_XDECREF(setstate_cython);
24607 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
24608 #if PY_VERSION_HEX >= 0x02070000
24609 PyObject *ob = PyCapsule_New(vtable, 0, 0);
24611 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
24615 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
24625 #ifndef __PYX_HAVE_RT_ImportType
24626 #define __PYX_HAVE_RT_ImportType
24627 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
24628 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
24630 PyObject *result = 0;
24632 Py_ssize_t basicsize;
24633 #ifdef Py_LIMITED_API
24634 PyObject *py_basicsize;
24636 result = PyObject_GetAttrString(module, class_name);
24639 if (!PyType_Check(result)) {
24640 PyErr_Format(PyExc_TypeError,
24641 "%.200s.%.200s is not a type object",
24642 module_name, class_name);
24645 #ifndef Py_LIMITED_API
24646 basicsize = ((PyTypeObject *)result)->tp_basicsize;
24648 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
24651 basicsize = PyLong_AsSsize_t(py_basicsize);
24652 Py_DECREF(py_basicsize);
24654 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
24657 if ((
size_t)basicsize < size) {
24658 PyErr_Format(PyExc_ValueError,
24659 "%.200s.%.200s size changed, may indicate binary incompatibility. "
24660 "Expected %zd from C header, got %zd from PyObject",
24661 module_name, class_name, size, basicsize);
24664 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
24665 PyErr_Format(PyExc_ValueError,
24666 "%.200s.%.200s size changed, may indicate binary incompatibility. "
24667 "Expected %zd from C header, got %zd from PyObject",
24668 module_name, class_name, size, basicsize);
24671 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
24672 PyOS_snprintf(warning,
sizeof(warning),
24673 "%s.%s size changed, may indicate binary incompatibility. "
24674 "Expected %zd from C header, got %zd from PyObject",
24675 module_name, class_name, size, basicsize);
24676 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
24678 return (PyTypeObject *)result;
24680 Py_XDECREF(result);
24686 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
24687 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
24688 for (i=0; i < nbases; i++) {
24689 PyTypeObject *tmptype;
24690 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
24691 tmptype = Py_TYPE(tmp);
24692 #if PY_MAJOR_VERSION < 3
24693 if (tmptype == &PyClass_Type)
24697 metaclass = tmptype;
24700 if (PyType_IsSubtype(metaclass, tmptype))
24702 if (PyType_IsSubtype(tmptype, metaclass)) {
24703 metaclass = tmptype;
24706 PyErr_SetString(PyExc_TypeError,
24707 "metaclass conflict: "
24708 "the metaclass of a derived class "
24709 "must be a (non-strict) subclass "
24710 "of the metaclasses of all its bases");
24714 #if PY_MAJOR_VERSION < 3
24715 metaclass = &PyClass_Type;
24717 metaclass = &PyType_Type;
24720 Py_INCREF((PyObject*) metaclass);
24721 return (PyObject*) metaclass;
24725 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24726 PyObject* fake_module;
24727 PyTypeObject* cached_type = NULL;
24728 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
24729 if (!fake_module)
return NULL;
24730 Py_INCREF(fake_module);
24731 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24733 if (!PyType_Check((PyObject*)cached_type)) {
24734 PyErr_Format(PyExc_TypeError,
24735 "Shared Cython type %.200s is not a type object",
24739 if (cached_type->tp_basicsize != type->tp_basicsize) {
24740 PyErr_Format(PyExc_TypeError,
24741 "Shared Cython type %.200s has the wrong size, try recompiling",
24746 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
24748 if (PyType_Ready(type) < 0)
goto bad;
24749 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24752 cached_type = type;
24755 Py_DECREF(fake_module);
24756 return cached_type;
24758 Py_XDECREF(cached_type);
24759 cached_type = NULL;
24764 #include <structmember.h>
24766 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
24768 if (unlikely(op->func_doc == NULL)) {
24769 if (op->func.m_ml->ml_doc) {
24770 #if PY_MAJOR_VERSION >= 3
24771 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24773 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24775 if (unlikely(op->func_doc == NULL))
24778 Py_INCREF(Py_None);
24782 Py_INCREF(op->func_doc);
24783 return op->func_doc;
24786 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
24788 PyObject *tmp = op->func_doc;
24789 if (value == NULL) {
24793 op->func_doc = value;
24798 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
24800 if (unlikely(op->func_name == NULL)) {
24801 #if PY_MAJOR_VERSION >= 3
24802 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24804 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24806 if (unlikely(op->func_name == NULL))
24809 Py_INCREF(op->func_name);
24810 return op->func_name;
24813 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
24816 #if PY_MAJOR_VERSION >= 3
24817 if (unlikely(value == NULL || !PyUnicode_Check(value)))
24819 if (unlikely(value == NULL || !PyString_Check(value)))
24822 PyErr_SetString(PyExc_TypeError,
24823 "__name__ must be set to a string object");
24826 tmp = op->func_name;
24828 op->func_name = value;
24833 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
24835 Py_INCREF(op->func_qualname);
24836 return op->func_qualname;
24839 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
24842 #if PY_MAJOR_VERSION >= 3
24843 if (unlikely(value == NULL || !PyUnicode_Check(value)))
24845 if (unlikely(value == NULL || !PyString_Check(value)))
24848 PyErr_SetString(PyExc_TypeError,
24849 "__qualname__ must be set to a string object");
24852 tmp = op->func_qualname;
24854 op->func_qualname = value;
24859 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
24862 self = m->func_closure;
24869 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
24871 if (unlikely(op->func_dict == NULL)) {
24872 op->func_dict = PyDict_New();
24873 if (unlikely(op->func_dict == NULL))
24876 Py_INCREF(op->func_dict);
24877 return op->func_dict;
24880 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
24883 if (unlikely(value == NULL)) {
24884 PyErr_SetString(PyExc_TypeError,
24885 "function's dictionary may not be deleted");
24888 if (unlikely(!PyDict_Check(value))) {
24889 PyErr_SetString(PyExc_TypeError,
24890 "setting function's dictionary to a non-dict");
24893 tmp = op->func_dict;
24895 op->func_dict = value;
24900 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
24902 Py_INCREF(op->func_globals);
24903 return op->func_globals;
24906 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
24908 Py_INCREF(Py_None);
24912 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
24914 PyObject* result = (op->func_code) ? op->func_code : Py_None;
24919 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24921 PyObject *res = op->defaults_getter((PyObject *) op);
24922 if (unlikely(!res))
24924 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24925 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24926 Py_INCREF(op->defaults_tuple);
24927 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24928 Py_INCREF(op->defaults_kwdict);
24930 op->defaults_tuple = PySequence_ITEM(res, 0);
24931 if (unlikely(!op->defaults_tuple)) result = -1;
24933 op->defaults_kwdict = PySequence_ITEM(res, 1);
24934 if (unlikely(!op->defaults_kwdict)) result = -1;
24941 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
24945 }
else if (value != Py_None && !PyTuple_Check(value)) {
24946 PyErr_SetString(PyExc_TypeError,
24947 "__defaults__ must be set to a tuple object");
24951 tmp = op->defaults_tuple;
24952 op->defaults_tuple = value;
24957 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
24958 PyObject* result = op->defaults_tuple;
24959 if (unlikely(!result)) {
24960 if (op->defaults_getter) {
24961 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
24962 result = op->defaults_tuple;
24971 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
24975 }
else if (value != Py_None && !PyDict_Check(value)) {
24976 PyErr_SetString(PyExc_TypeError,
24977 "__kwdefaults__ must be set to a dict object");
24981 tmp = op->defaults_kwdict;
24982 op->defaults_kwdict = value;
24987 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
24988 PyObject* result = op->defaults_kwdict;
24989 if (unlikely(!result)) {
24990 if (op->defaults_getter) {
24991 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
24992 result = op->defaults_kwdict;
25001 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25003 if (!value || value == Py_None) {
25005 }
else if (!PyDict_Check(value)) {
25006 PyErr_SetString(PyExc_TypeError,
25007 "__annotations__ must be set to a dict object");
25011 tmp = op->func_annotations;
25012 op->func_annotations = value;
25017 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25018 PyObject* result = op->func_annotations;
25019 if (unlikely(!result)) {
25020 result = PyDict_New();
25021 if (unlikely(!result))
return NULL;
25022 op->func_annotations = result;
25027 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25028 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25029 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25030 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25031 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25032 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25033 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25034 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25035 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25036 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25037 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25038 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25039 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25040 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25041 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25042 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25043 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25044 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25045 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25048 static PyMemberDef __pyx_CyFunction_members[] = {
25049 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25053 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25055 #if PY_MAJOR_VERSION >= 3
25056 Py_INCREF(m->func_qualname);
25057 return m->func_qualname;
25059 return PyString_FromString(m->func.m_ml->ml_name);
25062 static PyMethodDef __pyx_CyFunction_methods[] = {
25063 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25066 #if PY_VERSION_HEX < 0x030500A0
25067 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25069 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25071 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
25072 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25073 if (unlikely(op == NULL))
25076 __Pyx_CyFunction_weakreflist(op) = NULL;
25077 op->func.m_ml = ml;
25078 op->func.m_self = (PyObject *) op;
25079 Py_XINCREF(closure);
25080 op->func_closure = closure;
25081 Py_XINCREF(module);
25082 op->func.m_module = module;
25083 op->func_dict = NULL;
25084 op->func_name = NULL;
25085 Py_INCREF(qualname);
25086 op->func_qualname = qualname;
25087 op->func_doc = NULL;
25088 op->func_classobj = NULL;
25089 op->func_globals = globals;
25090 Py_INCREF(op->func_globals);
25092 op->func_code = code;
25093 op->defaults_pyobjects = 0;
25094 op->defaults_size = 0;
25095 op->defaults = NULL;
25096 op->defaults_tuple = NULL;
25097 op->defaults_kwdict = NULL;
25098 op->defaults_getter = NULL;
25099 op->func_annotations = NULL;
25100 return (PyObject *) op;
25103 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25105 Py_CLEAR(m->func_closure);
25106 Py_CLEAR(m->func.m_module);
25107 Py_CLEAR(m->func_dict);
25108 Py_CLEAR(m->func_name);
25109 Py_CLEAR(m->func_qualname);
25110 Py_CLEAR(m->func_doc);
25111 Py_CLEAR(m->func_globals);
25112 Py_CLEAR(m->func_code);
25113 Py_CLEAR(m->func_classobj);
25114 Py_CLEAR(m->defaults_tuple);
25115 Py_CLEAR(m->defaults_kwdict);
25116 Py_CLEAR(m->func_annotations);
25118 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25120 for (i = 0; i < m->defaults_pyobjects; i++)
25121 Py_XDECREF(pydefaults[i]);
25122 PyObject_Free(m->defaults);
25123 m->defaults = NULL;
25127 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25129 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25130 PyObject_ClearWeakRefs((PyObject *) m);
25131 __Pyx_CyFunction_clear(m);
25132 PyObject_GC_Del(m);
25134 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25136 PyObject_GC_UnTrack(m);
25137 __Pyx__CyFunction_dealloc(m);
25139 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
25141 Py_VISIT(m->func_closure);
25142 Py_VISIT(m->func.m_module);
25143 Py_VISIT(m->func_dict);
25144 Py_VISIT(m->func_name);
25145 Py_VISIT(m->func_qualname);
25146 Py_VISIT(m->func_doc);
25147 Py_VISIT(m->func_globals);
25148 Py_VISIT(m->func_code);
25149 Py_VISIT(m->func_classobj);
25150 Py_VISIT(m->defaults_tuple);
25151 Py_VISIT(m->defaults_kwdict);
25153 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25155 for (i = 0; i < m->defaults_pyobjects; i++)
25156 Py_VISIT(pydefaults[i]);
25160 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25162 #if PY_MAJOR_VERSION < 3
25163 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25164 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25168 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25170 type = (PyObject *)(Py_TYPE(obj));
25171 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25173 if (obj == Py_None)
25176 return __Pyx_PyMethod_New(func, obj, type);
25179 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25181 #if PY_MAJOR_VERSION >= 3
25182 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
25183 op->func_qualname, (
void *)op);
25185 return PyString_FromFormat(
"<cyfunction %s at %p>",
25186 PyString_AsString(op->func_qualname), (
void *)op);
25189 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
25190 PyCFunctionObject*
f = (PyCFunctionObject*)func;
25191 PyCFunction meth =
f->m_ml->ml_meth;
25193 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25195 if (likely(kw == NULL || PyDict_Size(kw) == 0))
25196 return (*meth)(
self, arg);
25198 case METH_VARARGS | METH_KEYWORDS:
25199 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
25201 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25202 size = PyTuple_GET_SIZE(arg);
25203 if (likely(size == 0))
25204 return (*meth)(
self, NULL);
25205 PyErr_Format(PyExc_TypeError,
25206 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25207 f->m_ml->ml_name, size);
25212 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25213 size = PyTuple_GET_SIZE(arg);
25214 if (likely(size == 1)) {
25215 PyObject *result, *arg0;
25216 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25217 arg0 = PyTuple_GET_ITEM(arg, 0);
25219 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
25221 result = (*meth)(
self, arg0);
25222 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25227 PyErr_Format(PyExc_TypeError,
25228 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25229 f->m_ml->ml_name, size);
25234 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
25235 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25236 "longer supported!");
25239 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
25243 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25244 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25246 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25248 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25249 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25251 PyObject *new_args;
25253 argc = PyTuple_GET_SIZE(args);
25254 new_args = PyTuple_GetSlice(args, 1, argc);
25255 if (unlikely(!new_args))
25257 self = PyTuple_GetItem(args, 0);
25258 if (unlikely(!
self)) {
25259 Py_DECREF(new_args);
25260 PyErr_Format(PyExc_TypeError,
25261 "unbound method %.200S() needs an argument",
25262 cyfunc->func_qualname);
25265 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
25266 Py_DECREF(new_args);
25268 result = __Pyx_CyFunction_Call(func, args, kw);
25272 static PyTypeObject __pyx_CyFunctionType_type = {
25273 PyVarObject_HEAD_INIT(0, 0)
25274 "cython_function_or_method",
25275 sizeof(__pyx_CyFunctionObject),
25277 (destructor) __Pyx_CyFunction_dealloc,
25281 #if PY_MAJOR_VERSION < 3
25286 (reprfunc) __Pyx_CyFunction_repr,
25291 __Pyx_CyFunction_CallAsMethod,
25296 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25298 (traverseproc) __Pyx_CyFunction_traverse,
25299 (inquiry) __Pyx_CyFunction_clear,
25301 #
if PY_VERSION_HEX < 0x030500A0
25302 offsetof(__pyx_CyFunctionObject, func_weakreflist),
25304 offsetof(PyCFunctionObject, m_weakreflist),
25308 __pyx_CyFunction_methods,
25309 __pyx_CyFunction_members,
25310 __pyx_CyFunction_getsets,
25313 __Pyx_CyFunction_descr_get,
25315 offsetof(__pyx_CyFunctionObject, func_dict),
25328 #if PY_VERSION_HEX >= 0x030400a1
25331 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25334 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25337 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
25341 static int __pyx_CyFunction_init(
void) {
25342 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25343 if (unlikely(__pyx_CyFunctionType == NULL)) {
25348 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
25349 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25350 m->defaults = PyObject_Malloc(size);
25351 if (unlikely(!m->defaults))
25352 return PyErr_NoMemory();
25353 memset(m->defaults, 0, size);
25354 m->defaults_pyobjects = pyobjects;
25355 m->defaults_size = size;
25356 return m->defaults;
25358 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25359 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25360 m->defaults_tuple = tuple;
25363 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25364 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25365 m->defaults_kwdict = dict;
25368 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25369 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25370 m->func_annotations = dict;
25375 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
25376 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25377 PyObject *op = __Pyx_CyFunction_Init(
25378 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25379 ml, flags, qualname, closure, module, globals, code
25382 PyObject_GC_Track(op);
25388 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
25389 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
25392 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
25394 PyObject *pargs = PyTuple_Pack(2, name, bases);
25395 if (unlikely(!pargs)) {
25399 ns = PyObject_Call(prep, pargs, mkw);
25403 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
25413 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_module, modname) < 0))
goto bad;
25414 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
25415 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_n_s_doc, doc) < 0))
goto bad;
25421 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
25422 PyObject *dict, PyObject *mkw,
25423 int calculate_metaclass,
int allow_py2_metaclass) {
25424 PyObject *result, *margs;
25425 PyObject *owned_metaclass = NULL;
25426 if (allow_py2_metaclass) {
25427 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
25428 if (owned_metaclass) {
25429 metaclass = owned_metaclass;
25430 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
25436 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
25437 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
25438 Py_XDECREF(owned_metaclass);
25439 if (unlikely(!metaclass))
25441 owned_metaclass = metaclass;
25443 margs = PyTuple_Pack(3, name, bases, dict);
25444 if (unlikely(!margs)) {
25447 result = PyObject_Call(metaclass, margs, mkw);
25450 Py_XDECREF(owned_metaclass);
25455 #ifndef CYTHON_CLINE_IN_TRACEBACK
25456 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
25457 PyObject *use_cline;
25458 PyObject *ptype, *pvalue, *ptraceback;
25459 #if CYTHON_COMPILING_IN_CPYTHON
25460 PyObject **cython_runtime_dict;
25462 if (unlikely(!__pyx_cython_runtime)) {
25465 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25466 #if CYTHON_COMPILING_IN_CPYTHON
25467 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25468 if (likely(cython_runtime_dict)) {
25469 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25470 use_cline, *cython_runtime_dict,
25471 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25475 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25476 if (use_cline_obj) {
25477 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25478 Py_DECREF(use_cline_obj);
25486 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25488 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25491 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25497 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25498 int start = 0, mid = 0, end = count - 1;
25499 if (end >= 0 && code_line > entries[end].code_line) {
25502 while (start < end) {
25503 mid = start + (end - start) / 2;
25504 if (code_line < entries[mid].code_line) {
25506 }
else if (code_line > entries[mid].code_line) {
25512 if (code_line <= entries[mid].code_line) {
25518 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25519 PyCodeObject* code_object;
25521 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25524 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25525 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
25528 code_object = __pyx_code_cache.entries[
pos].code_object;
25529 Py_INCREF(code_object);
25530 return code_object;
25532 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25534 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25535 if (unlikely(!code_line)) {
25538 if (unlikely(!entries)) {
25539 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25540 if (likely(entries)) {
25541 __pyx_code_cache.entries = entries;
25542 __pyx_code_cache.max_count = 64;
25543 __pyx_code_cache.count = 1;
25544 entries[0].code_line = code_line;
25545 entries[0].code_object = code_object;
25546 Py_INCREF(code_object);
25550 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25551 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
25552 PyCodeObject* tmp = entries[
pos].code_object;
25553 entries[
pos].code_object = code_object;
25557 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25558 int new_max = __pyx_code_cache.max_count + 64;
25559 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25560 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
25561 if (unlikely(!entries)) {
25564 __pyx_code_cache.entries = entries;
25565 __pyx_code_cache.max_count = new_max;
25567 for (i=__pyx_code_cache.count; i>
pos; i--) {
25568 entries[i] = entries[i-1];
25570 entries[
pos].code_line = code_line;
25571 entries[
pos].code_object = code_object;
25572 __pyx_code_cache.count++;
25573 Py_INCREF(code_object);
25577 #include "compile.h"
25578 #include "frameobject.h"
25579 #include "traceback.h"
25580 #if PY_VERSION_HEX >= 0x030b00a6
25581 #ifndef Py_BUILD_CORE
25582 #define Py_BUILD_CORE 1
25584 #include "internal/pycore_frame.h"
25586 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25587 const char *funcname,
int c_line,
25588 int py_line,
const char *filename) {
25589 PyCodeObject *py_code = NULL;
25590 PyObject *py_funcname = NULL;
25591 #if PY_MAJOR_VERSION < 3
25592 PyObject *py_srcfile = NULL;
25593 py_srcfile = PyString_FromString(filename);
25594 if (!py_srcfile)
goto bad;
25597 #if PY_MAJOR_VERSION < 3
25598 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25599 if (!py_funcname)
goto bad;
25601 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25602 if (!py_funcname)
goto bad;
25603 funcname = PyUnicode_AsUTF8(py_funcname);
25604 if (!funcname)
goto bad;
25608 #if PY_MAJOR_VERSION < 3
25609 py_funcname = PyString_FromString(funcname);
25610 if (!py_funcname)
goto bad;
25613 #if PY_MAJOR_VERSION < 3
25614 py_code = __Pyx_PyCode_New(
25631 Py_DECREF(py_srcfile);
25633 py_code = PyCode_NewEmpty(filename, funcname, py_line);
25635 Py_XDECREF(py_funcname);
25638 Py_XDECREF(py_funcname);
25639 #if PY_MAJOR_VERSION < 3
25640 Py_XDECREF(py_srcfile);
25644 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
25645 int py_line,
const char *filename) {
25646 PyCodeObject *py_code = 0;
25647 PyFrameObject *py_frame = 0;
25648 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25649 PyObject *ptype, *pvalue, *ptraceback;
25651 c_line = __Pyx_CLineForTraceback(tstate, c_line);
25653 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25655 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25656 py_code = __Pyx_CreateCodeObjectForTraceback(
25657 funcname, c_line, py_line, filename);
25662 Py_XDECREF(pvalue);
25663 Py_XDECREF(ptraceback);
25666 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25667 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25669 py_frame = PyFrame_New(
25675 if (!py_frame)
goto bad;
25676 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25677 PyTraceBack_Here(py_frame);
25679 Py_XDECREF(py_code);
25680 Py_XDECREF(py_frame);
25683 #if PY_MAJOR_VERSION < 3
25684 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
25685 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
25686 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
25687 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
25688 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
25691 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
25692 PyObject *obj = view->obj;
25694 if (PyObject_CheckBuffer(obj)) {
25695 PyBuffer_Release(view);
25707 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
25709 int i, index, step, start;
25710 Py_ssize_t itemsize = mvs.memview->view.itemsize;
25711 if (order ==
'F') {
25718 for (i = 0; i < ndim; i++) {
25719 index = start + step * i;
25720 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
25722 itemsize *= mvs.shape[index];
25729 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
25730 void **out_start,
void **out_end,
25731 int ndim,
size_t itemsize)
25735 start = end = slice->data;
25736 for (i = 0; i < ndim; i++) {
25737 Py_ssize_t stride = slice->strides[i];
25738 Py_ssize_t extent = slice->shape[i];
25740 *out_start = *out_end = start;
25744 end += stride * (extent - 1);
25746 start += stride * (extent - 1);
25749 *out_start = start;
25750 *out_end = end + itemsize;
25753 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
25754 __Pyx_memviewslice *slice2,
25755 int ndim,
size_t itemsize)
25757 void *start1, *end1, *start2, *end2;
25758 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
25759 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
25760 return (start1 < end2) && (start2 < end1);
25764 static CYTHON_INLINE PyObject *
25765 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
25768 #if PY_VERSION_HEX >= 0x02070000
25769 cobj = PyCapsule_New(p, sig, NULL);
25771 cobj = PyCObject_FromVoidPtr(p, NULL);
25777 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25778 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25779 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25780 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25781 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25783 func_type value = func_value;\
25784 if (sizeof(target_type) < sizeof(func_type)) {\
25785 if (unlikely(value != (func_type) (target_type) value)) {\
25786 func_type zero = 0;\
25787 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25788 return (target_type) -1;\
25789 if (is_unsigned && unlikely(value < zero))\
25790 goto raise_neg_overflow;\
25792 goto raise_overflow;\
25795 return (target_type) value;\
25799 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
25805 S.u32 = 0x01020304;
25806 return S.u8[0] == 4;
25810 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
25811 __Pyx_BufFmt_StackElem* stack,
25812 __Pyx_TypeInfo* type) {
25813 stack[0].field = &ctx->root;
25814 stack[0].parent_offset = 0;
25815 ctx->root.type = type;
25816 ctx->root.name =
"buffer dtype";
25817 ctx->root.offset = 0;
25819 ctx->head->field = &ctx->root;
25820 ctx->fmt_offset = 0;
25821 ctx->head->parent_offset = 0;
25822 ctx->new_packmode =
'@';
25823 ctx->enc_packmode =
'@';
25824 ctx->new_count = 1;
25825 ctx->enc_count = 0;
25827 ctx->is_complex = 0;
25828 ctx->is_valid_array = 0;
25829 ctx->struct_alignment = 0;
25830 while (type->typegroup ==
'S') {
25832 ctx->head->field = type->fields;
25833 ctx->head->parent_offset = 0;
25834 type = type->fields->type;
25837 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
25839 const char* t = *ts;
25840 if (*t < '0' || *t >
'9') {
25843 count = *t++ -
'0';
25844 while (*t >=
'0' && *t <=
'9') {
25846 count += *t++ -
'0';
25852 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
25853 int number = __Pyx_BufFmt_ParseNumber(ts);
25855 PyErr_Format(PyExc_ValueError,\
25856 "Does not understand character buffer dtype format string ('%c')", **ts);
25859 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
25860 PyErr_Format(PyExc_ValueError,
25861 "Unexpected format string character: '%c'", ch);
25863 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
25865 case '?':
return "'bool'";
25866 case 'c':
return "'char'";
25867 case 'b':
return "'signed char'";
25868 case 'B':
return "'unsigned char'";
25869 case 'h':
return "'short'";
25870 case 'H':
return "'unsigned short'";
25871 case 'i':
return "'int'";
25872 case 'I':
return "'unsigned int'";
25873 case 'l':
return "'long'";
25874 case 'L':
return "'unsigned long'";
25875 case 'q':
return "'long long'";
25876 case 'Q':
return "'unsigned long long'";
25877 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
25878 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
25879 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
25880 case 'T':
return "a struct";
25881 case 'O':
return "Python object";
25882 case 'P':
return "a pointer";
25883 case 's':
case 'p':
return "a string";
25884 case 0:
return "end";
25885 default:
return "unparseable format string";
25888 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
25890 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25891 case 'h':
case 'H':
return 2;
25892 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
25893 case 'q':
case 'Q':
return 8;
25894 case 'f':
return (is_complex ? 8 : 4);
25895 case 'd':
return (is_complex ? 16 : 8);
25897 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
25900 case 'O':
case 'P':
return sizeof(
void*);
25902 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25906 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
25908 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25909 case 'h':
case 'H':
return sizeof(short);
25910 case 'i':
case 'I':
return sizeof(int);
25911 case 'l':
case 'L':
return sizeof(long);
25912 #ifdef HAVE_LONG_LONG
25913 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
25915 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
25916 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
25917 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
25918 case 'O':
case 'P':
return sizeof(
void*);
25920 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25925 typedef struct {
char c;
short x; } __Pyx_st_short;
25926 typedef struct {
char c;
int x; } __Pyx_st_int;
25927 typedef struct {
char c;
long x; } __Pyx_st_long;
25928 typedef struct {
char c;
float x; } __Pyx_st_float;
25929 typedef struct {
char c;
double x; } __Pyx_st_double;
25930 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
25931 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
25932 #ifdef HAVE_LONG_LONG
25933 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
25935 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
25937 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25938 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
25939 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
25940 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
25941 #ifdef HAVE_LONG_LONG
25942 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
25944 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
25945 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
25946 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
25947 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
25949 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25957 typedef struct {
short x;
char c; } __Pyx_pad_short;
25958 typedef struct {
int x;
char c; } __Pyx_pad_int;
25959 typedef struct {
long x;
char c; } __Pyx_pad_long;
25960 typedef struct {
float x;
char c; } __Pyx_pad_float;
25961 typedef struct {
double x;
char c; } __Pyx_pad_double;
25962 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
25963 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
25964 #ifdef HAVE_LONG_LONG
25965 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
25967 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
25969 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25970 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
25971 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
25972 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
25973 #ifdef HAVE_LONG_LONG
25974 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
25976 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
25977 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
25978 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
25979 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
25981 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25985 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
25989 case 'b':
case 'h':
case 'i':
25990 case 'l':
case 'q':
case 's':
case 'p':
25992 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
25994 case 'f':
case 'd':
case 'g':
25995 return (is_complex ?
'C' :
'R');
26001 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26006 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26007 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26008 const char* expected;
26010 if (ctx->head == NULL) {
26014 expected = ctx->head->field->type->name;
26017 PyErr_Format(PyExc_ValueError,
26018 "Buffer dtype mismatch, expected %s%s%s but got %s",
26019 quote, expected, quote,
26020 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26022 __Pyx_StructField* field = ctx->head->field;
26023 __Pyx_StructField* parent = (ctx->head - 1)->field;
26024 PyErr_Format(PyExc_ValueError,
26025 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26026 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26027 parent->type->name, field->name);
26030 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26032 size_t size, offset, arraysize = 1;
26033 if (ctx->enc_type == 0)
return 0;
26034 if (ctx->head->field->type->arraysize[0]) {
26036 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
26037 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26039 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26040 PyErr_Format(PyExc_ValueError,
26041 "Expected a dimension of size %zu, got %zu",
26042 ctx->head->field->type->arraysize[0], ctx->enc_count);
26046 if (!ctx->is_valid_array) {
26047 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
26048 ctx->head->field->type->ndim, ndim);
26051 for (i = 0; i < ctx->head->field->type->ndim; i++) {
26052 arraysize *= ctx->head->field->type->arraysize[i];
26054 ctx->is_valid_array = 0;
26055 ctx->enc_count = 1;
26057 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26059 __Pyx_StructField* field = ctx->head->field;
26060 __Pyx_TypeInfo* type = field->type;
26061 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
26062 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26064 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26066 if (ctx->enc_packmode ==
'@') {
26067 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26068 size_t align_mod_offset;
26069 if (align_at == 0)
return -1;
26070 align_mod_offset = ctx->fmt_offset % align_at;
26071 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26072 if (ctx->struct_alignment == 0)
26073 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26076 if (type->size != size || type->typegroup != group) {
26077 if (type->typegroup ==
'C' && type->fields != NULL) {
26078 size_t parent_offset = ctx->head->parent_offset + field->offset;
26080 ctx->head->field = type->fields;
26081 ctx->head->parent_offset = parent_offset;
26084 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
26086 __Pyx_BufFmt_RaiseExpected(ctx);
26090 offset = ctx->head->parent_offset + field->offset;
26091 if (ctx->fmt_offset != offset) {
26092 PyErr_Format(PyExc_ValueError,
26093 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
26094 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26097 ctx->fmt_offset += size;
26099 ctx->fmt_offset += (arraysize - 1) * size;
26102 if (field == &ctx->root) {
26104 if (ctx->enc_count != 0) {
26105 __Pyx_BufFmt_RaiseExpected(ctx);
26110 ctx->head->field = ++field;
26111 if (field->type == NULL) {
26113 field = ctx->head->field;
26115 }
else if (field->type->typegroup ==
'S') {
26116 size_t parent_offset = ctx->head->parent_offset + field->offset;
26117 if (field->type->fields->type == NULL)
continue;
26118 field = field->type->fields;
26120 ctx->head->field = field;
26121 ctx->head->parent_offset = parent_offset;
26127 }
while (ctx->enc_count);
26129 ctx->is_complex = 0;
26133 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
26135 const char *ts = *tsp;
26136 int i = 0,
number, ndim;
26138 if (ctx->new_count != 1) {
26139 PyErr_SetString(PyExc_ValueError,
26140 "Cannot handle repeated arrays in format string");
26143 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26144 ndim = ctx->head->field->type->ndim;
26145 while (*ts && *ts !=
')') {
26147 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
26150 number = __Pyx_BufFmt_ExpectNumber(&ts);
26151 if (
number == -1)
return NULL;
26152 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
26153 return PyErr_Format(PyExc_ValueError,
26154 "Expected a dimension of size %zu, got %d",
26155 ctx->head->field->type->arraysize[i],
number);
26156 if (*ts !=
',' && *ts !=
')')
26157 return PyErr_Format(PyExc_ValueError,
26158 "Expected a comma in format string, got '%c'", *ts);
26159 if (*ts ==
',') ts++;
26163 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
26164 ctx->head->field->type->ndim, i);
26166 PyErr_SetString(PyExc_ValueError,
26167 "Unexpected end of format string, expected ')'");
26170 ctx->is_valid_array = 1;
26171 ctx->new_count = 1;
26175 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
26180 if (ctx->enc_type != 0 && ctx->head == NULL) {
26181 __Pyx_BufFmt_RaiseExpected(ctx);
26184 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26185 if (ctx->head != NULL) {
26186 __Pyx_BufFmt_RaiseExpected(ctx);
26196 if (!__Pyx_Is_Little_Endian()) {
26197 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
26200 ctx->new_packmode =
'=';
26205 if (__Pyx_Is_Little_Endian()) {
26206 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
26209 ctx->new_packmode =
'=';
26215 ctx->new_packmode = *ts++;
26219 const char* ts_after_sub;
26220 size_t i, struct_count = ctx->new_count;
26221 size_t struct_alignment = ctx->struct_alignment;
26222 ctx->new_count = 1;
26225 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
26228 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26230 ctx->enc_count = 0;
26231 ctx->struct_alignment = 0;
26234 for (i = 0; i != struct_count; ++i) {
26235 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26236 if (!ts_after_sub)
return NULL;
26239 if (struct_alignment) ctx->struct_alignment = struct_alignment;
26244 size_t alignment = ctx->struct_alignment;
26246 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26248 if (alignment && ctx->fmt_offset % alignment) {
26249 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26254 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26255 ctx->fmt_offset += ctx->new_count;
26256 ctx->new_count = 1;
26257 ctx->enc_count = 0;
26259 ctx->enc_packmode = ctx->new_packmode;
26265 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
26266 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
26269 CYTHON_FALLTHROUGH;
26270 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
26271 case 'l':
case 'L':
case 'q':
case 'Q':
26272 case 'f':
case 'd':
case 'g':
26273 case 'O':
case 'p':
26274 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
26275 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
26276 ctx->enc_count += ctx->new_count;
26277 ctx->new_count = 1;
26282 CYTHON_FALLTHROUGH;
26284 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26285 ctx->enc_count = ctx->new_count;
26286 ctx->enc_packmode = ctx->new_packmode;
26287 ctx->enc_type = *ts;
26288 ctx->is_complex = got_Z;
26290 ctx->new_count = 1;
26295 while(*ts !=
':') ++ts;
26299 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
26303 int number = __Pyx_BufFmt_ExpectNumber(&ts);
26304 if (
number == -1)
return NULL;
26305 ctx->new_count = (size_t)
number;
26313 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26320 if (a->size != b->size || a->typegroup != b->typegroup ||
26321 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26322 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
26323 return a->size == b->size;
26329 for (i = 0; i < a->ndim; i++)
26330 if (a->arraysize[i] != b->arraysize[i])
26333 if (a->typegroup ==
'S') {
26334 if (a->flags != b->flags)
26336 if (a->fields || b->fields) {
26337 if (!(a->fields && b->fields))
26339 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26340 __Pyx_StructField *field_a = a->fields + i;
26341 __Pyx_StructField *field_b = b->fields + i;
26342 if (field_a->offset != field_b->offset ||
26343 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26346 return !a->fields[i].type && !b->fields[i].type;
26354 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
26356 if (buf->shape[dim] <= 1)
26358 if (buf->strides) {
26359 if (spec & __Pyx_MEMVIEW_CONTIG) {
26360 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26361 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
26362 PyErr_Format(PyExc_ValueError,
26363 "Buffer is not indirectly contiguous "
26364 "in dimension %d.", dim);
26367 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
26368 PyErr_SetString(PyExc_ValueError,
26369 "Buffer and memoryview are not contiguous "
26370 "in the same dimension.");
26374 if (spec & __Pyx_MEMVIEW_FOLLOW) {
26375 Py_ssize_t stride = buf->strides[dim];
26378 if (unlikely(stride < buf->itemsize)) {
26379 PyErr_SetString(PyExc_ValueError,
26380 "Buffer and memoryview are not contiguous "
26381 "in the same dimension.");
26386 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
26387 PyErr_Format(PyExc_ValueError,
26388 "C-contiguous buffer is not contiguous in "
26389 "dimension %d", dim);
26391 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
26392 PyErr_Format(PyExc_ValueError,
26393 "C-contiguous buffer is not indirect in "
26394 "dimension %d", dim);
26396 }
else if (unlikely(buf->suboffsets)) {
26397 PyErr_SetString(PyExc_ValueError,
26398 "Buffer exposes suboffsets but no strides");
26407 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
26409 if (spec & __Pyx_MEMVIEW_DIRECT) {
26410 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
26411 PyErr_Format(PyExc_ValueError,
26412 "Buffer not compatible with direct access "
26413 "in dimension %d.", dim);
26417 if (spec & __Pyx_MEMVIEW_PTR) {
26418 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
26419 PyErr_Format(PyExc_ValueError,
26420 "Buffer is not indirectly accessible "
26421 "in dimension %d.", dim);
26430 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
26433 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26434 Py_ssize_t stride = 1;
26435 for (i = 0; i < ndim; i++) {
26436 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26437 PyErr_SetString(PyExc_ValueError,
26438 "Buffer not fortran contiguous.");
26441 stride = stride * buf->shape[i];
26443 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26444 Py_ssize_t stride = 1;
26445 for (i = ndim - 1; i >- 1; i--) {
26446 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26447 PyErr_SetString(PyExc_ValueError,
26448 "Buffer not C contiguous.");
26451 stride = stride * buf->shape[i];
26458 static int __Pyx_ValidateAndInit_memviewslice(
26463 __Pyx_TypeInfo *dtype,
26464 __Pyx_BufFmt_StackElem stack[],
26465 __Pyx_memviewslice *memviewslice,
26466 PyObject *original_obj)
26468 struct __pyx_memoryview_obj *memview, *new_memview;
26469 __Pyx_RefNannyDeclarations
26471 int i, spec = 0, retval = -1;
26472 __Pyx_BufFmt_Context ctx;
26473 int from_memoryview = __pyx_memoryview_check(original_obj);
26474 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
26475 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
26476 original_obj)->typeinfo)) {
26477 memview = (
struct __pyx_memoryview_obj *) original_obj;
26478 new_memview = NULL;
26480 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26481 original_obj, buf_flags, 0, dtype);
26482 new_memview = memview;
26483 if (unlikely(!memview))
26486 buf = &memview->view;
26487 if (unlikely(buf->ndim != ndim)) {
26488 PyErr_Format(PyExc_ValueError,
26489 "Buffer has wrong number of dimensions (expected %d, got %d)",
26494 __Pyx_BufFmt_Init(&ctx, stack, dtype);
26495 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
26497 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
26498 PyErr_Format(PyExc_ValueError,
26499 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
26500 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
26502 (buf->itemsize > 1) ?
"s" :
"",
26505 (dtype->size > 1) ?
"s" :
"");
26508 if (buf->len > 0) {
26509 for (i = 0; i < ndim; i++) {
26510 spec = axes_specs[i];
26511 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
26513 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26516 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26519 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26520 new_memview != NULL) == -1)) {
26526 Py_XDECREF(new_memview);
26529 __Pyx_RefNannyFinishContext();
26534 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj,
int writable_flag) {
26535 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26536 __Pyx_BufFmt_StackElem stack[1];
26537 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26539 if (obj == Py_None) {
26540 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26543 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26544 PyBUF_RECORDS_RO | writable_flag, 1,
26545 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
26547 if (unlikely(retcode == -1))
26551 result.memview = NULL;
26552 result.data = NULL;
26557 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj,
int writable_flag) {
26558 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26559 __Pyx_BufFmt_StackElem stack[1];
26560 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26562 if (obj == Py_None) {
26563 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26566 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26567 PyBUF_RECORDS_RO | writable_flag, 1,
26568 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
26570 if (unlikely(retcode == -1))
26574 result.memview = NULL;
26575 result.data = NULL;
26580 #if CYTHON_CCOMPLEX
26582 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26583 return ::std::complex< float >(x, y);
26586 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26587 return x + y*(__pyx_t_float_complex)_Complex_I;
26591 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26592 __pyx_t_float_complex
z;
26600 #if CYTHON_CCOMPLEX
26602 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26603 return (a.real == b.real) && (a.imag == b.imag);
26605 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26606 __pyx_t_float_complex
z;
26607 z.real = a.real + b.real;
26608 z.imag = a.imag + b.imag;
26611 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26612 __pyx_t_float_complex
z;
26613 z.real = a.real - b.real;
26614 z.imag = a.imag - b.imag;
26617 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26618 __pyx_t_float_complex
z;
26619 z.real = a.real * b.real - a.imag * b.imag;
26620 z.imag = a.real * b.imag + a.imag * b.real;
26624 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26626 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26627 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
26628 if (b.real == 0 && b.imag == 0) {
26629 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26631 float r = b.imag / b.real;
26632 float s = (float)(1.0) / (b.real + b.imag *
r);
26633 return __pyx_t_float_complex_from_parts(
26634 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
26637 float r = b.real / b.imag;
26638 float s = (float)(1.0) / (b.imag + b.real *
r);
26639 return __pyx_t_float_complex_from_parts(
26640 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
26644 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26646 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26648 float denom = b.real * b.real + b.imag * b.imag;
26649 return __pyx_t_float_complex_from_parts(
26650 (a.real * b.real + a.imag * b.imag) / denom,
26651 (a.imag * b.real - a.real * b.imag) / denom);
26655 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26656 __pyx_t_float_complex
z;
26661 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26662 return (a.real == 0) && (a.imag == 0);
26664 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26665 __pyx_t_float_complex
z;
26671 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
26672 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26673 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
26675 return hypotf(
z.real,
z.imag);
26678 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26679 __pyx_t_float_complex
z;
26680 float r, lnr, theta, z_r, z_theta;
26681 if (b.imag == 0 && b.real == (
int)b.real) {
26683 float denom = a.real * a.real + a.imag * a.imag;
26684 a.real = a.real / denom;
26685 a.imag = -a.imag / denom;
26688 switch ((
int)b.real) {
26696 return __Pyx_c_prod_float(a, a);
26698 z = __Pyx_c_prod_float(a, a);
26699 return __Pyx_c_prod_float(
z, a);
26701 z = __Pyx_c_prod_float(a, a);
26702 return __Pyx_c_prod_float(
z,
z);
26708 }
else if (b.imag == 0) {
26709 z.real = powf(a.real, b.real);
26712 }
else if (a.real > 0) {
26717 theta = atan2f(0.0, -1.0);
26720 r = __Pyx_c_abs_float(a);
26721 theta = atan2f(a.imag, a.real);
26724 z_r = expf(lnr * b.real - theta * b.imag);
26725 z_theta = theta * b.real + lnr * b.imag;
26726 z.real = z_r * cosf(z_theta);
26727 z.imag = z_r * sinf(z_theta);
26734 #if CYTHON_CCOMPLEX
26736 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26737 return ::std::complex< double >(x, y);
26740 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26741 return x + y*(__pyx_t_double_complex)_Complex_I;
26745 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26746 __pyx_t_double_complex
z;
26754 #if CYTHON_CCOMPLEX
26756 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26757 return (a.real == b.real) && (a.imag == b.imag);
26759 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26760 __pyx_t_double_complex
z;
26761 z.real = a.real + b.real;
26762 z.imag = a.imag + b.imag;
26765 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26766 __pyx_t_double_complex
z;
26767 z.real = a.real - b.real;
26768 z.imag = a.imag - b.imag;
26771 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26772 __pyx_t_double_complex
z;
26773 z.real = a.real * b.real - a.imag * b.imag;
26774 z.imag = a.real * b.imag + a.imag * b.real;
26778 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26780 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26781 }
else if (fabs(b.real) >= fabs(b.imag)) {
26782 if (b.real == 0 && b.imag == 0) {
26783 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26785 double r = b.imag / b.real;
26786 double s = (double)(1.0) / (b.real + b.imag *
r);
26787 return __pyx_t_double_complex_from_parts(
26788 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
26791 double r = b.real / b.imag;
26792 double s = (double)(1.0) / (b.imag + b.real *
r);
26793 return __pyx_t_double_complex_from_parts(
26794 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
26798 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26800 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26802 double denom = b.real * b.real + b.imag * b.imag;
26803 return __pyx_t_double_complex_from_parts(
26804 (a.real * b.real + a.imag * b.imag) / denom,
26805 (a.imag * b.real - a.real * b.imag) / denom);
26809 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26810 __pyx_t_double_complex
z;
26815 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26816 return (a.real == 0) && (a.imag == 0);
26818 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26819 __pyx_t_double_complex
z;
26825 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
26826 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26827 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
26829 return hypot(
z.real,
z.imag);
26832 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26833 __pyx_t_double_complex
z;
26834 double r, lnr, theta, z_r, z_theta;
26835 if (b.imag == 0 && b.real == (
int)b.real) {
26837 double denom = a.real * a.real + a.imag * a.imag;
26838 a.real = a.real / denom;
26839 a.imag = -a.imag / denom;
26842 switch ((
int)b.real) {
26850 return __Pyx_c_prod_double(a, a);
26852 z = __Pyx_c_prod_double(a, a);
26853 return __Pyx_c_prod_double(
z, a);
26855 z = __Pyx_c_prod_double(a, a);
26856 return __Pyx_c_prod_double(
z,
z);
26862 }
else if (b.imag == 0) {
26863 z.real = pow(a.real, b.real);
26866 }
else if (a.real > 0) {
26871 theta = atan2(0.0, -1.0);
26874 r = __Pyx_c_abs_double(a);
26875 theta = atan2(a.imag, a.real);
26878 z_r = exp(lnr * b.real - theta * b.imag);
26879 z_theta = theta * b.real + lnr * b.imag;
26880 z.real = z_r * cos(z_theta);
26881 z.imag = z_r * sin(z_theta);
26888 static __Pyx_memviewslice
26889 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
26890 const char *mode,
int ndim,
26891 size_t sizeof_dtype,
int contig_flag,
26892 int dtype_is_object)
26894 __Pyx_RefNannyDeclarations
26896 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26897 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26898 Py_buffer *buf = &from_memview->view;
26899 PyObject *shape_tuple = NULL;
26900 PyObject *temp_int = NULL;
26901 struct __pyx_array_obj *array_obj = NULL;
26902 struct __pyx_memoryview_obj *memview_obj = NULL;
26903 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
26904 for (i = 0; i < ndim; i++) {
26905 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26906 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
26907 "indirect dimensions (axis %d)", i);
26911 shape_tuple = PyTuple_New(ndim);
26912 if (unlikely(!shape_tuple)) {
26915 __Pyx_GOTREF(shape_tuple);
26916 for(i = 0; i < ndim; i++) {
26917 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26918 if(unlikely(!temp_int)) {
26921 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26925 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
26926 if (unlikely(!array_obj)) {
26929 __Pyx_GOTREF(array_obj);
26930 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26931 (PyObject *) array_obj, contig_flag,
26933 from_mvs->memview->typeinfo);
26934 if (unlikely(!memview_obj))
26936 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26938 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26939 dtype_is_object) < 0))
26943 __Pyx_XDECREF(new_mvs.memview);
26944 new_mvs.memview = NULL;
26945 new_mvs.data = NULL;
26947 __Pyx_XDECREF(shape_tuple);
26948 __Pyx_XDECREF(temp_int);
26949 __Pyx_XDECREF(array_obj);
26950 __Pyx_RefNannyFinishContext();
26955 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
26956 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26957 #pragma GCC diagnostic push
26958 #pragma GCC diagnostic ignored "-Wconversion"
26960 const int neg_one = (int) -1, const_zero = (
int) 0;
26961 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26962 #pragma GCC diagnostic pop
26964 const int is_unsigned = neg_one > const_zero;
26965 #if PY_MAJOR_VERSION < 3
26966 if (likely(PyInt_Check(x))) {
26967 if (
sizeof(
int) <
sizeof(long)) {
26968 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
26970 long val = PyInt_AS_LONG(x);
26971 if (is_unsigned && unlikely(val < 0)) {
26972 goto raise_neg_overflow;
26978 if (likely(PyLong_Check(x))) {
26980 #if CYTHON_USE_PYLONG_INTERNALS
26981 const digit* digits = ((PyLongObject*)x)->ob_digit;
26982 switch (Py_SIZE(x)) {
26983 case 0:
return (
int) 0;
26984 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
26986 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26987 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26988 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26989 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
26990 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26995 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26996 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26997 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26998 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
26999 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27004 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27005 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27006 __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])))
27007 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27008 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27014 #if CYTHON_COMPILING_IN_CPYTHON
27015 if (unlikely(Py_SIZE(x) < 0)) {
27016 goto raise_neg_overflow;
27020 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27021 if (unlikely(result < 0))
27023 if (unlikely(result == 1))
27024 goto raise_neg_overflow;
27027 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27028 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27029 #ifdef HAVE_LONG_LONG
27030 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27031 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27035 #if CYTHON_USE_PYLONG_INTERNALS
27036 const digit* digits = ((PyLongObject*)x)->ob_digit;
27037 switch (Py_SIZE(x)) {
27038 case 0:
return (
int) 0;
27039 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27040 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27042 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27043 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27044 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27045 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27046 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27051 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27052 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27053 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27054 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27055 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27060 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27061 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27062 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27063 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27064 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27069 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27070 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27071 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27072 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27073 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27078 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27079 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27080 __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])))
27081 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27082 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27087 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27088 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27089 __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])))
27090 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27091 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27097 if (
sizeof(
int) <=
sizeof(long)) {
27098 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27099 #ifdef HAVE_LONG_LONG
27100 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27101 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27106 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27107 PyErr_SetString(PyExc_RuntimeError,
27108 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27111 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27112 #if PY_MAJOR_VERSION < 3
27113 if (likely(
v) && !PyLong_Check(
v)) {
27115 v = PyNumber_Long(tmp);
27120 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27121 unsigned char *bytes = (
unsigned char *)&val;
27122 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27123 bytes,
sizeof(val),
27124 is_little, !is_unsigned);
27134 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27135 if (!tmp)
return (
int) -1;
27136 val = __Pyx_PyInt_As_int(tmp);
27141 PyErr_SetString(PyExc_OverflowError,
27142 "value too large to convert to int");
27144 raise_neg_overflow:
27145 PyErr_SetString(PyExc_OverflowError,
27146 "can't convert negative value to int");
27151 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
27152 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27153 #pragma GCC diagnostic push
27154 #pragma GCC diagnostic ignored "-Wconversion"
27156 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
27157 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27158 #pragma GCC diagnostic pop
27160 const int is_unsigned = neg_one > const_zero;
27162 if (
sizeof(npy_int32) <
sizeof(long)) {
27163 return PyInt_FromLong((
long) value);
27164 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned long)) {
27165 return PyLong_FromUnsignedLong((
unsigned long) value);
27166 #ifdef HAVE_LONG_LONG
27167 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned PY_LONG_LONG)) {
27168 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27172 if (
sizeof(npy_int32) <=
sizeof(
long)) {
27173 return PyInt_FromLong((
long) value);
27174 #ifdef HAVE_LONG_LONG
27175 }
else if (
sizeof(npy_int32) <=
sizeof(PY_LONG_LONG)) {
27176 return PyLong_FromLongLong((PY_LONG_LONG) value);
27181 int one = 1;
int little = (int)*(
unsigned char *)&one;
27182 unsigned char *bytes = (
unsigned char *)&value;
27183 return _PyLong_FromByteArray(bytes,
sizeof(npy_int32),
27184 little, !is_unsigned);
27189 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
27190 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27191 #pragma GCC diagnostic push
27192 #pragma GCC diagnostic ignored "-Wconversion"
27194 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
27195 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27196 #pragma GCC diagnostic pop
27198 const int is_unsigned = neg_one > const_zero;
27199 #if PY_MAJOR_VERSION < 3
27200 if (likely(PyInt_Check(x))) {
27201 if (
sizeof(npy_int32) <
sizeof(long)) {
27202 __PYX_VERIFY_RETURN_INT(npy_int32,
long, PyInt_AS_LONG(x))
27204 long val = PyInt_AS_LONG(x);
27205 if (is_unsigned && unlikely(val < 0)) {
27206 goto raise_neg_overflow;
27208 return (npy_int32) val;
27212 if (likely(PyLong_Check(x))) {
27214 #if CYTHON_USE_PYLONG_INTERNALS
27215 const digit* digits = ((PyLongObject*)x)->ob_digit;
27216 switch (Py_SIZE(x)) {
27217 case 0:
return (npy_int32) 0;
27218 case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
27220 if (8 *
sizeof(npy_int32) > 1 * PyLong_SHIFT) {
27221 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27222 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27223 }
else if (8 *
sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
27224 return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27229 if (8 *
sizeof(npy_int32) > 2 * PyLong_SHIFT) {
27230 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27231 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27232 }
else if (8 *
sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
27233 return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27238 if (8 *
sizeof(npy_int32) > 3 * PyLong_SHIFT) {
27239 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27240 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27241 }
else if (8 *
sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
27242 return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27248 #if CYTHON_COMPILING_IN_CPYTHON
27249 if (unlikely(Py_SIZE(x) < 0)) {
27250 goto raise_neg_overflow;
27254 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27255 if (unlikely(result < 0))
27256 return (npy_int32) -1;
27257 if (unlikely(result == 1))
27258 goto raise_neg_overflow;
27261 if (
sizeof(npy_int32) <=
sizeof(
unsigned long)) {
27262 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
unsigned long, PyLong_AsUnsignedLong(x))
27263 #ifdef HAVE_LONG_LONG
27264 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned PY_LONG_LONG)) {
27265 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27269 #if CYTHON_USE_PYLONG_INTERNALS
27270 const digit* digits = ((PyLongObject*)x)->ob_digit;
27271 switch (Py_SIZE(x)) {
27272 case 0:
return (npy_int32) 0;
27273 case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
27274 case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
27276 if (8 *
sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
27277 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27278 __PYX_VERIFY_RETURN_INT(npy_int32,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27279 }
else if (8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27280 return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27285 if (8 *
sizeof(npy_int32) > 1 * PyLong_SHIFT) {
27286 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27287 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27288 }
else if (8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27289 return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27294 if (8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27295 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27296 __PYX_VERIFY_RETURN_INT(npy_int32,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27297 }
else if (8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27298 return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27303 if (8 *
sizeof(npy_int32) > 2 * PyLong_SHIFT) {
27304 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27305 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27306 }
else if (8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27307 return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27312 if (8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27313 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27314 __PYX_VERIFY_RETURN_INT(npy_int32,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27315 }
else if (8 *
sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
27316 return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27321 if (8 *
sizeof(npy_int32) > 3 * PyLong_SHIFT) {
27322 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27323 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27324 }
else if (8 *
sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
27325 return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27331 if (
sizeof(npy_int32) <=
sizeof(long)) {
27332 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
long, PyLong_AsLong(x))
27333 #ifdef HAVE_LONG_LONG
27334 }
else if (
sizeof(npy_int32) <=
sizeof(PY_LONG_LONG)) {
27335 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
27340 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27341 PyErr_SetString(PyExc_RuntimeError,
27342 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27345 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27346 #if PY_MAJOR_VERSION < 3
27347 if (likely(
v) && !PyLong_Check(
v)) {
27349 v = PyNumber_Long(tmp);
27354 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27355 unsigned char *bytes = (
unsigned char *)&val;
27356 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27357 bytes,
sizeof(val),
27358 is_little, !is_unsigned);
27364 return (npy_int32) -1;
27368 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27369 if (!tmp)
return (npy_int32) -1;
27370 val = __Pyx_PyInt_As_npy_int32(tmp);
27375 PyErr_SetString(PyExc_OverflowError,
27376 "value too large to convert to npy_int32");
27377 return (npy_int32) -1;
27378 raise_neg_overflow:
27379 PyErr_SetString(PyExc_OverflowError,
27380 "can't convert negative value to npy_int32");
27381 return (npy_int32) -1;
27385 static CYTHON_INLINE
size_t __Pyx_PyInt_As_size_t(PyObject *x) {
27386 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27387 #pragma GCC diagnostic push
27388 #pragma GCC diagnostic ignored "-Wconversion"
27390 const size_t neg_one = (size_t) -1, const_zero = (
size_t) 0;
27391 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27392 #pragma GCC diagnostic pop
27394 const int is_unsigned = neg_one > const_zero;
27395 #if PY_MAJOR_VERSION < 3
27396 if (likely(PyInt_Check(x))) {
27397 if (
sizeof(
size_t) <
sizeof(long)) {
27398 __PYX_VERIFY_RETURN_INT(
size_t,
long, PyInt_AS_LONG(x))
27400 long val = PyInt_AS_LONG(x);
27401 if (is_unsigned && unlikely(val < 0)) {
27402 goto raise_neg_overflow;
27404 return (
size_t) val;
27408 if (likely(PyLong_Check(x))) {
27410 #if CYTHON_USE_PYLONG_INTERNALS
27411 const digit* digits = ((PyLongObject*)x)->ob_digit;
27412 switch (Py_SIZE(x)) {
27413 case 0:
return (
size_t) 0;
27414 case 1: __PYX_VERIFY_RETURN_INT(
size_t, digit, digits[0])
27416 if (8 *
sizeof(
size_t) > 1 * PyLong_SHIFT) {
27417 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27418 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27419 }
else if (8 *
sizeof(
size_t) >= 2 * PyLong_SHIFT) {
27420 return (
size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27425 if (8 *
sizeof(
size_t) > 2 * PyLong_SHIFT) {
27426 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27427 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27428 }
else if (8 *
sizeof(
size_t) >= 3 * PyLong_SHIFT) {
27429 return (
size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27434 if (8 *
sizeof(
size_t) > 3 * PyLong_SHIFT) {
27435 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27436 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27437 }
else if (8 *
sizeof(
size_t) >= 4 * PyLong_SHIFT) {
27438 return (
size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27444 #if CYTHON_COMPILING_IN_CPYTHON
27445 if (unlikely(Py_SIZE(x) < 0)) {
27446 goto raise_neg_overflow;
27450 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27451 if (unlikely(result < 0))
27452 return (
size_t) -1;
27453 if (unlikely(result == 1))
27454 goto raise_neg_overflow;
27457 if (
sizeof(
size_t) <=
sizeof(
unsigned long)) {
27458 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
unsigned long, PyLong_AsUnsignedLong(x))
27459 #ifdef HAVE_LONG_LONG
27460 }
else if (
sizeof(
size_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
27461 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27465 #if CYTHON_USE_PYLONG_INTERNALS
27466 const digit* digits = ((PyLongObject*)x)->ob_digit;
27467 switch (Py_SIZE(x)) {
27468 case 0:
return (
size_t) 0;
27469 case -1: __PYX_VERIFY_RETURN_INT(
size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
27470 case 1: __PYX_VERIFY_RETURN_INT(
size_t, digit, +digits[0])
27472 if (8 *
sizeof(
size_t) - 1 > 1 * PyLong_SHIFT) {
27473 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27474 __PYX_VERIFY_RETURN_INT(
size_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27475 }
else if (8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT) {
27476 return (
size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
27481 if (8 *
sizeof(
size_t) > 1 * PyLong_SHIFT) {
27482 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27483 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27484 }
else if (8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT) {
27485 return (
size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
27490 if (8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT) {
27491 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27492 __PYX_VERIFY_RETURN_INT(
size_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27493 }
else if (8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT) {
27494 return (
size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27499 if (8 *
sizeof(
size_t) > 2 * PyLong_SHIFT) {
27500 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27501 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27502 }
else if (8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT) {
27503 return (
size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27508 if (8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT) {
27509 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27510 __PYX_VERIFY_RETURN_INT(
size_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27511 }
else if (8 *
sizeof(
size_t) - 1 > 4 * PyLong_SHIFT) {
27512 return (
size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
27517 if (8 *
sizeof(
size_t) > 3 * PyLong_SHIFT) {
27518 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27519 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27520 }
else if (8 *
sizeof(
size_t) - 1 > 4 * PyLong_SHIFT) {
27521 return (
size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
27527 if (
sizeof(
size_t) <=
sizeof(long)) {
27528 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
long, PyLong_AsLong(x))
27529 #ifdef HAVE_LONG_LONG
27530 }
else if (
sizeof(
size_t) <=
sizeof(PY_LONG_LONG)) {
27531 __PYX_VERIFY_RETURN_INT_EXC(
size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
27536 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27537 PyErr_SetString(PyExc_RuntimeError,
27538 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27541 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27542 #if PY_MAJOR_VERSION < 3
27543 if (likely(
v) && !PyLong_Check(
v)) {
27545 v = PyNumber_Long(tmp);
27550 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27551 unsigned char *bytes = (
unsigned char *)&val;
27552 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27553 bytes,
sizeof(val),
27554 is_little, !is_unsigned);
27560 return (
size_t) -1;
27564 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27565 if (!tmp)
return (
size_t) -1;
27566 val = __Pyx_PyInt_As_size_t(tmp);
27571 PyErr_SetString(PyExc_OverflowError,
27572 "value too large to convert to size_t");
27573 return (
size_t) -1;
27574 raise_neg_overflow:
27575 PyErr_SetString(PyExc_OverflowError,
27576 "can't convert negative value to size_t");
27577 return (
size_t) -1;
27581 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27582 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27583 #pragma GCC diagnostic push
27584 #pragma GCC diagnostic ignored "-Wconversion"
27586 const int neg_one = (int) -1, const_zero = (
int) 0;
27587 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27588 #pragma GCC diagnostic pop
27590 const int is_unsigned = neg_one > const_zero;
27592 if (
sizeof(
int) <
sizeof(long)) {
27593 return PyInt_FromLong((
long) value);
27594 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27595 return PyLong_FromUnsignedLong((
unsigned long) value);
27596 #ifdef HAVE_LONG_LONG
27597 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27598 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27602 if (
sizeof(
int) <=
sizeof(
long)) {
27603 return PyInt_FromLong((
long) value);
27604 #ifdef HAVE_LONG_LONG
27605 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27606 return PyLong_FromLongLong((PY_LONG_LONG) value);
27611 int one = 1;
int little = (int)*(
unsigned char *)&one;
27612 unsigned char *bytes = (
unsigned char *)&value;
27613 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27614 little, !is_unsigned);
27619 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
27620 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27621 #pragma GCC diagnostic push
27622 #pragma GCC diagnostic ignored "-Wconversion"
27624 const long neg_one = (long) -1, const_zero = (
long) 0;
27625 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27626 #pragma GCC diagnostic pop
27628 const int is_unsigned = neg_one > const_zero;
27629 #if PY_MAJOR_VERSION < 3
27630 if (likely(PyInt_Check(x))) {
27631 if (
sizeof(
long) <
sizeof(long)) {
27632 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
27634 long val = PyInt_AS_LONG(x);
27635 if (is_unsigned && unlikely(val < 0)) {
27636 goto raise_neg_overflow;
27642 if (likely(PyLong_Check(x))) {
27644 #if CYTHON_USE_PYLONG_INTERNALS
27645 const digit* digits = ((PyLongObject*)x)->ob_digit;
27646 switch (Py_SIZE(x)) {
27647 case 0:
return (
long) 0;
27648 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
27650 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27651 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27652 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27653 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
27654 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27659 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27660 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27661 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27662 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
27663 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27668 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27669 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27670 __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])))
27671 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
27672 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27678 #if CYTHON_COMPILING_IN_CPYTHON
27679 if (unlikely(Py_SIZE(x) < 0)) {
27680 goto raise_neg_overflow;
27684 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27685 if (unlikely(result < 0))
27687 if (unlikely(result == 1))
27688 goto raise_neg_overflow;
27691 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27692 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
27693 #ifdef HAVE_LONG_LONG
27694 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27695 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27699 #if CYTHON_USE_PYLONG_INTERNALS
27700 const digit* digits = ((PyLongObject*)x)->ob_digit;
27701 switch (Py_SIZE(x)) {
27702 case 0:
return (
long) 0;
27703 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
27704 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
27706 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
27707 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27708 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27709 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27710 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27715 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27716 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27717 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27718 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27719 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27724 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27725 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27726 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27727 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27728 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27733 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27734 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27735 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27736 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27737 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27742 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27743 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27744 __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])))
27745 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27746 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27751 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27752 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27753 __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])))
27754 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27755 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27761 if (
sizeof(
long) <=
sizeof(long)) {
27762 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
27763 #ifdef HAVE_LONG_LONG
27764 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27765 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27770 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27771 PyErr_SetString(PyExc_RuntimeError,
27772 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27775 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27776 #if PY_MAJOR_VERSION < 3
27777 if (likely(
v) && !PyLong_Check(
v)) {
27779 v = PyNumber_Long(tmp);
27784 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27785 unsigned char *bytes = (
unsigned char *)&val;
27786 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27787 bytes,
sizeof(val),
27788 is_little, !is_unsigned);
27798 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27799 if (!tmp)
return (
long) -1;
27800 val = __Pyx_PyInt_As_long(tmp);
27805 PyErr_SetString(PyExc_OverflowError,
27806 "value too large to convert to long");
27808 raise_neg_overflow:
27809 PyErr_SetString(PyExc_OverflowError,
27810 "can't convert negative value to long");
27815 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27816 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27817 #pragma GCC diagnostic push
27818 #pragma GCC diagnostic ignored "-Wconversion"
27820 const long neg_one = (long) -1, const_zero = (
long) 0;
27821 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27822 #pragma GCC diagnostic pop
27824 const int is_unsigned = neg_one > const_zero;
27826 if (
sizeof(
long) <
sizeof(long)) {
27827 return PyInt_FromLong((
long) value);
27828 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27829 return PyLong_FromUnsignedLong((
unsigned long) value);
27830 #ifdef HAVE_LONG_LONG
27831 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27832 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27836 if (
sizeof(
long) <=
sizeof(
long)) {
27837 return PyInt_FromLong((
long) value);
27838 #ifdef HAVE_LONG_LONG
27839 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27840 return PyLong_FromLongLong((PY_LONG_LONG) value);
27845 int one = 1;
int little = (int)*(
unsigned char *)&one;
27846 unsigned char *bytes = (
unsigned char *)&value;
27847 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27848 little, !is_unsigned);
27853 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
27854 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27855 #pragma GCC diagnostic push
27856 #pragma GCC diagnostic ignored "-Wconversion"
27858 const char neg_one = (char) -1, const_zero = (
char) 0;
27859 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27860 #pragma GCC diagnostic pop
27862 const int is_unsigned = neg_one > const_zero;
27863 #if PY_MAJOR_VERSION < 3
27864 if (likely(PyInt_Check(x))) {
27865 if (
sizeof(
char) <
sizeof(long)) {
27866 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
27868 long val = PyInt_AS_LONG(x);
27869 if (is_unsigned && unlikely(val < 0)) {
27870 goto raise_neg_overflow;
27876 if (likely(PyLong_Check(x))) {
27878 #if CYTHON_USE_PYLONG_INTERNALS
27879 const digit* digits = ((PyLongObject*)x)->ob_digit;
27880 switch (Py_SIZE(x)) {
27881 case 0:
return (
char) 0;
27882 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
27884 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27885 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27886 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27887 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
27888 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27893 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27894 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27895 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27896 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
27897 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27902 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27903 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27904 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27905 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
27906 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27912 #if CYTHON_COMPILING_IN_CPYTHON
27913 if (unlikely(Py_SIZE(x) < 0)) {
27914 goto raise_neg_overflow;
27918 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27919 if (unlikely(result < 0))
27921 if (unlikely(result == 1))
27922 goto raise_neg_overflow;
27925 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
27926 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
27927 #ifdef HAVE_LONG_LONG
27928 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
27929 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27933 #if CYTHON_USE_PYLONG_INTERNALS
27934 const digit* digits = ((PyLongObject*)x)->ob_digit;
27935 switch (Py_SIZE(x)) {
27936 case 0:
return (
char) 0;
27937 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
27938 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
27940 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
27941 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27942 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27943 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27944 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27949 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27950 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27951 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27952 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27953 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27958 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27959 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27960 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27961 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27962 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27967 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27968 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27969 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27970 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27971 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27976 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27977 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27978 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27979 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27980 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27985 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27986 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27987 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27988 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27989 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27995 if (
sizeof(
char) <=
sizeof(long)) {
27996 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
27997 #ifdef HAVE_LONG_LONG
27998 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
27999 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28004 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28005 PyErr_SetString(PyExc_RuntimeError,
28006 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28009 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28010 #if PY_MAJOR_VERSION < 3
28011 if (likely(
v) && !PyLong_Check(
v)) {
28013 v = PyNumber_Long(tmp);
28018 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28019 unsigned char *bytes = (
unsigned char *)&val;
28020 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28021 bytes,
sizeof(val),
28022 is_little, !is_unsigned);
28032 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28033 if (!tmp)
return (
char) -1;
28034 val = __Pyx_PyInt_As_char(tmp);
28039 PyErr_SetString(PyExc_OverflowError,
28040 "value too large to convert to char");
28042 raise_neg_overflow:
28043 PyErr_SetString(PyExc_OverflowError,
28044 "can't convert negative value to char");
28049 static int __Pyx_check_binary_version(
void) {
28051 int same=1, i, found_dot;
28052 const char* rt_from_call = Py_GetVersion();
28053 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28055 for (i = 0; i < 4; i++) {
28056 if (!ctversion[i]) {
28057 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
28060 if (rt_from_call[i] != ctversion[i]) {
28066 char rtversion[5] = {
'\0'};
28068 for (i=0; i<4; ++i) {
28069 if (rt_from_call[i] ==
'.') {
28070 if (found_dot)
break;
28072 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
28075 rtversion[i] = rt_from_call[i];
28077 PyOS_snprintf(message,
sizeof(message),
28078 "compiletime version %s of module '%.100s' "
28079 "does not match runtime version %s",
28080 ctversion, __Pyx_MODULE_NAME, rtversion);
28081 return PyErr_WarnEx(NULL, message, 1);
28087 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28089 #if PY_MAJOR_VERSION < 3
28090 if (t->is_unicode) {
28091 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28092 }
else if (t->intern) {
28093 *t->p = PyString_InternFromString(t->s);
28095 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28098 if (t->is_unicode | t->is_str) {
28100 *t->p = PyUnicode_InternFromString(t->s);
28101 }
else if (t->encoding) {
28102 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28104 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28107 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28112 if (PyObject_Hash(*t->p) == -1)
28119 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28120 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28122 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28124 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28126 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28127 #if !CYTHON_PEP393_ENABLED
28128 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28130 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28131 if (!defenc)
return NULL;
28132 defenc_c = PyBytes_AS_STRING(defenc);
28133 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28135 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28137 for (
c = defenc_c;
c < end;
c++) {
28138 if ((
unsigned char) (*
c) >= 128) {
28139 PyUnicode_AsASCIIString(o);
28145 *length = PyBytes_GET_SIZE(defenc);
28149 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28150 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28151 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28152 if (likely(PyUnicode_IS_ASCII(o))) {
28153 *length = PyUnicode_GET_LENGTH(o);
28154 return PyUnicode_AsUTF8(o);
28156 PyUnicode_AsASCIIString(o);
28160 return PyUnicode_AsUTF8AndSize(o, length);
28165 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28166 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28168 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28169 __Pyx_sys_getdefaultencoding_not_ascii &&
28171 PyUnicode_Check(o)) {
28172 return __Pyx_PyUnicode_AsStringAndSize(o, length);
28175 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28176 if (PyByteArray_Check(o)) {
28177 *length = PyByteArray_GET_SIZE(o);
28178 return PyByteArray_AS_STRING(o);
28183 int r = PyBytes_AsStringAndSize(o, &result, length);
28184 if (unlikely(
r < 0)) {
28191 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
28192 int is_true = x == Py_True;
28193 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
28194 else return PyObject_IsTrue(x);
28196 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28198 if (unlikely(!x))
return -1;
28199 retval = __Pyx_PyObject_IsTrue(x);
28203 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
28204 #if PY_MAJOR_VERSION >= 3
28205 if (PyLong_Check(result)) {
28206 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28207 "__int__ returned non-int (type %.200s). "
28208 "The ability to return an instance of a strict subclass of int "
28209 "is deprecated, and may be removed in a future version of Python.",
28210 Py_TYPE(result)->tp_name)) {
28217 PyErr_Format(PyExc_TypeError,
28218 "__%.4s__ returned non-%.4s (type %.200s)",
28219 type_name, type_name, Py_TYPE(result)->tp_name);
28223 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28224 #if CYTHON_USE_TYPE_SLOTS
28225 PyNumberMethods *m;
28227 const char *name = NULL;
28228 PyObject *res = NULL;
28229 #if PY_MAJOR_VERSION < 3
28230 if (likely(PyInt_Check(x) || PyLong_Check(x)))
28232 if (likely(PyLong_Check(x)))
28234 return __Pyx_NewRef(x);
28235 #if CYTHON_USE_TYPE_SLOTS
28236 m = Py_TYPE(x)->tp_as_number;
28237 #if PY_MAJOR_VERSION < 3
28238 if (m && m->nb_int) {
28240 res = m->nb_int(x);
28242 else if (m && m->nb_long) {
28244 res = m->nb_long(x);
28247 if (likely(m && m->nb_int)) {
28249 res = m->nb_int(x);
28253 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28254 res = PyNumber_Int(x);
28258 #if PY_MAJOR_VERSION < 3
28259 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28261 if (unlikely(!PyLong_CheckExact(res))) {
28263 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28266 else if (!PyErr_Occurred()) {
28267 PyErr_SetString(PyExc_TypeError,
28268 "an integer is required");
28272 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28275 #if PY_MAJOR_VERSION < 3
28276 if (likely(PyInt_CheckExact(b))) {
28277 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
28278 return PyInt_AS_LONG(b);
28280 return PyInt_AsSsize_t(b);
28283 if (likely(PyLong_CheckExact(b))) {
28284 #if CYTHON_USE_PYLONG_INTERNALS
28285 const digit* digits = ((PyLongObject*)b)->ob_digit;
28286 const Py_ssize_t size = Py_SIZE(b);
28287 if (likely(__Pyx_sst_abs(size) <= 1)) {
28288 ival = likely(size) ? digits[0] : 0;
28289 if (size == -1) ival = -ival;
28294 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28295 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28299 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28300 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28304 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28305 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28309 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28310 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28314 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28315 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]));
28319 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28320 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]));
28326 return PyLong_AsSsize_t(b);
28328 x = PyNumber_Index(b);
28330 ival = PyInt_AsSsize_t(x);
28334 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
28335 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
28336 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
28337 #if PY_MAJOR_VERSION < 3
28338 }
else if (likely(PyInt_CheckExact(o))) {
28339 return PyInt_AS_LONG(o);
28344 x = PyNumber_Index(o);
28346 ival = PyInt_AsLong(x);
28351 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28352 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28354 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28355 return PyInt_FromSize_t(ival);